diff --git a/.gitignore b/.gitignore index 669ceea31bd4..bfa19a69b23c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,15 @@ tools/bin /contrib/cleanroles/cleanroles /contrib/admission-tracer/admission-tracer +# CAPI provider vendor directories (downloaded on demand by make capi-sync) +hack/capi-vendor/*/vendor/ + +# CAPI sync stamps (tracks whether pkg/capi types are up-to-date) +pkg/capi/*/.synced + +# CAPI provider go.sum files (generated by Go tooling from go.mod) +pkg/capi/*/go.sum + # SNYK CLI cache data .dccache diff --git a/.golangci.yml b/.golangci.yml index 08c34396b455..aec59ac60239 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -42,6 +42,10 @@ linters: - linters: - unparam path: 'support/thirdparty/' + - linters: + - gocyclo + - unparam + path: 'hack/' - linters: - staticcheck text: 'SA1019: hcp.Status.Version is deprecated: Use versionStatus.desired.version instead.' @@ -90,6 +94,7 @@ linters: - third_party$ - builtin$ - examples$ + - pkg/capi/ severity: default: error formatters: @@ -115,3 +120,4 @@ formatters: - third_party$ - builtin$ - examples$ + - pkg/capi/ diff --git a/Makefile b/Makefile index 939ffcd68220..72bd6ac8f05e 100644 --- a/Makefile +++ b/Makefile @@ -91,8 +91,10 @@ pre-commit: all verify test build: hypershift-operator control-plane-operator control-plane-pki-operator karpenter-operator hypershift product-cli +CAPI_PROVIDERS := agent aws azure gcp ibmcloud kubevirt openstack + .PHONY: update -update: api-deps workspace-sync deps api api-docs clients docs-aggregate +update: api-deps capi-sync workspace-sync deps api api-docs clients docs-aggregate GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint) $(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod # Build golangci-lint from tools folder. @@ -280,12 +282,15 @@ cluster-api: $(CONTROLLER_GEN) $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api/api/ipam/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api/api/addons/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api +# CAPI provider CRD targets must run controller-gen from the workspace directory +# because each pkg/capi/ is a separate Go module with a minimal go.mod. +# The workspace resolves cross-module dependencies that controller-gen needs. +CAPI_CRD_GEN = cd $(DIR)/hack/workspace && GOWORK=$(DIR)/hack/workspace/go.work GOFLAGS= $(CONTROLLER_GEN) $(CRD_OPTIONS) + .PHONY: cluster-api-provider-aws cluster-api-provider-aws: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-aws/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-aws - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-aws - + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-aws/v2/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-aws # remove ROSA CRDs rm -rf cmd/install/assets/crds/cluster-api-provider-aws/infrastructure.cluster.x-k8s.io_rosa*.yaml # remove EKS CRDs @@ -295,34 +300,34 @@ cluster-api-provider-aws: $(CONTROLLER_GEN) .PHONY: cluster-api-provider-gcp cluster-api-provider-gcp: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-gcp/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-gcp/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-gcp + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-gcp/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-gcp .PHONY: cluster-api-provider-ibmcloud cluster-api-provider-ibmcloud: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-ibmcloud/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-ibmcloud + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-ibmcloud/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-ibmcloud .PHONY: cluster-api-provider-kubevirt cluster-api-provider-kubevirt: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-kubevirt/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1" output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-kubevirt + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-kubevirt/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-kubevirt .PHONY: cluster-api-provider-agent cluster-api-provider-agent: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-agent/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/github.com/openshift/cluster-api-provider-agent/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-agent + $(CAPI_CRD_GEN) paths="github.com/openshift/cluster-api-provider-agent/api/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-agent .PHONY: cluster-api-provider-azure cluster-api-provider-azure: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-azure/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-azure/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-azure + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-azure/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-azure # remove CAPZ managed CRDS rm -rf cmd/install/assets/crds/cluster-api-provider-azure/infrastructure.cluster.x-k8s.io_azuremanaged*.yaml .PHONY: cluster-api-provider-openstack cluster-api-provider-openstack: $(CONTROLLER_GEN) rm -rf cmd/install/assets/crds/cluster-api-provider-openstack/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/sigs.k8s.io/cluster-api-provider-openstack/api/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-openstack + $(CAPI_CRD_GEN) paths="sigs.k8s.io/cluster-api-provider-openstack/..." output:crd:artifacts:config=$(DIR)/cmd/install/assets/crds/cluster-api-provider-openstack $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./vendor/github.com/k-orc/openstack-resource-controller/..." output:crd:artifacts:config=cmd/install/assets/crds/cluster-api-provider-openstack .PHONY: api-docs @@ -549,6 +554,31 @@ api-deps: $(GO) mod verify && \ $(GO) list -m -mod=readonly -json all > /dev/null +CAPI_SYNC_STAMPS := $(foreach p,$(CAPI_PROVIDERS),$(DIR)/pkg/capi/$(p)/.synced) + +# Per-provider sync: re-run only when hack/capi-vendor//go.mod changes. +$(DIR)/pkg/capi/%/.synced: $(DIR)/hack/capi-vendor/%/go.mod $(CONTROLLER_GEN) + @echo "Resolving CAPI provider deps: $*" + cd $(DIR)/hack/capi-vendor/$* && $(GO) mod tidy && $(GO) mod download + @echo "Syncing CAPI provider: $*" + CONTROLLER_GEN=$(CONTROLLER_GEN) $(DIR)/hack/capi-sync-provider.sh $* + @touch $@ + +.PHONY: capi-deps +capi-deps: + @for p in $(CAPI_PROVIDERS); do \ + echo "Resolving CAPI provider deps: $$p"; \ + cd $(DIR)/hack/capi-vendor/$$p && $(GO) mod tidy && $(GO) mod download; \ + done + +.PHONY: capi-sync +capi-sync: $(CAPI_SYNC_STAMPS) + +.PHONY: capi-sync-force +capi-sync-force: + @rm -f $(CAPI_SYNC_STAMPS) + @$(MAKE) capi-sync + .PHONY: workspace-sync workspace-sync: cd hack/workspace && \ @@ -601,7 +631,7 @@ verify-docs-nav: $(PYYAML_STAMP) ## Verify docs nav entries are sorted alphabeti .PHONY: verify-codespell verify-codespell: codespell ## Verify codespell. - @$(CODESPELL) --count --ignore-words=./.codespellignore --skip="./hack/tools/bin/codespell_dist,./docs/site/*,./vendor/*,./api/vendor/*,./hack/tools/vendor/*,./api/hypershift/v1alpha1/*,./support/thirdparty/*,./docs/content/reference/*,./hack/tools/bin/*,./cmd/install/assets/*,./go.sum,./api/go.sum,./hack/workspace/go.work.sum,./api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests,./hack/tools/go.mod,./hack/tools/go.sum,./karpenter-operator/controllers/karpenter/assets/*.yaml,./dev/*" + @$(CODESPELL) --count --ignore-words=./.codespellignore --skip="./hack/tools/bin/codespell_dist,./docs/site/*,./vendor/*,./api/vendor/*,./hack/tools/vendor/*,./api/hypershift/v1alpha1/*,./support/thirdparty/*,./docs/content/reference/*,./hack/tools/bin/*,./cmd/install/assets/*,./go.sum,./api/go.sum,./hack/workspace/go.work.sum,./api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests,./hack/tools/go.mod,./hack/tools/go.sum,./karpenter-operator/controllers/karpenter/assets/*.yaml,./dev/*,./pkg/capi/*,./hack/capi-vendor/*" .PHONY: verify-api-deps verify-api-deps: $(VERIFY_API_DEPS) ## Verify API dependencies against allowlist. diff --git a/go.mod b/go.mod index 9f6766e6c333..392f712872e0 100644 --- a/go.mod +++ b/go.mod @@ -137,7 +137,6 @@ require ( cloud.google.com/go/compute/metadata v0.9.0 // indirect cyphar.com/go-pathrs v0.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect @@ -149,14 +148,12 @@ require ( github.com/PaesslerAG/jsonpath v0.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22 // indirect - github.com/aws/aws-sdk-go-v2/service/eks v1.77.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect @@ -222,7 +219,6 @@ require ( github.com/google/s2a-go v0.1.9 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.15 // indirect github.com/googleapis/gax-go/v2 v2.22.0 // indirect - github.com/gophercloud/gophercloud/v2 v2.10.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect @@ -237,6 +233,7 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect + github.com/mattn/go-colorable v0.1.14 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -250,7 +247,6 @@ require ( github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/selinux v1.13.0 // indirect - github.com/openshift-online/ocm-common v0.0.31 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect @@ -297,6 +293,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect k8s.io/cloud-provider v0.35.0 // indirect + k8s.io/cluster-bootstrap v0.34.3 // indirect k8s.io/component-helpers v0.35.1 // indirect k8s.io/csi-translation-lib v0.35.0 // indirect k8s.io/kms v0.35.1 // indirect @@ -313,6 +310,16 @@ require ( replace github.com/openshift/hypershift/api => ./api +replace ( + github.com/openshift/cluster-api-provider-agent/api => ./pkg/capi/agent + sigs.k8s.io/cluster-api-provider-aws/v2 => ./pkg/capi/aws + sigs.k8s.io/cluster-api-provider-azure => ./pkg/capi/azure + sigs.k8s.io/cluster-api-provider-gcp => ./pkg/capi/gcp + sigs.k8s.io/cluster-api-provider-ibmcloud => ./pkg/capi/ibmcloud + sigs.k8s.io/cluster-api-provider-kubevirt => ./pkg/capi/kubevirt + sigs.k8s.io/cluster-api-provider-openstack => ./pkg/capi/openstack +) + // orc currently lives in CAPO replace github.com/k-orc/openstack-resource-controller => sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32 diff --git a/go.sum b/go.sum index 4825c1328e58..a1207a32dc50 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,6 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6Xu github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0 h1:Hp+EScFOu9HeCbeW8WU2yQPJd4gGwhMgKxWe+G6jNzw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0/go.mod h1:/pz8dyNQe+Ey3yBp/XuYz7oqX8YDNWVpPB0hH3XWfbc= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxwrQ919lCZoNCd69rVt8u1eLZuMORrGXqy8sNf3c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0/go.mod h1:fSvRkb8d26z9dbL40Uf/OO6Vo9iExtZK3D0ulRV+8M0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= @@ -49,8 +47,6 @@ github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfg github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0 h1:BM85pSYlVYQHdq00nxyPoOkyLF5NArJG3bOsrmbwr4k= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.7.0/go.mod h1:QYjP2cB7ZYtS/8jAbE0VSBZde/tjExqGjp+8JY6/+ts= -github.com/Azure/azure-service-operator/v2 v2.13.0 h1:24xDkuGOjSDKKkthECRo/I76slmlt3u0buYQ4rvX3pQ= -github.com/Azure/azure-service-operator/v2 v2.13.0/go.mod h1:3xfZMZm4yjdcjr3lh1kWqP2dtvZS/nCy7wpNERYDatg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/msi-dataplane v0.4.3 h1:dWPWzY4b54tLIR9T1Q014Xxd/1DxOsMIp6EjRFAJlQY= @@ -104,8 +100,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 h1:I+Cy77zrFmVWIHOZaxiNV4L7w9xuVux9LMqAblGzvdE= -github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23/go.mod h1:S7DsXubvw3xBC8rSI+qmzcTNw7xEND0ojHPqglh/whY= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY= @@ -182,8 +176,6 @@ github.com/awslabs/operatorpkg v0.0.0-20251222193911-34e9a1898737 h1:hF8FFDPnboX github.com/awslabs/operatorpkg v0.0.0-20251222193911-34e9a1898737/go.mod h1:reUhRkYche5Vkz+ACdxho8smFwdAspzr8rpA2dNqsVQ= github.com/awslabs/operatorpkg/aws v0.0.0-20250414225955-b47cd315ffe9 h1:Li3ZDz/k5Ob9gRzBvZ5qP3zaE183FWaBTYKayURTub8= github.com/awslabs/operatorpkg/aws v0.0.0-20250414225955-b47cd315ffe9/go.mod h1:XuupixySxAZwqT/PRxIce7JqAI8NaKUer/TIdm3OMA4= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -441,8 +433,6 @@ github.com/googleapis/gax-go/v2 v2.22.0 h1:PjIWBpgGIVKGoCXuiCoP64altEJCj3/Ei+kSU github.com/googleapis/gax-go/v2 v2.22.0/go.mod h1:irWBbALSr0Sk3qlqb9SyJ1h68WjgeFuiOzI4Rqw5+aY= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gophercloud/gophercloud/v2 v2.10.0 h1:NRadC0aHNvy4iMoFXj5AFiPmut/Sj3hAPAo9B59VMGc= -github.com/gophercloud/gophercloud/v2 v2.10.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= @@ -476,8 +466,6 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc= -github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -601,8 +589,6 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opencontainers/selinux v1.13.0 h1:Zza88GWezyT7RLql12URvoxsbLfjFx988+LGaWfbL84= github.com/opencontainers/selinux v1.13.0/go.mod h1:XxWTed+A/s5NNq4GmYScVy+9jzXhGBVEOAyucdRUY8s= -github.com/openshift-online/ocm-common v0.0.31 h1:csxB4UQAUhwhDOVBmOzUKgtemuwV9rhCkzMoeFX8zCQ= -github.com/openshift-online/ocm-common v0.0.31/go.mod h1:VEkuZp9aqbXtetZ5ycND6QpvhykvTuBF3oPsVM1X3vI= github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80 h1:r0S/yoZAI0iWo1JvoIijaIgWGWf/izg4WiV7Wrtz16k= github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= github.com/openshift/aws-karpenter-provider-aws v0.0.0-20260311064431-f0be9c72e5bf h1:ymEMrGiXp+PTd+Xd0Y7Jx8cNzaidg51AFyy+5tcvz+c= @@ -611,8 +597,6 @@ github.com/openshift/client-go v0.0.0-20260416131737-a19e91702ab5 h1:R5gdIA+R7MO github.com/openshift/client-go v0.0.0-20260416131737-a19e91702ab5/go.mod h1:u56GmXEMF6bvws8ipkT1ZRNJH52RF5sZ/yRP+6PwkH4= github.com/openshift/cloud-credential-operator v0.0.0-20250225003505-216fd1a30ec3 h1:cr5nU1+O8sEvZHpAAk1mTTGu3NMbgj0dC2cFxFjwmzw= github.com/openshift/cloud-credential-operator v0.0.0-20250225003505-216fd1a30ec3/go.mod h1:WHi2cToOBZyHQea0Yq3qVnOQRl6OMTGBPJMi0c4/GS8= -github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1 h1:TIHSRRDDxhbsziSrQcXORPyGu66yr1Fk8vLTCo7wY+Y= -github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1/go.mod h1:/hEmyZ903PeqntDSxLgZcje96/2lC3PmvsnUABQpR8Q= github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675 h1:hPFyXtaR42wqKKGMVP4G7M2vmp5iBxBqKetMguh4Td0= github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675/go.mod h1:0tGCwMCgKq7KhJWDGr6Tsqqb6Sk3epz/b6tfFDFK1Ug= github.com/openshift/cluster-node-tuning-operator v0.0.0-20260527203700-73801cc280b3 h1:oZXGbNRqAqe+mPEvC2GP4fWtkkn5isB6G+PyxpNKaEQ= @@ -632,7 +616,6 @@ github.com/operator-framework/api v0.37.0/go.mod h1:NZs4vB+Jiamyv3pdPDjZtuC4U7KX github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -676,8 +659,6 @@ github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= -github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= @@ -1074,18 +1055,6 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 h1:qPrZsv1cwQiFe sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= -sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0 h1:E28NopVRAtnenHsfh54VwS2uEpGAkW0bv6Y19bqAwCg= -sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0/go.mod h1:cuuFljMXGat8qW+lvSdYEWReR0DSauv19/rh+bpobl4= -sigs.k8s.io/cluster-api-provider-azure v1.22.0 h1:TL+QXMVCeY2zR41PSlH2jyhQivDXXPGT8wqG4LX92ss= -sigs.k8s.io/cluster-api-provider-azure v1.22.0/go.mod h1:ivn6SfniydSCKi+pzGUaNlH1rFcavqRKw0iy1g9l7Nc= -sigs.k8s.io/cluster-api-provider-gcp v1.11.0 h1:I3sroBY64nAGCzt3aerpGMM76WU3UyjP429kEC0vJ5Y= -sigs.k8s.io/cluster-api-provider-gcp v1.11.0/go.mod h1:vUbA5VeL+YRoxzNQ/vBzRcoHcFMMkWwgcX8DdG3Xcuc= -sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 h1:0+jfWLg+UmnGOdHZ9SrEpnUJgQPyyXpcjXGdkN5E5M4= -sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0/go.mod h1:OENB/2pEx2IgYAovlV7qHvOJYyBoKc94TxNqnjjyWYs= -sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1 h1:6He4EkFNVsEpYsObVRh1agt1/CxhqdqsOvEvyjRWWzk= -sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1/go.mod h1:so1WRGRRsxT4lqS0htpUqXrXLy0guBklh9UPVxoilLY= -sigs.k8s.io/cluster-api-provider-openstack v0.13.3 h1:qBPgWG1E3wiiK8+VR5a3jnKGTyDPo6ZbXruTLOXw/3w= -sigs.k8s.io/cluster-api-provider-openstack v0.13.3/go.mod h1:McuqrgmgsbK4yaC1HKqJ7dxKnOERmXQedUUL15sqelQ= sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32 h1:AkFSgi+dAnPLtg+SXjtCf3rDzjI/mskDiJ1PWHZoRno= sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32/go.mod h1:hQOMZZjzuAt9pdLaE/tj5ByDTVNBkqNaP10ijnqNZfU= sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= diff --git a/hack/capi-sync-provider.sh b/hack/capi-sync-provider.sh new file mode 100755 index 000000000000..afd0942a7d81 --- /dev/null +++ b/hack/capi-sync-provider.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash +set -euo pipefail + +PROVIDER="${1:?usage: capi-sync-provider.sh }" +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +MOD_DIR="$ROOT/hack/capi-vendor/$PROVIDER" +DST_DIR="$ROOT/pkg/capi/$PROVIDER" +COPY_TOOL="$ROOT/hack/copy-capi-types/main.go" +BOILERPLATE="$ROOT/hack/boilerplate.go.txt" +CONTROLLER_GEN="${CONTROLLER_GEN:-controller-gen}" + +run_go() { + GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go "$@" +} + +# Download a module into the cache and print its directory. +mod_cache_dir() { + local module="$1" + (cd "$MOD_DIR" && GO111MODULE=on GOWORK=off GOFLAGS= go mod download -json "$module") | \ + sed -n 's/.*"Dir": *"\(.*\)".*/\1/p' +} + +copy_types() { + local src="$1" dst="$2" + shift 2 + rm -rf "$dst" + run_go run "$COPY_TOOL" --src "$src" --dst "$dst" "$@" +} + +case "$PROVIDER" in + agent) + SRC=$(mod_cache_dir "github.com/openshift/cluster-api-provider-agent/api") + copy_types "$SRC/v1alpha1" "$DST_DIR/v1alpha1" + copy_types "$SRC/v1beta1" "$DST_DIR/v1beta1" + ;; + aws) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-aws/v2") + copy_types "$SRC/api/v1beta1" "$DST_DIR/api/v1beta1" \ + --allow sigs.k8s.io/cluster-api-provider-aws/v2/api/ + copy_types "$SRC/api/v1beta2" "$DST_DIR/api/v1beta2" + copy_types "$SRC/exp/api/v1beta1" "$DST_DIR/exp/api/v1beta1" \ + --allow sigs.k8s.io/cluster-api-provider-aws/v2/api/ + copy_types "$SRC/exp/api/v1beta2" "$DST_DIR/exp/api/v1beta2" \ + --allow sigs.k8s.io/cluster-api-provider-aws/v2/api/ + # Remove ROSA/EKS/Fargate/Managed types — HyperShift doesn't use them and + # stripping leaves broken cross-references to banned rosacontrolplane imports. + find "$DST_DIR" \( -name 'rosa*' -o -name 'awsfargate*' -o -name 'awsmanaged*' \) -exec rm -f {} + + ;; + azure) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-azure") + copy_types "$SRC/api/v1beta1" "$DST_DIR/api/v1beta1" + ;; + gcp) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-gcp") + copy_types "$SRC/api/v1beta1" "$DST_DIR/api/v1beta1" + ;; + ibmcloud) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-ibmcloud") + copy_types "$SRC/api/v1beta1" "$DST_DIR/api/v1beta1" + copy_types "$SRC/api/v1beta2" "$DST_DIR/api/v1beta2" + ;; + kubevirt) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-kubevirt") + copy_types "$SRC/api/v1alpha1" "$DST_DIR/api/v1alpha1" \ + --allow "kubevirt.io/api" + ;; + openstack) + SRC=$(mod_cache_dir "sigs.k8s.io/cluster-api-provider-openstack") + # Copy the utils packages first (they are runtime deps of the types) + copy_types "$SRC/pkg/utils/optional" "$DST_DIR/pkg/utils/optional" + copy_types "$SRC/pkg/utils/errors" "$DST_DIR/pkg/utils/errors" + + copy_types "$SRC/api/v1beta1" "$DST_DIR/api/v1beta1" \ + --allow "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/" + copy_types "$SRC/api/v1alpha1" "$DST_DIR/api/v1alpha1" \ + --allow "sigs.k8s.io/cluster-api-provider-openstack/api/" \ + --allow "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/" + ;; + *) + echo "ERROR: unknown provider: $PROVIDER" >&2 + exit 1 + ;; +esac + +# Remove upstream test files and conversion machinery — HyperShift uses the +# copied types for CRD generation and controller references, not for CAPI's +# conversion webhooks or upstream tests. +find "$DST_DIR" \( -name '*_test.go' -o -name '*conversion*' \) -exec rm -f {} + + +# Map provider names to their upstream module paths for controller-gen. +# controller-gen must resolve types from the workspace because each +# pkg/capi/ is a separate Go module with a minimal go.mod. +upstream_module() { + case "$1" in + agent) echo "github.com/openshift/cluster-api-provider-agent/api" ;; + aws) echo "sigs.k8s.io/cluster-api-provider-aws/v2" ;; + azure) echo "sigs.k8s.io/cluster-api-provider-azure" ;; + gcp) echo "sigs.k8s.io/cluster-api-provider-gcp" ;; + ibmcloud) echo "sigs.k8s.io/cluster-api-provider-ibmcloud" ;; + kubevirt) echo "sigs.k8s.io/cluster-api-provider-kubevirt" ;; + openstack) echo "sigs.k8s.io/cluster-api-provider-openstack" ;; + esac +} + +echo "Running controller-gen for deepcopy..." +MODULE_PATH=$(upstream_module "$PROVIDER") +cd "$ROOT/hack/workspace" +GOWORK="$ROOT/hack/workspace/go.work" GOFLAGS= \ + "$CONTROLLER_GEN" object:headerFile="$BOILERPLATE" paths="$MODULE_PATH/..." + +echo "Done syncing $PROVIDER" diff --git a/hack/capi-vendor/agent/go.mod b/hack/capi-vendor/agent/go.mod new file mode 100644 index 000000000000..350aa02041bd --- /dev/null +++ b/hack/capi-vendor/agent/go.mod @@ -0,0 +1,55 @@ +module github.com/openshift/hypershift/hack/capi-vendor/agent + +go 1.25.7 + +require github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1 + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/agent/go.sum b/hack/capi-vendor/agent/go.sum new file mode 100644 index 000000000000..7dd06c1a4749 --- /dev/null +++ b/hack/capi-vendor/agent/go.sum @@ -0,0 +1,141 @@ +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80 h1:r0S/yoZAI0iWo1JvoIijaIgWGWf/izg4WiV7Wrtz16k= +github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= +github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1 h1:TIHSRRDDxhbsziSrQcXORPyGu66yr1Fk8vLTCo7wY+Y= +github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1/go.mod h1:/hEmyZ903PeqntDSxLgZcje96/2lC3PmvsnUABQpR8Q= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/agent/vendor_imports.go b/hack/capi-vendor/agent/vendor_imports.go new file mode 100644 index 000000000000..bcee127abc70 --- /dev/null +++ b/hack/capi-vendor/agent/vendor_imports.go @@ -0,0 +1,8 @@ +//go:build tools + +package agent + +import ( + _ "github.com/openshift/cluster-api-provider-agent/api/v1alpha1" + _ "github.com/openshift/cluster-api-provider-agent/api/v1beta1" +) diff --git a/hack/capi-vendor/aws/go.mod b/hack/capi-vendor/aws/go.mod new file mode 100644 index 000000000000..466d8402d9d4 --- /dev/null +++ b/hack/capi-vendor/aws/go.mod @@ -0,0 +1,91 @@ +module github.com/openshift/hypershift/hack/capi-vendor/aws + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0 + +require ( + github.com/aws/aws-sdk-go-v2 v1.41.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.279.2 // indirect + github.com/aws/aws-sdk-go-v2/service/eks v1.77.0 // indirect + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.54.7 // indirect + github.com/aws/smithy-go v1.24.2 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/evanphx/json-patch v5.9.11+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.18.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/openshift-online/ocm-common v0.0.31 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.67.5 // indirect + github.com/prometheus/procfs v0.19.2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel v1.43.0 // indirect + go.opentelemetry.io/otel/trace v1.43.0 // indirect + go.uber.org/zap v1.28.0 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/crypto v0.51.0 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/term v0.43.0 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/time v0.15.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/component-base v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/aws/go.sum b/hack/capi-vendor/aws/go.sum new file mode 100644 index 000000000000..d164109db171 --- /dev/null +++ b/hack/capi-vendor/aws/go.sum @@ -0,0 +1,224 @@ +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY= +github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.279.2 h1:MG12Z/W1zzJLkw2gCU2gKZ872rqLM0pi9LdkZ/z3FHc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.279.2/go.mod h1:Uy+C+Sc58jozdoL1McQr8bDsEvNFx+/nBY+vpO1HVUY= +github.com/aws/aws-sdk-go-v2/service/eks v1.77.0 h1:Z5mTpmbJKU7jEM7xoXI5tO4Nm0JUZSgVSFkpYuu6Ic0= +github.com/aws/aws-sdk-go-v2/service/eks v1.77.0/go.mod h1:Qg678m+87sCuJhcsZojenz8mblYG+Tq86V4m3hjVz0s= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.54.7 h1:txeoy+BxL/Xef6Cl8zAq4ZewY7c+KnQ3gPSMSTTkTt4= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.54.7/go.mod h1:tv2v97S1V5kkp/1vneSYad5Cnrbo+4vfiNNAKCWNKIk= +github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= +github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= +github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/openshift-online/ocm-common v0.0.31 h1:csxB4UQAUhwhDOVBmOzUKgtemuwV9rhCkzMoeFX8zCQ= +github.com/openshift-online/ocm-common v0.0.31/go.mod h1:VEkuZp9aqbXtetZ5ycND6QpvhykvTuBF3oPsVM1X3vI= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= +go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= +gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= +gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/component-base v0.35.1 h1:XgvpRf4srp037QWfGBLFsYMUQJkE5yMa94UsJU7pmcE= +k8s.io/component-base v0.35.1/go.mod h1:HI/6jXlwkiOL5zL9bqA3en1Ygv60F03oEpnuU1G56Bs= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0 h1:E28NopVRAtnenHsfh54VwS2uEpGAkW0bv6Y19bqAwCg= +sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0/go.mod h1:cuuFljMXGat8qW+lvSdYEWReR0DSauv19/rh+bpobl4= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/aws/vendor_imports.go b/hack/capi-vendor/aws/vendor_imports.go new file mode 100644 index 000000000000..a84170c7b91e --- /dev/null +++ b/hack/capi-vendor/aws/vendor_imports.go @@ -0,0 +1,10 @@ +//go:build tools + +package aws + +import ( + _ "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1" + _ "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" + _ "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1" + _ "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2" +) diff --git a/hack/capi-vendor/azure/go.mod b/hack/capi-vendor/azure/go.mod new file mode 100644 index 000000000000..1fc642f7e897 --- /dev/null +++ b/hack/capi-vendor/azure/go.mod @@ -0,0 +1,97 @@ +module github.com/openshift/hypershift/hack/capi-vendor/azure + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-azure v1.22.0 + +require ( + cel.dev/expr v0.25.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 // indirect + github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/evanphx/json-patch v5.9.11+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/golang-jwt/jwt/v5 v5.3.1 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/cel-go v0.26.1 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.18.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.67.5 // indirect + github.com/prometheus/procfs v0.19.2 // indirect + github.com/samber/lo v1.52.0 // indirect + github.com/spf13/cobra v1.10.2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/stoewer/go-strcase v1.3.1 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel v1.43.0 // indirect + go.opentelemetry.io/otel/trace v1.43.0 // indirect + go.uber.org/zap v1.28.0 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/crypto v0.51.0 // indirect + golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/term v0.43.0 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/time v0.15.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/component-base v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/azure/go.sum b/hack/capi-vendor/azure/go.sum new file mode 100644 index 000000000000..858fed5d222c --- /dev/null +++ b/hack/capi-vendor/azure/go.sum @@ -0,0 +1,256 @@ +cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= +cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 h1:jHb/wfvRikGdxMXYV3QG/SzUOPYN9KEUUuC0Yd0/vC0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1/go.mod h1:pzBXCYn05zvYIrwLgtK8Ap8QcjRg+0i76tMQdWN6wOk= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0/go.mod h1:LRr2FzBTQlONPPa5HREE5+RjSCTXl7BwOvYOaWTqCaI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= +github.com/Azure/azure-service-operator/v2 v2.13.0 h1:24xDkuGOjSDKKkthECRo/I76slmlt3u0buYQ4rvX3pQ= +github.com/Azure/azure-service-operator/v2 v2.13.0/go.mod h1:3xfZMZm4yjdcjr3lh1kWqP2dtvZS/nCy7wpNERYDatg= +github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 h1:RHK7bS+HQMslb1sZpAokUt+zTVmue0hKSs2C791hhzU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 h1:I+Cy77zrFmVWIHOZaxiNV4L7w9xuVux9LMqAblGzvdE= +github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23/go.mod h1:S7DsXubvw3xBC8rSI+qmzcTNw7xEND0ojHPqglh/whY= +github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= +github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= +github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= +github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc= +github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= +github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= +github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs= +github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +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.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= +go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= +go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= +golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= +gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 h1:41r6JMbpzBMen0R/4TZeeAmGXSJC7DftGINUodzTkPI= +google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:EIQZ5bFCfRQDV4MhRle7+OgjNtZ6P1PiZBgAKuxXu/Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 h1:seT2EwLWM78plQ7wcDfuWBc/4FAEAXDDiaSol4ku4qo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= +gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/component-base v0.35.1 h1:XgvpRf4srp037QWfGBLFsYMUQJkE5yMa94UsJU7pmcE= +k8s.io/component-base v0.35.1/go.mod h1:HI/6jXlwkiOL5zL9bqA3en1Ygv60F03oEpnuU1G56Bs= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-azure v1.22.0 h1:TL+QXMVCeY2zR41PSlH2jyhQivDXXPGT8wqG4LX92ss= +sigs.k8s.io/cluster-api-provider-azure v1.22.0/go.mod h1:ivn6SfniydSCKi+pzGUaNlH1rFcavqRKw0iy1g9l7Nc= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/azure/vendor_imports.go b/hack/capi-vendor/azure/vendor_imports.go new file mode 100644 index 000000000000..f4df268820f5 --- /dev/null +++ b/hack/capi-vendor/azure/vendor_imports.go @@ -0,0 +1,7 @@ +//go:build tools + +package azure + +import ( + _ "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" +) diff --git a/hack/capi-vendor/gcp/go.mod b/hack/capi-vendor/gcp/go.mod new file mode 100644 index 000000000000..300798ba20d8 --- /dev/null +++ b/hack/capi-vendor/gcp/go.mod @@ -0,0 +1,77 @@ +module github.com/openshift/hypershift/hack/capi-vendor/gcp + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-gcp v1.11.0 + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/evanphx/json-patch v5.9.11+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.18.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.67.5 // indirect + github.com/prometheus/procfs v0.19.2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.uber.org/zap v1.28.0 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/term v0.43.0 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/time v0.15.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/gcp/go.sum b/hack/capi-vendor/gcp/go.sum new file mode 100644 index 000000000000..32cd86d2cfea --- /dev/null +++ b/hack/capi-vendor/gcp/go.sum @@ -0,0 +1,189 @@ +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= +github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= +go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= +gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo= +gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-gcp v1.11.0 h1:I3sroBY64nAGCzt3aerpGMM76WU3UyjP429kEC0vJ5Y= +sigs.k8s.io/cluster-api-provider-gcp v1.11.0/go.mod h1:vUbA5VeL+YRoxzNQ/vBzRcoHcFMMkWwgcX8DdG3Xcuc= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/gcp/vendor_imports.go b/hack/capi-vendor/gcp/vendor_imports.go new file mode 100644 index 000000000000..48152597319a --- /dev/null +++ b/hack/capi-vendor/gcp/vendor_imports.go @@ -0,0 +1,7 @@ +//go:build tools + +package gcp + +import ( + _ "sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1" +) diff --git a/hack/capi-vendor/ibmcloud/go.mod b/hack/capi-vendor/ibmcloud/go.mod new file mode 100644 index 000000000000..434f3609c259 --- /dev/null +++ b/hack/capi-vendor/ibmcloud/go.mod @@ -0,0 +1,72 @@ +module github.com/openshift/hypershift/hack/capi-vendor/ibmcloud + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 + +require ( + github.com/IBM/go-sdk-core/v5 v5.21.0 // indirect + github.com/IBM/vpc-go-sdk v0.71.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.9 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/errors v0.22.1 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/strfmt v0.23.0 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.26.0 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.8 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.mongodb.org/mongo-driver v1.17.3 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/crypto v0.51.0 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/ibmcloud/go.sum b/hack/capi-vendor/ibmcloud/go.sum new file mode 100644 index 000000000000..57e46e5016a5 --- /dev/null +++ b/hack/capi-vendor/ibmcloud/go.sum @@ -0,0 +1,191 @@ +github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk= +github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw= +github.com/IBM/vpc-go-sdk v0.71.1 h1:SP5/uQs5JDb1QRvSJ1QC2BzE+BHEMq4jd2+JEcRuieE= +github.com/IBM/vpc-go-sdk v0.71.1/go.mod h1:K3vVlje72PYE3ZRt1iouE+jSIq+vCyYzT1HiFC06hUA= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= +github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU= +github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= +github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k= +github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= +github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ= +go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 h1:0+jfWLg+UmnGOdHZ9SrEpnUJgQPyyXpcjXGdkN5E5M4= +sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0/go.mod h1:OENB/2pEx2IgYAovlV7qHvOJYyBoKc94TxNqnjjyWYs= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/ibmcloud/vendor_imports.go b/hack/capi-vendor/ibmcloud/vendor_imports.go new file mode 100644 index 000000000000..b35be59f078b --- /dev/null +++ b/hack/capi-vendor/ibmcloud/vendor_imports.go @@ -0,0 +1,8 @@ +//go:build tools + +package ibmcloud + +import ( + _ "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1" + _ "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" +) diff --git a/hack/capi-vendor/kubevirt/go.mod b/hack/capi-vendor/kubevirt/go.mod new file mode 100644 index 000000000000..eedcbaa32deb --- /dev/null +++ b/hack/capi-vendor/kubevirt/go.mod @@ -0,0 +1,58 @@ +module github.com/openshift/hypershift/hack/capi-vendor/kubevirt + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1 + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + kubevirt.io/api v1.8.2 // indirect + kubevirt.io/containerized-data-importer-api v1.65.0 // indirect + kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/kubevirt/go.sum b/hack/capi-vendor/kubevirt/go.sum new file mode 100644 index 000000000000..09c269fc6b55 --- /dev/null +++ b/hack/capi-vendor/kubevirt/go.sum @@ -0,0 +1,397 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 h1:cHyxR+Y8rAMT6m1jQCaYGRwikqahI0OjjUDhFNf3ySQ= +github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +kubevirt.io/api v1.8.2 h1:h8AACJlity2n8gRE6e9PgikLAwzmNz6gzVjT1kbsDZY= +kubevirt.io/api v1.8.2/go.mod h1:EUaPeD1GQK4IIEp8TVtk5dsFlYQGzFfcWi4CV4rs0rY= +kubevirt.io/containerized-data-importer-api v1.65.0 h1:eU7fX+htMQwMUQbhmoI99MqrpZGcyKQ6pX8t2xhCdkU= +kubevirt.io/containerized-data-importer-api v1.65.0/go.mod h1:VWE7E1H+RsmCKBULIfvpCz2oThQ4f7JvoED2XpXaGfQ= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 h1:fZYvD3/Vnitfkx6IJxjLAk8ugnZQ7CXVYcRfkSKmuZY= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1 h1:6He4EkFNVsEpYsObVRh1agt1/CxhqdqsOvEvyjRWWzk= +sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1/go.mod h1:so1WRGRRsxT4lqS0htpUqXrXLy0guBklh9UPVxoilLY= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/kubevirt/vendor_imports.go b/hack/capi-vendor/kubevirt/vendor_imports.go new file mode 100644 index 000000000000..f509396a0067 --- /dev/null +++ b/hack/capi-vendor/kubevirt/vendor_imports.go @@ -0,0 +1,7 @@ +//go:build tools + +package kubevirt + +import ( + _ "sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1" +) diff --git a/hack/capi-vendor/openstack/go.mod b/hack/capi-vendor/openstack/go.mod new file mode 100644 index 000000000000..a41be2c3bd99 --- /dev/null +++ b/hack/capi-vendor/openstack/go.mod @@ -0,0 +1,55 @@ +module github.com/openshift/hypershift/hack/capi-vendor/openstack + +go 1.25.7 + +require sigs.k8s.io/cluster-api-provider-openstack v0.13.3 + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/gophercloud/gophercloud/v2 v2.10.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/apimachinery v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/cluster-api v1.11.7 // indirect + sigs.k8s.io/controller-runtime v0.22.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/hack/capi-vendor/openstack/go.sum b/hack/capi-vendor/openstack/go.sum new file mode 100644 index 000000000000..ea5d21933500 --- /dev/null +++ b/hack/capi-vendor/openstack/go.sum @@ -0,0 +1,141 @@ +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= +github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= +github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= +github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= +github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/gophercloud/gophercloud/v2 v2.10.0 h1:NRadC0aHNvy4iMoFXj5AFiPmut/Sj3hAPAo9B59VMGc= +github.com/gophercloud/gophercloud/v2 v2.10.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= +k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= +k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= +k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= +k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= +k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/client-go v0.35.1 h1:+eSfZHwuo/I19PaSxqumjqZ9l5XiTEKbIaJ+j1wLcLM= +k8s.io/client-go v0.35.1/go.mod h1:1p1KxDt3a0ruRfc/pG4qT/3oHmUj1AhSHEcxNSGg+OA= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ= +k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/cluster-api v1.11.7 h1:RPEpDy6iBn13lLEj9bmq845ib47/joSBkM0Rqlhd1GI= +sigs.k8s.io/cluster-api v1.11.7/go.mod h1:LfMVDJoVNoHj/FJuwAlNYiN1QNYqojGAJ0czqRi31yI= +sigs.k8s.io/cluster-api-provider-openstack v0.13.3 h1:qBPgWG1E3wiiK8+VR5a3jnKGTyDPo6ZbXruTLOXw/3w= +sigs.k8s.io/cluster-api-provider-openstack v0.13.3/go.mod h1:McuqrgmgsbK4yaC1HKqJ7dxKnOERmXQedUUL15sqelQ= +sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A= +sigs.k8s.io/controller-runtime v0.22.4/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/capi-vendor/openstack/vendor_imports.go b/hack/capi-vendor/openstack/vendor_imports.go new file mode 100644 index 000000000000..e9d447a3053c --- /dev/null +++ b/hack/capi-vendor/openstack/vendor_imports.go @@ -0,0 +1,8 @@ +//go:build tools + +package openstack + +import ( + _ "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1" + _ "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" +) diff --git a/hack/copy-capi-types/main.go b/hack/copy-capi-types/main.go new file mode 100644 index 000000000000..2d954c300b25 --- /dev/null +++ b/hack/copy-capi-types/main.go @@ -0,0 +1,746 @@ +// copy-capi-types copies Go API types from vendored CAPI provider packages +// into a local package, stripping external dependencies that aren't needed. +// +// It uses Go's AST parser to precisely identify and remove: +// - Functions/methods that reference banned imports +// - Var/const/type declarations that reference banned imports +// - Import declarations that become unused after stripping +// - Files that consist entirely of banned content +// +// Dependencies considered safe (kept as-is): +// - k8s.io/apimachinery/... +// - k8s.io/api/... +// - k8s.io/utils/... +// - sigs.k8s.io/controller-runtime/pkg/scheme +// - sigs.k8s.io/cluster-api/api/... +// - sigs.k8s.io/cluster-api/errors +// - Standard library +// +// Everything else is banned and any declaration referencing a banned import +// is stripped from the output. +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" + "log" + "os" + "path/filepath" + "strings" +) + +var allowedImportPrefixes = []string{ + "k8s.io/apimachinery/", + "k8s.io/api/", + "k8s.io/utils/", + "sigs.k8s.io/controller-runtime/pkg/scheme", + "sigs.k8s.io/cluster-api/api/", + "sigs.k8s.io/cluster-api/errors", +} + +var skipFiles = map[string]string{ + "zz_generated.defaults.go": "generated defaults reference functions from stripped files", + "zz_generated.conversion.go": "generated conversions reference stripped files", +} + +var skipSuffixes = map[string]string{ + "_webhook.go": "webhook infrastructure not used by HyperShift", +} + +type stringSlice []string + +func (s *stringSlice) String() string { return strings.Join(*s, ",") } +func (s *stringSlice) Set(v string) error { + *s = append(*s, v) + return nil +} + +func main() { + src := flag.String("src", "", "source directory (vendored API package)") + dst := flag.String("dst", "", "destination directory for copied types") + var extraAllowed stringSlice + flag.Var(&extraAllowed, "allow", "additional allowed import prefix (can be repeated)") + var rewriteRules stringSlice + flag.Var(&rewriteRules, "rewrite", "rewrite import prefix old=new (can be repeated)") + flag.Parse() + + for _, prefix := range extraAllowed { + allowedImportPrefixes = append(allowedImportPrefixes, prefix) + } + + rewrites := parseRewriteRules(rewriteRules) + + if *src == "" || *dst == "" { + log.Fatal("--src and --dst are required") + } + + if err := os.MkdirAll(*dst, 0755); err != nil { + log.Fatalf("failed to create destination: %v", err) + } + + files, err := filepath.Glob(filepath.Join(*src, "*.go")) + if err != nil { + log.Fatalf("failed to glob: %v", err) + } + + // Pass 1: process each file individually (within-file cascading) + type fileResult struct { + base string + result *result + } + var results []fileResult + allStrippedSymbols := make(map[string]bool) + + for _, srcFile := range files { + base := filepath.Base(srcFile) + + if reason, ok := skipFiles[base]; ok { + results = append(results, fileResult{base, &result{action: actionSkip, reason: reason}}) + continue + } + + skipBySuffix := false + for suffix, reason := range skipSuffixes { + if strings.HasSuffix(base, suffix) { + results = append(results, fileResult{base, &result{action: actionSkip, reason: reason}}) + skipBySuffix = true + break + } + } + if skipBySuffix { + continue + } + + r, stripped, err := processFile(srcFile) + if err != nil { + log.Fatalf("error processing %s: %v", base, err) + } + results = append(results, fileResult{base, r}) + for sym := range stripped { + allStrippedSymbols[sym] = true + } + } + + // Pass 2: cross-file cascading — re-process files that may call + // symbols stripped from other files + if len(allStrippedSymbols) > 0 { + for i := range results { + r := results[i] + if r.result.action == actionSkip { + continue + } + // Re-parse the content (original or already-stripped) and check + // for calls to cross-file stripped symbols + content := r.result.content + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, r.base, content, parser.ParseComments) + if err != nil { + continue + } + + var crossFileRemove []*ast.FuncDecl + var crossNames []string + for _, decl := range file.Decls { + fn, ok := decl.(*ast.FuncDecl) + if !ok { + continue + } + if callsAny(fn, allStrippedSymbols) { + crossFileRemove = append(crossFileRemove, fn) + if fn.Recv != nil { + crossNames = append(crossNames, fmt.Sprintf("%s.%s", receiverType(fn), fn.Name.Name)) + } else { + crossNames = append(crossNames, fn.Name.Name) + } + } + } + if len(crossFileRemove) == 0 { + continue + } + + // Do another round of cascading within this file + funcRemoveSet := make(map[*ast.FuncDecl]bool) + for _, fn := range crossFileRemove { + funcRemoveSet[fn] = true + } + for { + localStripped := make(map[string]bool) + for fn := range funcRemoveSet { + localStripped[fn.Name.Name] = true + } + changed := false + for _, decl := range file.Decls { + fn, ok := decl.(*ast.FuncDecl) + if !ok || funcRemoveSet[fn] { + continue + } + if callsAny(fn, localStripped) { + funcRemoveSet[fn] = true + changed = true + if fn.Recv != nil { + crossNames = append(crossNames, fmt.Sprintf("%s.%s", receiverType(fn), fn.Name.Name)) + } else { + crossNames = append(crossNames, fn.Name.Name) + } + } + } + if !changed { + break + } + } + + // Check if everything will be removed + remaining := 0 + for _, decl := range file.Decls { + switch d := decl.(type) { + case *ast.FuncDecl: + if !funcRemoveSet[d] { + remaining++ + } + case *ast.GenDecl: + if d.Tok != token.IMPORT { + remaining++ + } + } + } + + if remaining == 0 { + results[i].result = &result{action: actionSkip, reason: "all remaining decls call stripped symbols"} + continue + } + + stripped := stripDecls(fset, file, crossFileRemove, nil, nil) + existingReason := r.result.reason + if existingReason != "" { + existingReason += ", " + } + results[i].result = &result{ + action: actionStrip, + content: stripped, + reason: existingReason + strings.Join(crossNames, ", "), + } + } + } + + // Apply import path rewrites + if len(rewrites) > 0 { + for i := range results { + r := results[i] + if r.result.action == actionSkip { + continue + } + results[i].result.content = applyRewriteRules(r.result.content, rewrites) + } + } + + // Write output + var stats struct { + copied, stripped, skipped int + } + + for _, r := range results { + switch r.result.action { + case actionSkip: + fmt.Printf("SKIP %s (%s)\n", r.base, r.result.reason) + stats.skipped++ + case actionCopy: + if err := os.WriteFile(filepath.Join(*dst, r.base), r.result.content, 0644); err != nil { + log.Fatalf("failed to write %s: %v", r.base, err) + } + fmt.Printf("COPY %s\n", r.base) + stats.copied++ + case actionStrip: + if err := os.WriteFile(filepath.Join(*dst, r.base), r.result.content, 0644); err != nil { + log.Fatalf("failed to write %s: %v", r.base, err) + } + fmt.Printf("STRIP %s (removed: %s)\n", r.base, r.result.reason) + stats.stripped++ + } + } + + fmt.Printf("\nDone: %d copied, %d stripped, %d skipped\n", stats.copied, stats.stripped, stats.skipped) +} + +type action int + +const ( + actionCopy action = iota + actionStrip + actionSkip +) + +type result struct { + action action + content []byte + reason string +} + +func processFile(path string) (*result, map[string]bool, error) { + src, err := os.ReadFile(path) + if err != nil { + return nil, nil, err + } + + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, path, src, parser.ParseComments) + if err != nil { + return nil, nil, fmt.Errorf("parse error: %w", err) + } + + bannedImports := findBannedImports(file) + if len(bannedImports) == 0 { + return &result{action: actionCopy, content: src}, nil, nil + } + + bannedAliases := make(map[string]bool) + for _, imp := range bannedImports { + alias := importAlias(imp) + bannedAliases[alias] = true + } + + funcRemoveSet := make(map[*ast.FuncDecl]bool) + genRemoveSet := make(map[*ast.GenDecl]bool) + + // Pass 1: mark declarations that directly reference banned packages + for _, decl := range file.Decls { + switch d := decl.(type) { + case *ast.FuncDecl: + if nodeUsesBannedPackage(d, bannedAliases) { + funcRemoveSet[d] = true + } + case *ast.GenDecl: + if d.Tok == token.IMPORT { + continue + } + if nodeUsesBannedPackage(d, bannedAliases) { + genRemoveSet[d] = true + } + } + } + + // Pass 2: cascade — mark declarations that reference stripped symbols. + // Handles both FuncDecl and GenDecl (type/var/const). Repeat until stable. + for { + strippedSymbols := collectStrippedSymbols(file, funcRemoveSet, genRemoveSet) + if len(strippedSymbols) == 0 { + break + } + + changed := false + for _, decl := range file.Decls { + switch d := decl.(type) { + case *ast.FuncDecl: + if funcRemoveSet[d] { + continue + } + if callsAny(d, strippedSymbols) { + funcRemoveSet[d] = true + changed = true + } + case *ast.GenDecl: + if d.Tok == token.IMPORT || genRemoveSet[d] { + continue + } + if genDeclReferencesAny(d, strippedSymbols) { + genRemoveSet[d] = true + changed = true + } + } + } + if !changed { + break + } + } + + if len(funcRemoveSet) == 0 && len(genRemoveSet) == 0 { + return &result{action: actionCopy, content: src}, nil, nil + } + + // Collect removed names for logging + var removedNames []string + for fn := range funcRemoveSet { + if fn.Recv != nil { + removedNames = append(removedNames, fmt.Sprintf("%s.%s", receiverType(fn), fn.Name.Name)) + } else { + removedNames = append(removedNames, fn.Name.Name) + } + } + for gd := range genRemoveSet { + for _, spec := range gd.Specs { + switch s := spec.(type) { + case *ast.ValueSpec: + for _, name := range s.Names { + removedNames = append(removedNames, name.Name) + } + case *ast.TypeSpec: + removedNames = append(removedNames, s.Name.Name) + } + } + } + + // Check if everything non-import will be removed + remainingDecls := 0 + for _, decl := range file.Decls { + switch d := decl.(type) { + case *ast.FuncDecl: + if !funcRemoveSet[d] { + remainingDecls++ + } + case *ast.GenDecl: + if d.Tok == token.IMPORT { + continue + } + if !genRemoveSet[d] { + remainingDecls++ + } + } + } + + if remainingDecls == 0 { + importPaths := make([]string, len(bannedImports)) + for i, imp := range bannedImports { + importPaths[i] = strings.Trim(imp.Path.Value, `"`) + } + allSymbols := collectStrippedSymbols(file, funcRemoveSet, genRemoveSet) + return &result{ + action: actionSkip, + reason: fmt.Sprintf("all decls use banned imports: %s", strings.Join(importPaths, ", ")), + }, allSymbols, nil + } + + funcsToRemove := make([]*ast.FuncDecl, 0, len(funcRemoveSet)) + for fn := range funcRemoveSet { + funcsToRemove = append(funcsToRemove, fn) + } + genDeclsToRemove := make([]*ast.GenDecl, 0, len(genRemoveSet)) + for gd := range genRemoveSet { + genDeclsToRemove = append(genDeclsToRemove, gd) + } + + allSymbols := collectStrippedSymbols(file, funcRemoveSet, genRemoveSet) + content := stripDecls(fset, file, funcsToRemove, genDeclsToRemove, bannedAliases) + + return &result{ + action: actionStrip, + content: content, + reason: strings.Join(removedNames, ", "), + }, allSymbols, nil +} + +// collectStrippedSymbols builds a set of function/method names that have been +// marked for removal. For methods, both "Type.Method" and bare "Method" forms +// are included to catch method calls via variable receivers. +func collectStrippedSymbols(_ *ast.File, funcSet map[*ast.FuncDecl]bool, genSet map[*ast.GenDecl]bool) map[string]bool { + symbols := make(map[string]bool) + for fn := range funcSet { + symbols[fn.Name.Name] = true + if fn.Recv != nil { + symbols[fmt.Sprintf("%s.%s", receiverType(fn), fn.Name.Name)] = true + } + } + for gd := range genSet { + for _, spec := range gd.Specs { + switch s := spec.(type) { + case *ast.ValueSpec: + for _, name := range s.Names { + symbols[name.Name] = true + } + case *ast.TypeSpec: + symbols[s.Name.Name] = true + } + } + } + return symbols +} + +// callsAny checks if a function body calls any of the named symbols. +func callsAny(fn *ast.FuncDecl, symbols map[string]bool) bool { + if fn.Body == nil { + return false + } + found := false + ast.Inspect(fn.Body, func(n ast.Node) bool { + if found { + return false + } + switch expr := n.(type) { + case *ast.CallExpr: + switch callee := expr.Fun.(type) { + case *ast.Ident: + if symbols[callee.Name] { + found = true + } + case *ast.SelectorExpr: + if symbols[callee.Sel.Name] { + found = true + } + } + } + return true + }) + return found +} + +// genDeclReferencesAny checks if a GenDecl (type/var/const) references any of +// the named symbols in its initializer expressions or type definitions. +func genDeclReferencesAny(gd *ast.GenDecl, symbols map[string]bool) bool { + found := false + ast.Inspect(gd, func(n ast.Node) bool { + if found { + return false + } + ident, ok := n.(*ast.Ident) + if ok && symbols[ident.Name] { + found = true + } + return true + }) + return found +} + +func findBannedImports(file *ast.File) []*ast.ImportSpec { + var banned []*ast.ImportSpec + for _, imp := range file.Imports { + path := strings.Trim(imp.Path.Value, `"`) + if !isAllowedImport(path) { + banned = append(banned, imp) + } + } + return banned +} + +func isAllowedImport(path string) bool { + if !strings.Contains(path, ".") { + return true + } + for _, prefix := range allowedImportPrefixes { + if strings.HasPrefix(path, prefix) { + return true + } + } + return false +} + +func importAlias(imp *ast.ImportSpec) string { + if imp.Name != nil { + return imp.Name.Name + } + path := strings.Trim(imp.Path.Value, `"`) + parts := strings.Split(path, "/") + last := parts[len(parts)-1] + // For versioned modules (e.g., "foo/v5"), use the second-to-last component + if len(parts) > 1 && len(last) > 1 && last[0] == 'v' && last[1] >= '0' && last[1] <= '9' { + return parts[len(parts)-2] + } + return last +} + +func nodeUsesBannedPackage(node ast.Node, banned map[string]bool) bool { + found := false + ast.Inspect(node, func(n ast.Node) bool { + if found { + return false + } + sel, ok := n.(*ast.SelectorExpr) + if !ok { + return true + } + ident, ok := sel.X.(*ast.Ident) + if !ok { + return true + } + if banned[ident.Name] { + found = true + } + return true + }) + return found +} + +func receiverType(fn *ast.FuncDecl) string { + if fn.Recv == nil || len(fn.Recv.List) == 0 { + return "" + } + t := fn.Recv.List[0].Type + if star, ok := t.(*ast.StarExpr); ok { + t = star.X + } + if ident, ok := t.(*ast.Ident); ok { + return ident.Name + } + return "?" +} + +// stripDecls removes specified declarations and cleans up unused imports. +func stripDecls(fset *token.FileSet, file *ast.File, funcsToRemove []*ast.FuncDecl, genDeclsToRemove []*ast.GenDecl, _ map[string]bool) []byte { + funcRemoveSet := make(map[*ast.FuncDecl]bool) + for _, fn := range funcsToRemove { + funcRemoveSet[fn] = true + } + genRemoveSet := make(map[*ast.GenDecl]bool) + for _, gd := range genDeclsToRemove { + genRemoveSet[gd] = true + } + + var filtered []ast.Decl + for _, decl := range file.Decls { + switch d := decl.(type) { + case *ast.FuncDecl: + if funcRemoveSet[d] { + continue + } + case *ast.GenDecl: + if genRemoveSet[d] { + continue + } + } + filtered = append(filtered, decl) + } + file.Decls = filtered + + // Collect all package identifiers still used in remaining declarations + usedPkgs := collectUsedPackages(file) + + // Remove imports that are no longer used + for _, decl := range file.Decls { + gd, ok := decl.(*ast.GenDecl) + if !ok || gd.Tok != token.IMPORT { + continue + } + var kept []ast.Spec + for _, spec := range gd.Specs { + imp, ok := spec.(*ast.ImportSpec) + if !ok { + kept = append(kept, spec) + continue + } + alias := importAlias(imp) + path := strings.Trim(imp.Path.Value, `"`) + // Keep if: it's a blank import, a dot import, or actively used + if (imp.Name != nil && imp.Name.Name == "_") || + (imp.Name != nil && imp.Name.Name == ".") || + usedPkgs[alias] { + kept = append(kept, spec) + continue + } + // Also keep standard library imports that are used + if !strings.Contains(path, ".") && usedPkgs[alias] { + kept = append(kept, spec) + continue + } + // Drop unused imports + if !usedPkgs[alias] { + continue + } + kept = append(kept, spec) + } + gd.Specs = kept + } + + // Drop empty import declarations left after pruning. + var cleanedDecls []ast.Decl + for _, decl := range file.Decls { + gd, ok := decl.(*ast.GenDecl) + if ok && gd.Tok == token.IMPORT && len(gd.Specs) == 0 { + continue + } + cleanedDecls = append(cleanedDecls, decl) + } + file.Decls = cleanedDecls + + var buf bytes.Buffer + cfg := printer.Config{Mode: printer.UseSpaces | printer.TabIndent, Tabwidth: 8} + if err := cfg.Fprint(&buf, fset, file); err != nil { + log.Fatalf("failed to print AST: %v", err) + } + + formatted, err := format.Source(buf.Bytes()) + if err != nil { + return buf.Bytes() + } + return formatted +} + +// collectUsedPackages walks the AST (excluding import blocks) and returns +// all identifier names used as the X in selector expressions (pkg.Symbol). +func collectUsedPackages(file *ast.File) map[string]bool { + used := make(map[string]bool) + for _, decl := range file.Decls { + gd, ok := decl.(*ast.GenDecl) + if ok && gd.Tok == token.IMPORT { + continue + } + ast.Inspect(decl, func(n ast.Node) bool { + sel, ok := n.(*ast.SelectorExpr) + if !ok { + return true + } + ident, ok := sel.X.(*ast.Ident) + if !ok { + return true + } + used[ident.Name] = true + return true + }) + } + return used +} + +type rewriteRule struct { + oldPrefix string + newPrefix string +} + +func parseRewriteRules(rules []string) []rewriteRule { + var result []rewriteRule + for _, r := range rules { + parts := strings.SplitN(r, "=", 2) + if len(parts) != 2 { + log.Fatalf("invalid --rewrite value %q: expected old=new", r) + } + result = append(result, rewriteRule{oldPrefix: parts[0], newPrefix: parts[1]}) + } + return result +} + +func applyRewriteRules(content []byte, rules []rewriteRule) []byte { + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, "", content, parser.ParseComments) + if err != nil { + return content + } + + changed := false + for _, imp := range file.Imports { + path := strings.Trim(imp.Path.Value, `"`) + for _, rule := range rules { + if strings.HasPrefix(path, rule.oldPrefix) { + newPath := rule.newPrefix + path[len(rule.oldPrefix):] + imp.Path.Value = `"` + newPath + `"` + changed = true + break + } + } + } + + if !changed { + return content + } + + var buf bytes.Buffer + cfg := printer.Config{Mode: printer.UseSpaces | printer.TabIndent, Tabwidth: 8} + if err := cfg.Fprint(&buf, fset, file); err != nil { + return content + } + formatted, err := format.Source(buf.Bytes()) + if err != nil { + return buf.Bytes() + } + return formatted +} diff --git a/hack/workspace/go.work b/hack/workspace/go.work index 425d9b09a65f..173ae0d2f4b8 100644 --- a/hack/workspace/go.work +++ b/hack/workspace/go.work @@ -3,4 +3,11 @@ go 1.25.7 use ( ./hypershift ./hypershift/api + ./hypershift/pkg/capi/agent + ./hypershift/pkg/capi/aws + ./hypershift/pkg/capi/azure + ./hypershift/pkg/capi/gcp + ./hypershift/pkg/capi/ibmcloud + ./hypershift/pkg/capi/kubevirt + ./hypershift/pkg/capi/openstack ) diff --git a/pkg/capi/agent/go.mod b/pkg/capi/agent/go.mod new file mode 100644 index 000000000000..388dce88f3a0 --- /dev/null +++ b/pkg/capi/agent/go.mod @@ -0,0 +1,56 @@ +module github.com/openshift/cluster-api-provider-agent/api + +go 1.25.7 + +require ( + k8s.io/apimachinery v0.35.1 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/api v0.35.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentcluster_types.go b/pkg/capi/agent/v1alpha1/agentcluster_types.go similarity index 100% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentcluster_types.go rename to pkg/capi/agent/v1alpha1/agentcluster_types.go diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentmachine_types.go b/pkg/capi/agent/v1alpha1/agentmachine_types.go similarity index 100% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentmachine_types.go rename to pkg/capi/agent/v1alpha1/agentmachine_types.go diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentmachinetemplate_types.go b/pkg/capi/agent/v1alpha1/agentmachinetemplate_types.go similarity index 100% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/agentmachinetemplate_types.go rename to pkg/capi/agent/v1alpha1/agentmachinetemplate_types.go diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/groupversion_info.go b/pkg/capi/agent/v1alpha1/groupversion_info.go similarity index 100% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/groupversion_info.go rename to pkg/capi/agent/v1alpha1/groupversion_info.go diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/types.go b/pkg/capi/agent/v1alpha1/types.go similarity index 100% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/types.go rename to pkg/capi/agent/v1alpha1/types.go diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/zz_generated.deepcopy.go b/pkg/capi/agent/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/zz_generated.deepcopy.go rename to pkg/capi/agent/v1alpha1/zz_generated.deepcopy.go index b521e0045d4d..ccf8b70bdf34 100644 --- a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/capi/agent/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright 2021. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/capi/agent/v1beta1/agentcluster_types.go b/pkg/capi/agent/v1beta1/agentcluster_types.go new file mode 100644 index 000000000000..5a0fcc8a84b8 --- /dev/null +++ b/pkg/capi/agent/v1beta1/agentcluster_types.go @@ -0,0 +1,103 @@ +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +type ClusterDeploymentReference struct { + // Name is unique within a namespace to reference a clusterDeployment resource. + // +optional + Name string `json:"name,omitempty"` + // Namespace defines the space within which the clusterDeployment name must be unique. + // +optional + Namespace string `json:"namespace,omitempty"` +} + +// AgentClusterSpec defines the desired state of AgentCluster +type AgentClusterSpec struct { + // IgnitionEndpoint store the data to of the custom ignition endpoint. + // +optional + IgnitionEndpoint *IgnitionEndpoint `json:"ignitionEndpoint,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` +} + +// IgnitionEndpoint store the data to of the custom ignition endpoint. +type IgnitionEndpoint struct { + // Url store the URL of the custom ignition endpoint. + // +optional + Url string `json:"url,omitempty"` + + // CaCertificateReference is a reference to the secret containing CA certificate to be used + // when contacting the URL via HTTPS. + // +optional + CaCertificateReference *CaCertificateReference `json:"caCertificateReference,omitempty"` +} + +type CaCertificateReference struct { + // Namespace is the namespace of the secret containing the CA certificate. + Namespace string `json:"namespace"` + // Name is the name of the secret containing the CA certificate. + Name string `json:"name"` +} + +// AgentClusterStatus defines the observed state of AgentCluster +type AgentClusterStatus struct { + // +optional + Ready bool `json:"ready"` + + // ClusterDeploymentRef is a reference to the associated Hive ClusterDeployment. + ClusterDeploymentRef ClusterDeploymentReference `json:"clusterDeploymentReference"` + + // Conditions defines current service state of the ClusterDeployment. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` + + // FailureDomains is a list of failure domain objects synced from the infrastructure provider. + FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:storageversion + +// AgentCluster is the Schema for the agentclusters API +type AgentCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AgentClusterSpec `json:"spec,omitempty"` + Status AgentClusterStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// AgentClusterList contains a list of AgentCluster +type AgentClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AgentCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AgentCluster{}, &AgentClusterList{}) +} diff --git a/pkg/capi/agent/v1beta1/agentmachine_types.go b/pkg/capi/agent/v1beta1/agentmachine_types.go new file mode 100644 index 000000000000..8169eb7aeed9 --- /dev/null +++ b/pkg/capi/agent/v1beta1/agentmachine_types.go @@ -0,0 +1,136 @@ +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +const ( + AgentReservedCondition clusterv1.ConditionType = "AgentReserved" + AgentSpecSyncedCondition clusterv1.ConditionType = "AgentSpecSynced" + AgentValidatedCondition clusterv1.ConditionType = "AgentValidated" + AgentRequirementsMetCondition clusterv1.ConditionType = "AgentRequirementsMet" + InstalledCondition clusterv1.ConditionType = "Installed" + + AgentNotYetFoundReason = "AgentNotYetFound" + NoSuitableAgentsReason = "NoSuitableAgents" +) + +// AgentMachineSpec defines the desired state of AgentMachine +type AgentMachineSpec struct { + // AgentLabelSelector contains the labels that must be set on an Agent in order to be selected for this Machine. + // +optional + AgentLabelSelector *metav1.LabelSelector `json:"agentLabelSelector,omitempty"` + + // ProviderID is the host's motherboard serial formatted as + // agent://12345678-1234-1234-1234-123456789abc + ProviderID *string `json:"providerID,omitempty"` +} + +// AgentMachineStatus defines the observed state of AgentMachine +type AgentMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // AgentRef is a reference to the Agent matched to the Machine. + AgentRef *AgentReference `json:"agentRef,omitempty"` + + // Addresses contains the Agent's associated addresses. + Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the AgentMachine. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:storageversion + +// AgentMachine is the Schema for the agentmachines API +type AgentMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AgentMachineSpec `json:"spec,omitempty"` + Status AgentMachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the AWSMachine resource. +func (r *AgentMachine) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions. +func (r *AgentMachine) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +//+kubebuilder:object:root=true + +// AgentMachineList contains a list of AgentMachine +type AgentMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AgentMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AgentMachine{}, &AgentMachineList{}) +} diff --git a/pkg/capi/agent/v1beta1/agentmachinetemplate_types.go b/pkg/capi/agent/v1beta1/agentmachinetemplate_types.go new file mode 100644 index 000000000000..ce88b6f2f109 --- /dev/null +++ b/pkg/capi/agent/v1beta1/agentmachinetemplate_types.go @@ -0,0 +1,51 @@ +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AgentMachineTemplateSpec defines the desired state of AgentMachineTemplate +type AgentMachineTemplateSpec struct { + Template AgentMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=agentmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=agentmt +//+kubebuilder:storageversion + +// AgentMachineTemplate is the Schema for the agentmachinetemplates API +type AgentMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AgentMachineTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AgentMachineTemplateList contains a list of AgentMachineTemplate. +type AgentMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AgentMachineTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AgentMachineTemplate{}, &AgentMachineTemplateList{}) +} diff --git a/pkg/capi/agent/v1beta1/groupversion_info.go b/pkg/capi/agent/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..fa92f11dfe13 --- /dev/null +++ b/pkg/capi/agent/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the capi-provider v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=capi-provider.agent-install.openshift.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "capi-provider.agent-install.openshift.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/capi/agent/v1beta1/types.go b/pkg/capi/agent/v1beta1/types.go new file mode 100644 index 000000000000..8c0fea71275e --- /dev/null +++ b/pkg/capi/agent/v1beta1/types.go @@ -0,0 +1,32 @@ +/* +Copyright 2021. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +type AgentReference struct { + // Name is unique within a namespace to reference an agent resource. + // +optional + Name string `json:"name,omitempty"` + // Namespace defines the space within which the agent name must be unique. + // +optional + Namespace string `json:"namespace,omitempty"` +} + +// AgentMachineTemplateResource describes the data needed to create an AgentMachine from a template +type AgentMachineTemplateResource struct { + // Spec is the specification of the desired behavior of the machine. + Spec AgentMachineSpec `json:"spec"` +} diff --git a/pkg/capi/agent/v1beta1/zz_generated.deepcopy.go b/pkg/capi/agent/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..c1f7b6b55d4f --- /dev/null +++ b/pkg/capi/agent/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,419 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentCluster) DeepCopyInto(out *AgentCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentCluster. +func (in *AgentCluster) DeepCopy() *AgentCluster { + if in == nil { + return nil + } + out := new(AgentCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentClusterList) DeepCopyInto(out *AgentClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AgentCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentClusterList. +func (in *AgentClusterList) DeepCopy() *AgentClusterList { + if in == nil { + return nil + } + out := new(AgentClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentClusterSpec) DeepCopyInto(out *AgentClusterSpec) { + *out = *in + if in.IgnitionEndpoint != nil { + in, out := &in.IgnitionEndpoint, &out.IgnitionEndpoint + *out = new(IgnitionEndpoint) + (*in).DeepCopyInto(*out) + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentClusterSpec. +func (in *AgentClusterSpec) DeepCopy() *AgentClusterSpec { + if in == nil { + return nil + } + out := new(AgentClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentClusterStatus) DeepCopyInto(out *AgentClusterStatus) { + *out = *in + out.ClusterDeploymentRef = in.ClusterDeploymentRef + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(corev1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentClusterStatus. +func (in *AgentClusterStatus) DeepCopy() *AgentClusterStatus { + if in == nil { + return nil + } + out := new(AgentClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachine) DeepCopyInto(out *AgentMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachine. +func (in *AgentMachine) DeepCopy() *AgentMachine { + if in == nil { + return nil + } + out := new(AgentMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineList) DeepCopyInto(out *AgentMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AgentMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineList. +func (in *AgentMachineList) DeepCopy() *AgentMachineList { + if in == nil { + return nil + } + out := new(AgentMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineSpec) DeepCopyInto(out *AgentMachineSpec) { + *out = *in + if in.AgentLabelSelector != nil { + in, out := &in.AgentLabelSelector, &out.AgentLabelSelector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineSpec. +func (in *AgentMachineSpec) DeepCopy() *AgentMachineSpec { + if in == nil { + return nil + } + out := new(AgentMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineStatus) DeepCopyInto(out *AgentMachineStatus) { + *out = *in + if in.AgentRef != nil { + in, out := &in.AgentRef, &out.AgentRef + *out = new(AgentReference) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]corev1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineStatus. +func (in *AgentMachineStatus) DeepCopy() *AgentMachineStatus { + if in == nil { + return nil + } + out := new(AgentMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineTemplate) DeepCopyInto(out *AgentMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineTemplate. +func (in *AgentMachineTemplate) DeepCopy() *AgentMachineTemplate { + if in == nil { + return nil + } + out := new(AgentMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineTemplateList) DeepCopyInto(out *AgentMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AgentMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineTemplateList. +func (in *AgentMachineTemplateList) DeepCopy() *AgentMachineTemplateList { + if in == nil { + return nil + } + out := new(AgentMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AgentMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineTemplateResource) DeepCopyInto(out *AgentMachineTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineTemplateResource. +func (in *AgentMachineTemplateResource) DeepCopy() *AgentMachineTemplateResource { + if in == nil { + return nil + } + out := new(AgentMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentMachineTemplateSpec) DeepCopyInto(out *AgentMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentMachineTemplateSpec. +func (in *AgentMachineTemplateSpec) DeepCopy() *AgentMachineTemplateSpec { + if in == nil { + return nil + } + out := new(AgentMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentReference) DeepCopyInto(out *AgentReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentReference. +func (in *AgentReference) DeepCopy() *AgentReference { + if in == nil { + return nil + } + out := new(AgentReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CaCertificateReference) DeepCopyInto(out *CaCertificateReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaCertificateReference. +func (in *CaCertificateReference) DeepCopy() *CaCertificateReference { + if in == nil { + return nil + } + out := new(CaCertificateReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterDeploymentReference) DeepCopyInto(out *ClusterDeploymentReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDeploymentReference. +func (in *ClusterDeploymentReference) DeepCopy() *ClusterDeploymentReference { + if in == nil { + return nil + } + out := new(ClusterDeploymentReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IgnitionEndpoint) DeepCopyInto(out *IgnitionEndpoint) { + *out = *in + if in.CaCertificateReference != nil { + in, out := &in.CaCertificateReference, &out.CaCertificateReference + *out = new(CaCertificateReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionEndpoint. +func (in *IgnitionEndpoint) DeepCopy() *IgnitionEndpoint { + if in == nil { + return nil + } + out := new(IgnitionEndpoint) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awscluster_types.go b/pkg/capi/aws/api/v1beta1/awscluster_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awscluster_types.go rename to pkg/capi/aws/api/v1beta1/awscluster_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsclustertemplate_types.go b/pkg/capi/aws/api/v1beta1/awsclustertemplate_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsclustertemplate_types.go rename to pkg/capi/aws/api/v1beta1/awsclustertemplate_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsidentity_types.go b/pkg/capi/aws/api/v1beta1/awsidentity_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsidentity_types.go rename to pkg/capi/aws/api/v1beta1/awsidentity_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachine_types.go b/pkg/capi/aws/api/v1beta1/awsmachine_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachine_types.go rename to pkg/capi/aws/api/v1beta1/awsmachine_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachinetemplate_types.go b/pkg/capi/aws/api/v1beta1/awsmachinetemplate_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachinetemplate_types.go rename to pkg/capi/aws/api/v1beta1/awsmachinetemplate_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/bastion.go b/pkg/capi/aws/api/v1beta1/bastion.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/bastion.go rename to pkg/capi/aws/api/v1beta1/bastion.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/conditions_consts.go b/pkg/capi/aws/api/v1beta1/conditions_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/conditions_consts.go rename to pkg/capi/aws/api/v1beta1/conditions_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/doc.go b/pkg/capi/aws/api/v1beta1/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/doc.go rename to pkg/capi/aws/api/v1beta1/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/groupversion_info.go b/pkg/capi/aws/api/v1beta1/groupversion_info.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/groupversion_info.go rename to pkg/capi/aws/api/v1beta1/groupversion_info.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/network_types.go b/pkg/capi/aws/api/v1beta1/network_types.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/network_types.go rename to pkg/capi/aws/api/v1beta1/network_types.go index f72940f45b54..03056f92b28c 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/network_types.go +++ b/pkg/capi/aws/api/v1beta1/network_types.go @@ -490,25 +490,6 @@ func (i *IngressRule) String() string { type IngressRules []IngressRule // Difference returns the difference between this slice and the other slice. -func (i IngressRules) Difference(o IngressRules) (out IngressRules) { - for index := range i { - x := i[index] - found := false - for oIndex := range o { - y := o[oIndex] - if x.Equals(&y) { - found = true - break - } - } - - if !found { - out = append(out, x) - } - } - - return -} // Equals returns true if two IngressRule are equal. func (i *IngressRule) Equals(o *IngressRule) bool { diff --git a/pkg/capi/aws/api/v1beta1/s3bucket.go b/pkg/capi/aws/api/v1beta1/s3bucket.go new file mode 100644 index 000000000000..1b7d37f24675 --- /dev/null +++ b/pkg/capi/aws/api/v1beta1/s3bucket.go @@ -0,0 +1,40 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "net" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// Validate validates S3Bucket fields. + +// Feature gate is not enabled but ignition is enabled then send a forbidden error. + +// Validation rules taken from https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html. +func validateS3BucketName(name string) []*field.Error { + var errs field.ErrorList + + path := field.NewPath("spec", "s3Bucket", "name") + + if net.ParseIP(name) != nil { + errs = append(errs, field.Invalid(path, name, "must not be formatted as an IP address (for example, 192.168.5.4)")) + } + + return errs +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/tags.go b/pkg/capi/aws/api/v1beta1/tags.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/tags.go rename to pkg/capi/aws/api/v1beta1/tags.go index 1d711937a002..635b5c7d0344 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/tags.go +++ b/pkg/capi/aws/api/v1beta1/tags.go @@ -20,7 +20,6 @@ import ( "fmt" "regexp" - "github.com/google/go-cmp/cmp" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/validation/field" @@ -32,9 +31,6 @@ type Tags map[string]string // Equals returns true if the tags are equal. // This func is deprecated and should not be used. -func (t Tags) Equals(other Tags) bool { - return cmp.Equal(t, other) -} // HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling. func (t Tags) HasOwned(cluster string) bool { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/types.go b/pkg/capi/aws/api/v1beta1/types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/types.go rename to pkg/capi/aws/api/v1beta1/types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/aws/api/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.deepcopy.go rename to pkg/capi/aws/api/v1beta1/zz_generated.deepcopy.go index 28f0fe8907a7..4f14d873dc36 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.deepcopy.go +++ b/pkg/capi/aws/api/v1beta1/zz_generated.deepcopy.go @@ -1,13 +1,13 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/pkg/capi/aws/api/v1beta2/awscluster_types.go b/pkg/capi/aws/api/v1beta2/awscluster_types.go new file mode 100644 index 000000000000..184ef9de4317 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/awscluster_types.go @@ -0,0 +1,360 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // ClusterFinalizer allows ReconcileAWSCluster to clean up AWS resources associated with AWSCluster before + // removing it from the apiserver. + ClusterFinalizer = "awscluster.infrastructure.cluster.x-k8s.io" + + // AWSClusterControllerIdentityName is the name of the AWSClusterControllerIdentity singleton. + AWSClusterControllerIdentityName = "default" +) + +// AWSClusterSpec defines the desired state of an EC2-based Kubernetes cluster. +type AWSClusterSpec struct { + // NetworkSpec encapsulates all things related to AWS network. + NetworkSpec NetworkSpec `json:"network,omitempty"` + + // The AWS Region the cluster lives in. + Region string `json:"region,omitempty"` + + // Partition is the AWS security partition being used. Defaults to "aws" + // +optional + Partition string `json:"partition,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` + + // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the + // ones added by default. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. + // +optional + ControlPlaneLoadBalancer *AWSLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` + + // SecondaryControlPlaneLoadBalancer is an additional load balancer that can be used for the control plane. + // + // An example use case is to have a separate internal load balancer for internal traffic, + // and a separate external load balancer for external traffic. + // + // +optional + SecondaryControlPlaneLoadBalancer *AWSLoadBalancerSpec `json:"secondaryControlPlaneLoadBalancer,omitempty"` + + // ImageLookupFormat is the AMI naming format to look up machine images when + // a machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base + // OS and kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to look up machine images when a + // machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // +optional + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system used to look + // up machine images when a machine does not specify an AMI. When set, this + // will be used for all cluster machines unless a machine specifies a + // different ImageLookupBaseOS. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // Bastion contains options to configure the bastion host. + // +optional + Bastion Bastion `json:"bastion"` + + // +optional + + // IdentityRef is a reference to an identity to be used when reconciling the managed control plane. + // If no identity is specified, the default identity for this controller will be used. + IdentityRef *AWSIdentityReference `json:"identityRef,omitempty"` + + // S3Bucket contains options to configure a supporting S3 bucket for this + // cluster - currently used for nodes requiring Ignition + // (https://coreos.github.io/ignition/) for bootstrapping (requires + // BootstrapFormatIgnition feature flag to be enabled). + // +optional + S3Bucket *S3Bucket `json:"s3Bucket,omitempty"` +} + +// AWSIdentityKind defines allowed AWS identity types. +type AWSIdentityKind string + +var ( + // ControllerIdentityKind defines identity reference kind as AWSClusterControllerIdentity. + ControllerIdentityKind = AWSIdentityKind("AWSClusterControllerIdentity") + + // ClusterRoleIdentityKind defines identity reference kind as AWSClusterRoleIdentity. + ClusterRoleIdentityKind = AWSIdentityKind("AWSClusterRoleIdentity") + + // ClusterStaticIdentityKind defines identity reference kind as AWSClusterStaticIdentity. + ClusterStaticIdentityKind = AWSIdentityKind("AWSClusterStaticIdentity") +) + +// AWSIdentityReference specifies a identity. +type AWSIdentityReference struct { + // Name of the identity. + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + + // Kind of the identity. + // +kubebuilder:validation:Enum=AWSClusterControllerIdentity;AWSClusterRoleIdentity;AWSClusterStaticIdentity + Kind AWSIdentityKind `json:"kind"` +} + +// Bastion defines a bastion host. +type Bastion struct { + // Enabled allows this provider to create a bastion host instance + // with a public ip to access the VPC private network. + // +optional + Enabled bool `json:"enabled"` + + // DisableIngressRules will ensure there are no Ingress rules in the bastion host's security group. + // Requires AllowedCIDRBlocks to be empty. + // +optional + DisableIngressRules bool `json:"disableIngressRules,omitempty"` + + // AllowedCIDRBlocks is a list of CIDR blocks allowed to access the bastion host. + // They are set as ingress rules for the Bastion host's Security Group (defaults to 0.0.0.0/0). + // +optional + AllowedCIDRBlocks []string `json:"allowedCIDRBlocks,omitempty"` + + // InstanceType will use the specified instance type for the bastion. If not specified, + // Cluster API Provider AWS will use t3.micro for all regions except us-east-1, where t2.micro + // will be the default. + InstanceType string `json:"instanceType,omitempty"` + + // AMI will use the specified AMI to boot the bastion. If not specified, + // the AMI will default to one picked out in public space. + // +optional + AMI string `json:"ami,omitempty"` +} + +// LoadBalancerType defines the type of load balancer to use. +type LoadBalancerType string + +var ( + // LoadBalancerTypeClassic is the classic ELB type. + LoadBalancerTypeClassic = LoadBalancerType("classic") + // LoadBalancerTypeELB is the ELB type. + LoadBalancerTypeELB = LoadBalancerType("elb") + // LoadBalancerTypeALB is the ALB type. + LoadBalancerTypeALB = LoadBalancerType("alb") + // LoadBalancerTypeNLB is the NLB type. + LoadBalancerTypeNLB = LoadBalancerType("nlb") + // LoadBalancerTypeDisabled disables the load balancer. + LoadBalancerTypeDisabled = LoadBalancerType("disabled") +) + +// AWSLoadBalancerSpec defines the desired state of an AWS load balancer. +type AWSLoadBalancerSpec struct { + // Name sets the name of the classic ELB load balancer. As per AWS, the name must be unique + // within your set of load balancers for the region, must have a maximum of 32 characters, must + // contain only alphanumeric characters or hyphens, and cannot begin or end with a hyphen. Once + // set, the value cannot be changed. + // +kubebuilder:validation:MaxLength:=32 + // +kubebuilder:validation:Pattern=`^[A-Za-z0-9]([A-Za-z0-9]{0,31}|[-A-Za-z0-9]{0,30}[A-Za-z0-9])$` + // +optional + Name *string `json:"name,omitempty"` + + // Scheme sets the scheme of the load balancer (defaults to internet-facing) + // +kubebuilder:default=internet-facing + // +kubebuilder:validation:Enum=internet-facing;internal + // +optional + Scheme *ELBScheme `json:"scheme,omitempty"` + + // CrossZoneLoadBalancing enables the classic ELB cross availability zone balancing. + // + // With cross-zone load balancing, each load balancer node for your Classic Load Balancer + // distributes requests evenly across the registered instances in all enabled Availability Zones. + // If cross-zone load balancing is disabled, each load balancer node distributes requests evenly across + // the registered instances in its Availability Zone only. + // + // Defaults to false. + // +optional + CrossZoneLoadBalancing bool `json:"crossZoneLoadBalancing"` + + // Subnets sets the subnets that should be applied to the control plane load balancer (defaults to discovered subnets for managed VPCs or an empty set for unmanaged VPCs) + // +optional + Subnets []string `json:"subnets,omitempty"` + + // HealthCheckProtocol sets the protocol type for ELB health check target + // default value is ELBProtocolSSL + // +kubebuilder:validation:Enum=TCP;SSL;HTTP;HTTPS;TLS;UDP + // +optional + HealthCheckProtocol *ELBProtocol `json:"healthCheckProtocol,omitempty"` + + // HealthCheck sets custom health check configuration to the API target group. + // +optional + HealthCheck *TargetGroupHealthCheckAPISpec `json:"healthCheck,omitempty"` + + // AdditionalSecurityGroups sets the security groups used by the load balancer. Expected to be security group IDs + // This is optional - if not provided new security groups will be created for the load balancer + // +optional + AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"` + + // AdditionalListeners sets the additional listeners for the control plane load balancer. + // This is only applicable to Network Load Balancer (NLB) types for the time being. + // +listType=map + // +listMapKey=port + // +optional + AdditionalListeners []AdditionalListenerSpec `json:"additionalListeners,omitempty"` + + // IngressRules sets the ingress rules for the control plane load balancer. + // +optional + IngressRules []IngressRule `json:"ingressRules,omitempty"` + + // LoadBalancerType sets the type for a load balancer. The default type is classic. + // +kubebuilder:default=classic + // +kubebuilder:validation:Enum:=classic;elb;alb;nlb;disabled + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` + + // DisableHostsRewrite disabled the hair pinning issue solution that adds the NLB's address as 127.0.0.1 to the hosts + // file of each instance. This is by default, false. + DisableHostsRewrite bool `json:"disableHostsRewrite,omitempty"` + + // PreserveClientIP lets the user control if preservation of client ips must be retained or not. + // If this is enabled 6443 will be opened to 0.0.0.0/0. + PreserveClientIP bool `json:"preserveClientIP,omitempty"` +} + +// AdditionalListenerSpec defines the desired state of an +// additional listener on an AWS load balancer. +type AdditionalListenerSpec struct { + // Port sets the port for the additional listener. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port int64 `json:"port"` + + // Protocol sets the protocol for the additional listener. + // Currently only TCP is supported. + // +kubebuilder:validation:Enum=TCP + // +kubebuilder:default=TCP + Protocol ELBProtocol `json:"protocol,omitempty"` + + // HealthCheck sets the optional custom health check configuration to the API target group. + // +optional + HealthCheck *TargetGroupHealthCheckAdditionalSpec `json:"healthCheck,omitempty"` +} + +// AWSClusterStatus defines the observed state of AWSCluster. +type AWSClusterStatus struct { + // +kubebuilder:default=false + Ready bool `json:"ready"` + Network NetworkStatus `json:"networkStatus,omitempty"` + FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` + Bastion *Instance `json:"bastion,omitempty"` + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +// S3Bucket defines a supporting S3 bucket for the cluster, currently can be optionally used for Ignition. +type S3Bucket struct { + // ControlPlaneIAMInstanceProfile is a name of the IAMInstanceProfile, which will be allowed + // to read control-plane node bootstrap data from S3 Bucket. + // +optional + ControlPlaneIAMInstanceProfile string `json:"controlPlaneIAMInstanceProfile,omitempty"` + + // NodesIAMInstanceProfiles is a list of IAM instance profiles, which will be allowed to read + // worker nodes bootstrap data from S3 Bucket. + // +optional + NodesIAMInstanceProfiles []string `json:"nodesIAMInstanceProfiles,omitempty"` + + // PresignedURLDuration defines the duration for which presigned URLs are valid. + // + // This is used to generate presigned URLs for S3 Bucket objects, which are used by + // control-plane and worker nodes to fetch bootstrap data. + // + // When enabled, the IAM instance profiles specified are not used. + // +optional + PresignedURLDuration *metav1.Duration `json:"presignedURLDuration,omitempty"` + + // Name defines name of S3 Bucket to be created. + // +kubebuilder:validation:MinLength:=3 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$` + Name string `json:"name"` + + // BestEffortDeleteObjects defines whether access/permission errors during object deletion should be ignored. + // +optional + BestEffortDeleteObjects *bool `json:"bestEffortDeleteObjects,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusters,scope=Namespaced,categories=cluster-api,shortName=awsc +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for EC2 instances" +// +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.network.vpc.id",description="AWS VPC the cluster is using" +// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint",description="API Endpoint",priority=1 +// +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.publicIp",description="Bastion IP address for breakglass access" +// +k8s:defaulter-gen=true + +// AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster API. +type AWSCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSClusterSpec `json:"spec,omitempty"` + Status AWSClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSClusterList contains a list of AWSCluster. +// +k8s:defaulter-gen=true +type AWSClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSCluster `json:"items"` +} + +// GetConditions returns the observations of the operational state of the AWSCluster resource. +func (r *AWSCluster) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1beta1.Conditions. +func (r *AWSCluster) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +func init() { + SchemeBuilder.Register(&AWSCluster{}, &AWSClusterList{}) +} diff --git a/pkg/capi/aws/api/v1beta2/awsclustertemplate_types.go b/pkg/capi/aws/api/v1beta2/awsclustertemplate_types.go new file mode 100644 index 000000000000..2f81400eef21 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/awsclustertemplate_types.go @@ -0,0 +1,64 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate. +type AWSClusterTemplateSpec struct { + Template AWSClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclustertemplates,scope=Namespaced,categories=cluster-api,shortName=awsct +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of AWSClusterTemplate" +// +k8s:defaulter-gen=true + +// AWSClusterTemplate is the schema for Amazon EC2 based Kubernetes Cluster Templates. +type AWSClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// AWSClusterTemplateList contains a list of AWSClusterTemplate. +type AWSClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSClusterTemplate{}, &AWSClusterTemplateList{}) +} + +// AWSClusterTemplateResource defines the desired state of AWSClusterTemplateResource. +type AWSClusterTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + Spec AWSClusterSpec `json:"spec"` +} diff --git a/pkg/capi/aws/api/v1beta2/awsidentity_types.go b/pkg/capi/aws/api/v1beta2/awsidentity_types.go new file mode 100644 index 000000000000..27b56d78d556 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/awsidentity_types.go @@ -0,0 +1,193 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AWSClusterIdentitySpec defines the Spec struct for AWSClusterIdentity types. +type AWSClusterIdentitySpec struct { + // AllowedNamespaces is used to identify which namespaces are allowed to use the identity from. + // Namespaces can be selected either using an array of namespaces or with label selector. + // An empty allowedNamespaces object indicates that AWSClusters can use this identity from any namespace. + // If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided) + // A namespace should be either in the NamespaceList or match with Selector to use the identity. + // + // +optional + // +nullable + AllowedNamespaces *AllowedNamespaces `json:"allowedNamespaces"` +} + +// AllowedNamespaces is a selector of namespaces that AWSClusters can +// use this ClusterPrincipal from. This is a standard Kubernetes LabelSelector, +// a label query over a set of resources. The result of matchLabels and +// matchExpressions are ANDed. +type AllowedNamespaces struct { + // An nil or empty list indicates that AWSClusters cannot use the identity from any namespace. + // + // +optional + // +nullable + NamespaceList []string `json:"list"` + + // An empty selector indicates that AWSClusters cannot use this + // AWSClusterIdentity from any namespace. + // +optional + Selector metav1.LabelSelector `json:"selector"` +} + +// AWSRoleSpec defines the specifications for all identities based around AWS roles. +type AWSRoleSpec struct { + // The Amazon Resource Name (ARN) of the role to assume. + RoleArn string `json:"roleARN"` + // An identifier for the assumed role session + SessionName string `json:"sessionName,omitempty"` + // The duration, in seconds, of the role session before it is renewed. + // +kubebuilder:validation:Minimum:=900 + // +kubebuilder:validation:Maximum:=43200 + DurationSeconds int32 `json:"durationSeconds,omitempty"` + // An IAM policy as a JSON-encoded string that you want to use as an inline session policy. + InlinePolicy string `json:"inlinePolicy,omitempty"` + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. + // The policies must exist in the same account as the role. + PolicyARNs []string `json:"policyARNs,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api,shortName=awssi +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API +// It represents a reference to an AWS access key ID and secret access key, stored in a secret. +type AWSClusterStaticIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterStaticIdentity + Spec AWSClusterStaticIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterStaticIdentityList contains a list of AWSClusterStaticIdentity. +type AWSClusterStaticIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterStaticIdentity `json:"items"` +} + +// AWSClusterStaticIdentitySpec defines the specifications for AWSClusterStaticIdentity. +type AWSClusterStaticIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + // Reference to a secret containing the credentials. The secret should + // contain the following data keys: + // AccessKeyID: AKIAIOSFODNN7EXAMPLE + // SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + // SessionToken: Optional + SecretRef string `json:"secretRef"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api,shortName=awsri +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API +// It is used to assume a role using the provided sourceRef. +type AWSClusterRoleIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterRoleIdentity. + Spec AWSClusterRoleIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterRoleIdentityList contains a list of AWSClusterRoleIdentity. +type AWSClusterRoleIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterRoleIdentity `json:"items"` +} + +// AWSClusterRoleIdentitySpec defines the specifications for AWSClusterRoleIdentity. +type AWSClusterRoleIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + AWSRoleSpec `json:",inline"` + // A unique identifier that might be required when you assume a role in another account. + // If the administrator of the account to which the role belongs provided you with an + // external ID, then provide that value in the ExternalId parameter. This value can be + // any string, such as a passphrase or account number. A cross-account role is usually + // set up to trust everyone in an account. Therefore, the administrator of the trusting + // account might send an external ID to the administrator of the trusted account. That + // way, only someone with the ID can assume the role, rather than everyone in the + // account. For more information about the external ID, see How to Use an External ID + // When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide. + // +optional + ExternalID string `json:"externalID,omitempty"` + + // SourceIdentityRef is a reference to another identity which will be chained to do + // role assumption. All identity types are accepted. + SourceIdentityRef *AWSIdentityReference `json:"sourceIdentityRef,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api,shortName=awsci +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API +// It is used to grant access to use Cluster API Provider AWS Controller credentials. +type AWSClusterControllerIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterControllerIdentity. + Spec AWSClusterControllerIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterControllerIdentityList contains a list of AWSClusterControllerIdentity. +type AWSClusterControllerIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterControllerIdentity `json:"items"` +} + +// AWSClusterControllerIdentitySpec defines the specifications for AWSClusterControllerIdentity. +type AWSClusterControllerIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` +} + +func init() { + SchemeBuilder.Register( + &AWSClusterStaticIdentity{}, + &AWSClusterStaticIdentityList{}, + &AWSClusterRoleIdentity{}, + &AWSClusterRoleIdentityList{}, + &AWSClusterControllerIdentity{}, + &AWSClusterControllerIdentityList{}, + ) +} diff --git a/pkg/capi/aws/api/v1beta2/awsmachine_types.go b/pkg/capi/aws/api/v1beta2/awsmachine_types.go new file mode 100644 index 000000000000..2ff52d71e076 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/awsmachine_types.go @@ -0,0 +1,521 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // MachineFinalizer allows ReconcileAWSMachine to clean up AWS resources associated with AWSMachine before + // removing it from the apiserver. + MachineFinalizer = "awsmachine.infrastructure.cluster.x-k8s.io" + + // DefaultIgnitionVersion represents default Ignition version generated for machine userdata. + DefaultIgnitionVersion = "2.3" + + // DefaultIgnitionStorageType represents the default storage type of Ignition userdata + DefaultIgnitionStorageType = IgnitionStorageTypeOptionClusterObjectStore + + // DefaultMachinePoolIgnitionStorageType represents the default storage type of Ignition userdata for machine pools. + // + // This is only different from DefaultIgnitionStorageType because of backward compatibility. Machine pools used to + // default to store Ignition user data directly on the EC2 instance. Since the choice between remote storage (S3) + // and direct storage was introduced, the default was kept, but might change in newer API versions. + DefaultMachinePoolIgnitionStorageType = IgnitionStorageTypeOptionUnencryptedUserData +) + +// SecretBackend defines variants for backend secret storage. +type SecretBackend string + +var ( + // SecretBackendSSMParameterStore defines AWS Systems Manager Parameter Store as the secret backend. + SecretBackendSSMParameterStore = SecretBackend("ssm-parameter-store") + + // SecretBackendSecretsManager defines AWS Secrets Manager as the secret backend. + SecretBackendSecretsManager = SecretBackend("secrets-manager") +) + +// IgnitionStorageTypeOption defines the different storage types for Ignition. +type IgnitionStorageTypeOption string + +const ( + // IgnitionStorageTypeOptionClusterObjectStore means the chosen Ignition storage type is ClusterObjectStore. + IgnitionStorageTypeOptionClusterObjectStore = IgnitionStorageTypeOption("ClusterObjectStore") + + // IgnitionStorageTypeOptionUnencryptedUserData means the chosen Ignition storage type is UnencryptedUserData. + IgnitionStorageTypeOptionUnencryptedUserData = IgnitionStorageTypeOption("UnencryptedUserData") +) + +// NetworkInterfaceType is the type of network interface. +type NetworkInterfaceType string + +const ( + // NetworkInterfaceTypeENI means the network interface type is Elastic Network Interface. + NetworkInterfaceTypeENI NetworkInterfaceType = NetworkInterfaceType("interface") + // NetworkInterfaceTypeEFAWithENAInterface means the network interface type is Elastic Fabric Adapter with Elastic Network Adapter. + NetworkInterfaceTypeEFAWithENAInterface NetworkInterfaceType = NetworkInterfaceType("efa") +) + +// AWSMachineSpec defines the desired state of an Amazon EC2 instance. +// +kubebuilder:validation:XValidation:rule="!has(self.capacityReservationId) || !has(self.marketType) || self.marketType != 'Spot'",message="capacityReservationId may not be set when marketType is Spot" +// +kubebuilder:validation:XValidation:rule="!has(self.capacityReservationId) || !has(self.spotMarketOptions)",message="capacityReservationId cannot be set when spotMarketOptions is specified" +type AWSMachineSpec struct { + // ProviderID is the unique identifier as specified by the cloud provider. + ProviderID *string `json:"providerID,omitempty"` + + // InstanceID is the EC2 instance ID for this machine. + InstanceID *string `json:"instanceID,omitempty"` + + // InstanceMetadataOptions is the metadata options for the EC2 instance. + // +optional + InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"` + + // AMI is the reference to the AMI from which to create the machine instance. + AMI AMIReference `json:"ami,omitempty"` + + // ImageLookupFormat is the AMI naming format to look up the image for this + // machine It will be ignored if an explicit AMI is set. Supports + // substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and + // kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system to use for + // image lookup the AMI is not set. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // InstanceType is the type of instance to create. Example: m4.xlarge + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength:=2 + InstanceType string `json:"instanceType"` + + // CPUOptions defines CPU-related settings for the instance, including the confidential computing policy. + // When omitted, this means no opinion and the AWS platform is left to choose a reasonable default. + // +optional + CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"` + + // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the + // AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the + // AWSMachine's value takes precedence. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + // +optional + IAMInstanceProfile string `json:"iamInstanceProfile,omitempty"` + + // PublicIP specifies whether the instance should get a public IP. + // Precedence for this setting is as follows: + // 1. This field if set + // 2. Cluster/flavor setting + // 3. Subnet default + // +optional + PublicIP *bool `json:"publicIP,omitempty"` + + // ElasticIPPool is the configuration to allocate Public IPv4 address (Elastic IP/EIP) from user-defined pool. + // + // +optional + ElasticIPPool *ElasticIPPool `json:"elasticIpPool,omitempty"` + + // AdditionalSecurityGroups is an array of references to security groups that should be applied to the + // instance. These security groups would be set in addition to any security groups defined + // at the cluster level or in the actuator. It is possible to specify either IDs of Filters. Using Filters + // will cause additional requests to AWS API and if tags change the attached security groups might change too. + // +optional + AdditionalSecurityGroups []AWSResourceReference `json:"additionalSecurityGroups,omitempty"` + + // Subnet is a reference to the subnet to use for this instance. If not specified, + // the cluster subnet will be used. + // +optional + Subnet *AWSResourceReference `json:"subnet,omitempty"` + + // SecurityGroupOverrides is an optional set of security groups to use for the node. + // This is optional - if not provided security groups from the cluster will be used. + // +optional + SecurityGroupOverrides map[SecurityGroupRole]string `json:"securityGroupOverrides,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // RootVolume encapsulates the configuration options for the root volume + // +optional + RootVolume *Volume `json:"rootVolume,omitempty"` + + // Configuration options for the non root storage volumes. + // +optional + NonRootVolumes []Volume `json:"nonRootVolumes,omitempty"` + + // NetworkInterfaces is a list of ENIs to associate with the instance. + // A maximum of 2 may be specified. + // +optional + // +kubebuilder:validation:MaxItems=2 + NetworkInterfaces []string `json:"networkInterfaces,omitempty"` + + // NetworkInterfaceType is the interface type of the primary network Interface. + // If not specified, AWS applies a default value. + // +kubebuilder:validation:Enum=interface;efa + // +optional + NetworkInterfaceType NetworkInterfaceType `json:"networkInterfaceType,omitempty"` + + // UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. + // cloud-init has built-in support for gzip-compressed user data + // user data stored in aws secret manager is always gzip-compressed. + // + // +optional + UncompressedUserData *bool `json:"uncompressedUserData,omitempty"` + + // CloudInit defines options related to the bootstrapping systems where + // CloudInit is used. + // +optional + CloudInit CloudInit `json:"cloudInit,omitempty"` + + // Ignition defined options related to the bootstrapping systems where Ignition is used. + // +optional + Ignition *Ignition `json:"ignition,omitempty"` + + // SpotMarketOptions allows users to configure instances to be run using AWS Spot instances. + // +optional + SpotMarketOptions *SpotMarketOptions `json:"spotMarketOptions,omitempty"` + + // PlacementGroupName specifies the name of the placement group in which to launch the instance. + // +optional + PlacementGroupName string `json:"placementGroupName,omitempty"` + + // PlacementGroupPartition is the partition number within the placement group in which to launch the instance. + // This value is only valid if the placement group, referred in `PlacementGroupName`, was created with + // strategy set to partition. + // +kubebuilder:validation:Minimum:=1 + // +kubebuilder:validation:Maximum:=7 + // +optional + PlacementGroupPartition int64 `json:"placementGroupPartition,omitempty"` + + // Tenancy indicates if instance should run on shared or single-tenant hardware. + // When Tenancy=host, AWS will attempt to find a suitable host from: + // - Preexisting allocated hosts that have auto-placement enabled + // - A specific host ID, if configured + // - Allocating a new dedicated host if DynamicHostAllocation is configured + // +optional + // +kubebuilder:validation:Enum:=default;dedicated;host + Tenancy string `json:"tenancy,omitempty"` + + // PrivateDNSName is the options for the instance hostname. + // +optional + PrivateDNSName *PrivateDNSName `json:"privateDnsName,omitempty"` + + // CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched. + // +optional + CapacityReservationID *string `json:"capacityReservationId,omitempty"` + + // MarketType specifies the type of market for the EC2 instance. Valid values include: + // "OnDemand" (default): The instance runs as a standard OnDemand instance. + // "Spot": The instance runs as a Spot instance. When SpotMarketOptions is provided, the marketType defaults to "Spot". + // "CapacityBlock": The instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations. + // If this value is selected, CapacityReservationID must be specified to identify the target reservation. + // If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot". + // +optional + MarketType MarketType `json:"marketType,omitempty"` + + // HostID specifies the Dedicated Host on which the instance must be started. + // This field is mutually exclusive with DynamicHostAllocation. + // +kubebuilder:validation:Pattern=`^h-[0-9a-f]{17}$` + // +kubebuilder:validation:MaxLength=19 + // +optional + HostID *string `json:"hostID,omitempty"` + + // HostAffinity specifies the dedicated host affinity setting for the instance. + // When HostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped. + // When HostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host. + // When HostAffinity is defined, HostID is required. + // +optional + // +kubebuilder:validation:Enum:=default;host + // +kubebuilder:default=host + HostAffinity *string `json:"hostAffinity,omitempty"` + + // DynamicHostAllocation enables automatic allocation of a single dedicated host. + // This field is mutually exclusive with HostID and always allocates exactly one host. + // Cost effectiveness of allocating a single instance on a dedicated host may vary + // depending on the instance type and the region. + // +optional + DynamicHostAllocation *DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"` + + // CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include: + // "Open": The instance may make use of open Capacity Reservations that match its AZ and InstanceType + // "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads + // "CapacityReservationsOnly": The instance will only run if matched or targeted to a Capacity Reservation. Note that this is incompatible with a MarketType of `Spot` + // +kubebuilder:validation:Enum="";None;CapacityReservationsOnly;Open + // +optional + CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"` +} + +// DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation. +// This specification always allocates exactly one dedicated host per machine. +type DynamicHostAllocationSpec struct { + // Tags to apply to the allocated dedicated host. + // +optional + Tags map[string]string `json:"tags,omitempty"` +} + +// CloudInit defines options related to the bootstrapping systems where +// CloudInit is used. +type CloudInit struct { + // InsecureSkipSecretsManager, when set to true will not use AWS Secrets Manager + // or AWS Systems Manager Parameter Store to ensure privacy of userdata. + // By default, a cloud-init boothook shell script is prepended to download + // the userdata from Secrets Manager and additionally delete the secret. + InsecureSkipSecretsManager bool `json:"insecureSkipSecretsManager,omitempty"` + + // SecretCount is the number of secrets used to form the complete secret + // +optional + SecretCount int32 `json:"secretCount,omitempty"` + + // SecretPrefix is the prefix for the secret name. This is stored + // temporarily, and deleted when the machine registers as a node against + // the workload cluster. + // +optional + SecretPrefix string `json:"secretPrefix,omitempty"` + + // SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager + // Parameter Storage to distribute secrets. By default or with the value of secrets-manager, + // will use AWS Secrets Manager instead. + // +optional + // +kubebuilder:validation:Enum=secrets-manager;ssm-parameter-store + SecureSecretsBackend SecretBackend `json:"secureSecretsBackend,omitempty"` +} + +// Ignition defines options related to the bootstrapping systems where Ignition is used. +// For more information on Ignition configuration, see https://coreos.github.io/butane/specs/ +type Ignition struct { + // Version defines which version of Ignition will be used to generate bootstrap data. + // Defaults to `2.3` if storageType is set to `ClusterObjectStore`. + // It will be ignored if storageType is set to `UnencryptedUserData`, as the userdata defines its own version. + // + // +optional + // +kubebuilder:validation:Enum="2.3";"3.0";"3.1";"3.2";"3.3";"3.4" + Version string `json:"version,omitempty"` + + // StorageType defines how to store the boostrap user data for Ignition. + // This can be used to instruct Ignition from where to fetch the user data to bootstrap an instance. + // + // When omitted, the storage option will default to ClusterObjectStore. + // + // When set to "ClusterObjectStore", if the capability is available and a Cluster ObjectStore configuration + // is correctly provided in the Cluster object (under .spec.s3Bucket), + // an object store will be used to store bootstrap user data. + // + // When set to "UnencryptedUserData", EC2 Instance User Data will be used to store the machine bootstrap user data, unencrypted. + // This option is considered less secure than others as user data may contain sensitive informations (keys, certificates, etc.) + // and users with ec2:DescribeInstances permission or users running pods + // that can access the ec2 metadata service have access to this sensitive information. + // So this is only to be used at ones own risk, and only when other more secure options are not viable. + // + // +optional + // +kubebuilder:default="ClusterObjectStore" + // +kubebuilder:validation:Enum:="ClusterObjectStore";"UnencryptedUserData" + StorageType IgnitionStorageTypeOption `json:"storageType,omitempty"` + + // Proxy defines proxy settings for Ignition. + // Only valid for Ignition versions 3.1 and above. + // +optional + Proxy *IgnitionProxy `json:"proxy,omitempty"` + + // TLS defines TLS settings for Ignition. + // Only valid for Ignition versions 3.1 and above. + // +optional + TLS *IgnitionTLS `json:"tls,omitempty"` +} + +// IgnitionCASource defines the source of the certificate authority to use for Ignition. +// +kubebuilder:validation:MaxLength:=65536 +type IgnitionCASource string + +// IgnitionTLS defines TLS settings for Ignition. +type IgnitionTLS struct { + // CASources defines the list of certificate authorities to use for Ignition. + // The value is the certificate bundle (in PEM format). The bundle can contain multiple concatenated certificates. + // Supported schemes are http, https, tftp, s3, arn, gs, and `data` (RFC 2397) URL scheme. + // + // +optional + // +kubebuilder:validation:MaxItems=64 + CASources []IgnitionCASource `json:"certificateAuthorities,omitempty"` +} + +// IgnitionNoProxy defines the list of domains to not proxy for Ignition. +// +kubebuilder:validation:MaxLength:=2048 +type IgnitionNoProxy string + +// IgnitionProxy defines proxy settings for Ignition. +type IgnitionProxy struct { + // HTTPProxy is the HTTP proxy to use for Ignition. + // A single URL that specifies the proxy server to use for HTTP and HTTPS requests, + // unless overridden by the HTTPSProxy or NoProxy options. + // +optional + HTTPProxy *string `json:"httpProxy,omitempty"` + + // HTTPSProxy is the HTTPS proxy to use for Ignition. + // A single URL that specifies the proxy server to use for HTTPS requests, + // unless overridden by the NoProxy option. + // +optional + HTTPSProxy *string `json:"httpsProxy,omitempty"` + + // NoProxy is the list of domains to not proxy for Ignition. + // Specifies a list of strings to hosts that should be excluded from proxying. + // + // Each value is represented by: + // - An IP address prefix (1.2.3.4) + // - An IP address prefix in CIDR notation (1.2.3.4/8) + // - A domain name + // - A domain name matches that name and all subdomains + // - A domain name with a leading . matches subdomains only + // - A special DNS label (*), indicates that no proxying should be done + // + // An IP address prefix and domain name can also include a literal port number (1.2.3.4:80). + // +optional + // +kubebuilder:validation:MaxItems=64 + NoProxy []IgnitionNoProxy `json:"noProxy,omitempty"` +} + +// AWSMachineStatus defines the observed state of AWSMachine. +type AWSMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Interruptible reports that this machine is using spot instances and can therefore be interrupted by CAPI when it receives a notice that the spot instance is to be terminated by AWS. + // This will be set to true when SpotMarketOptions is not nil (i.e. this machine is using a spot instance). + // +optional + Interruptible bool `json:"interruptible,omitempty"` + + // Addresses contains the AWS instance associated addresses. + Addresses []clusterv1beta1.MachineAddress `json:"addresses,omitempty"` + + // InstanceState is the state of the AWS instance for this machine. + // +optional + InstanceState *InstanceState `json:"instanceState,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *string `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the AWSMachine. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // DedicatedHost tracks the dynamically allocated dedicated host. + // This field is populated when DynamicHostAllocation is used. + // +optional + DedicatedHost *DedicatedHostStatus `json:"dedicatedHost,omitempty"` +} + +// DedicatedHostStatus defines the observed state of a dynamically allocated dedicated host +// associated with an AWSMachine. This struct is used to track the ID of the dedicated host. +type DedicatedHostStatus struct { + // ID tracks the dynamically allocated dedicated host ID. + // This field is populated when DynamicHostAllocation is used. + // +optional + ID *string `json:"id,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmachines,scope=Namespaced,categories=cluster-api,shortName=awsm +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSMachine belongs" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="EC2 instance state" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" +// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="EC2 instance ID" +// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this AWSMachine" +// +k8s:defaulter-gen=true + +// AWSMachine is the schema for Amazon EC2 machines. +type AWSMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSMachineSpec `json:"spec,omitempty"` + Status AWSMachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the AWSMachine resource. +func (r *AWSMachine) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1beta1.Conditions. +func (r *AWSMachine) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// AWSMachineList contains a list of Amazon EC2 machines. +type AWSMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSMachine{}, &AWSMachineList{}) +} diff --git a/pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go b/pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go new file mode 100644 index 000000000000..12829090f2fa --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go @@ -0,0 +1,133 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// Architecture represents the CPU architecture of the node. +// Its underlying type is a string and its value can be any of amd64, arm64. +type Architecture string + +// Architecture constants. +const ( + ArchitectureAmd64 Architecture = "amd64" + ArchitectureArm64 Architecture = "arm64" +) + +// OperatingSystem represents the operating system of the node. +// Its underlying type is a string and its value can be any of linux, windows. +type OperatingSystem string + +// Operating system constants. +const ( + // OperatingSystemLinux represents the Linux operating system. + OperatingSystemLinux OperatingSystem = "linux" + // OperatingSystemWindows represents the Windows operating system. + OperatingSystemWindows OperatingSystem = "windows" +) + +// NodeInfo contains information about the node's architecture and operating system. +type NodeInfo struct { + // Architecture is the CPU architecture of the node. + // Its underlying type is a string and its value can be any of amd64, arm64. + // +kubebuilder:validation:Enum=amd64;arm64 + // +optional + Architecture Architecture `json:"architecture,omitempty"` + // OperatingSystem is the operating system of the node. + // Its underlying type is a string and its value can be any of linux, windows. + // +kubebuilder:validation:Enum=linux;windows + // +optional + OperatingSystem OperatingSystem `json:"operatingSystem,omitempty"` +} + +// AWSMachineTemplateStatus defines a status for an AWSMachineTemplate. +type AWSMachineTemplateStatus struct { + // Capacity defines the resource capacity for this machine. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + Capacity corev1.ResourceList `json:"capacity,omitempty"` + + // NodeInfo contains information about the node's architecture and operating system. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + NodeInfo *NodeInfo `json:"nodeInfo,omitempty"` + + // Conditions defines current service state of the AWSMachineTemplate. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +// AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate. +type AWSMachineTemplateSpec struct { + Template AWSMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=awsmt +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +k8s:defaulter-gen=true + +// AWSMachineTemplate is the schema for the Amazon EC2 Machine Templates API. +type AWSMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSMachineTemplateSpec `json:"spec,omitempty"` + Status AWSMachineTemplateStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSMachineTemplateList contains a list of AWSMachineTemplate. +type AWSMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSMachineTemplate `json:"items"` +} + +// AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template. +type AWSMachineTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + + // Spec is the specification of the desired behavior of the machine. + Spec AWSMachineSpec `json:"spec"` +} + +// GetConditions returns the observations of the operational state of the AWSMachineTemplate resource. +func (r *AWSMachineTemplate) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSMachineTemplate to the predescribed clusterv1beta1.Conditions. +func (r *AWSMachineTemplate) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +func init() { + SchemeBuilder.Register(&AWSMachineTemplate{}, &AWSMachineTemplateList{}) +} diff --git a/pkg/capi/aws/api/v1beta2/bastion.go b/pkg/capi/aws/api/v1beta2/bastion.go new file mode 100644 index 000000000000..16c92951608f --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/bastion.go @@ -0,0 +1,63 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "fmt" + "net" + "regexp" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +var ( + sshKeyValidNameRegex = regexp.MustCompile(`^[[:graph:]]+([[:print:]]*[[:graph:]]+)*$`) +) + +// Validate will validate the bastion fields. +func (b *Bastion) Validate() []*field.Error { + var errs field.ErrorList + + if b.DisableIngressRules && len(b.AllowedCIDRBlocks) > 0 { + errs = append(errs, + field.Forbidden(field.NewPath("spec", "bastion", "allowedCIDRBlocks"), "cannot be set if spec.bastion.disableIngressRules is true"), + ) + return errs + } + + for i, cidr := range b.AllowedCIDRBlocks { + if _, _, err := net.ParseCIDR(cidr); err != nil { + errs = append(errs, + field.Invalid(field.NewPath("spec", "bastion", fmt.Sprintf("allowedCIDRBlocks[%d]", i)), cidr, "must be a valid CIDR block"), + ) + } + } + return errs +} + +func validateSSHKeyName(sshKeyName *string) field.ErrorList { + var allErrs field.ErrorList + switch { + case sshKeyName == nil: + // nil is accepted + case sshKeyName != nil && *sshKeyName == "": + // empty string is accepted + case sshKeyName != nil && !sshKeyValidNameRegex.MatchString(*sshKeyName): + allErrs = append(allErrs, field.Invalid(field.NewPath("sshKeyName"), sshKeyName, "Name is invalid. Must be specified in ASCII and must not start or end in whitespace")) + } + return allErrs +} diff --git a/pkg/capi/aws/api/v1beta2/conditions_consts.go b/pkg/capi/aws/api/v1beta2/conditions_consts.go new file mode 100644 index 000000000000..1175ac9916df --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/conditions_consts.go @@ -0,0 +1,201 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + +const ( + // PrincipalCredentialRetrievedCondition reports on whether Principal credentials could be retrieved successfully. + // A possible scenario, where retrieval is unsuccessful, is when SourcePrincipal is not authorized for assume role. + PrincipalCredentialRetrievedCondition clusterv1beta1.ConditionType = "PrincipalCredentialRetrieved" + // PrincipalCredentialRetrievalFailedReason used when errors occur during identity credential retrieval. + PrincipalCredentialRetrievalFailedReason = "PrincipalCredentialRetrievalFailed" + // CredentialProviderBuildFailedReason used when errors occur during building providers before trying credential retrieval. + //nolint:gosec + CredentialProviderBuildFailedReason = "CredentialProviderBuildFailed" + // PrincipalUsageAllowedCondition reports on whether Principal and all the nested source identities are allowed to be used in the AWSCluster namespace. + PrincipalUsageAllowedCondition clusterv1beta1.ConditionType = "PrincipalUsageAllowed" + // PrincipalUsageUnauthorizedReason used when AWSCluster namespace is not in the identity's allowed namespaces list. + PrincipalUsageUnauthorizedReason = "PrincipalUsageUnauthorized" + // SourcePrincipalUsageUnauthorizedReason used when AWSCluster is not in the intersection of source identity allowed namespaces + // and allowed namespaces of the identities that source identity depends to. + SourcePrincipalUsageUnauthorizedReason = "SourcePrincipalUsageUnauthorized" +) + +const ( + // VpcReadyCondition reports on the successful reconciliation of a VPC. + VpcReadyCondition clusterv1beta1.ConditionType = "VpcReady" + // VpcCreationStartedReason used when attempting to create a VPC for a managed cluster. + // Will not be applied to unmanaged clusters. + VpcCreationStartedReason = "VpcCreationStarted" + // VpcReconciliationFailedReason used when errors occur during VPC reconciliation. + VpcReconciliationFailedReason = "VpcReconciliationFailed" +) + +const ( + // SubnetsReadyCondition reports on the successful reconciliation of subnets. + SubnetsReadyCondition clusterv1beta1.ConditionType = "SubnetsReady" + // SubnetsReconciliationFailedReason used to report failures while reconciling subnets. + SubnetsReconciliationFailedReason = "SubnetsReconciliationFailed" +) + +const ( + // InternetGatewayReadyCondition reports on the successful reconciliation of internet gateways. + // Only applicable to managed clusters. + InternetGatewayReadyCondition clusterv1beta1.ConditionType = "InternetGatewayReady" + // InternetGatewayFailedReason used when errors occur during internet gateway reconciliation. + InternetGatewayFailedReason = "InternetGatewayFailed" +) + +const ( + // EgressOnlyInternetGatewayReadyCondition reports on the successful reconciliation of egress only internet gateways. + // Only applicable to managed clusters. + EgressOnlyInternetGatewayReadyCondition clusterv1beta1.ConditionType = "EgressOnlyInternetGatewayReady" + // EgressOnlyInternetGatewayFailedReason used when errors occur during egress only internet gateway reconciliation. + EgressOnlyInternetGatewayFailedReason = "EgressOnlyInternetGatewayFailed" +) + +const ( + // CarrierGatewayReadyCondition reports on the successful reconciliation of carrier gateways. + // Only applicable to managed clusters. + CarrierGatewayReadyCondition clusterv1beta1.ConditionType = "CarrierGatewayReady" + // CarrierGatewayFailedReason used when errors occur during carrier gateway reconciliation. + CarrierGatewayFailedReason = "CarrierGatewayFailed" +) + +const ( + // NatGatewaysReadyCondition reports successful reconciliation of NAT gateways. + // Only applicable to managed clusters. + NatGatewaysReadyCondition clusterv1beta1.ConditionType = "NatGatewaysReady" + // NatGatewaysCreationStartedReason set once when creating new NAT gateways. + NatGatewaysCreationStartedReason = "NatGatewaysCreationStarted" + // NatGatewaysReconciliationFailedReason used when any errors occur during reconciliation of NAT gateways. + NatGatewaysReconciliationFailedReason = "NatGatewaysReconciliationFailed" +) + +const ( + // RouteTablesReadyCondition reports successful reconciliation of route tables. + // Only applicable to managed clusters. + RouteTablesReadyCondition clusterv1beta1.ConditionType = "RouteTablesReady" + // RouteTableReconciliationFailedReason used when any errors occur during reconciliation of route tables. + RouteTableReconciliationFailedReason = "RouteTableReconciliationFailed" +) + +const ( + // VpcEndpointsReadyCondition reports successful reconciliation of vpc endpoints. + // Only applicable to managed clusters. + VpcEndpointsReadyCondition clusterv1beta1.ConditionType = "VpcEndpointsReadyCondition" + // VpcEndpointsReconciliationFailedReason used when any errors occur during reconciliation of vpc endpoints. + VpcEndpointsReconciliationFailedReason = "VpcEndpointsReconciliationFailed" +) + +const ( + // SecondaryCidrsReadyCondition reports successful reconciliation of secondary CIDR blocks. + // Only applicable to managed clusters. + SecondaryCidrsReadyCondition clusterv1beta1.ConditionType = "SecondaryCidrsReady" + // SecondaryCidrReconciliationFailedReason used when any errors occur during reconciliation of secondary CIDR blocks. + SecondaryCidrReconciliationFailedReason = "SecondaryCidrReconciliationFailed" +) + +const ( + // ClusterSecurityGroupsReadyCondition reports successful reconciliation of security groups. + ClusterSecurityGroupsReadyCondition clusterv1beta1.ConditionType = "ClusterSecurityGroupsReady" + // ClusterSecurityGroupReconciliationFailedReason used when any errors occur during reconciliation of security groups. + ClusterSecurityGroupReconciliationFailedReason = "SecurityGroupReconciliationFailed" +) + +const ( + // BastionHostReadyCondition reports whether a bastion host is ready. Depending on the configuration, a cluster + // may not require a bastion host and this condition will be skipped. + BastionHostReadyCondition clusterv1beta1.ConditionType = "BastionHostReady" + // BastionCreationStartedReason used when creating a new bastion host. + BastionCreationStartedReason = "BastionCreationStarted" + // BastionHostFailedReason used when an error occurs during the creation of a bastion host. + BastionHostFailedReason = "BastionHostFailed" +) + +const ( + // LoadBalancerReadyCondition reports on whether a control plane load balancer was successfully reconciled. + LoadBalancerReadyCondition clusterv1beta1.ConditionType = "LoadBalancerReady" + // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. + WaitForDNSNameReason = "WaitForDNSName" + // WaitForExternalControlPlaneEndpointReason is available when the AWS Cluster is waiting for an externally managed + // Load Balancer, such as an external Control Plane provider. + WaitForExternalControlPlaneEndpointReason = "WaitForExternalControlPlaneEndpoint" + // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. + WaitForDNSNameResolveReason = "WaitForDNSNameResolve" + // LoadBalancerFailedReason used when an error occurs during load balancer reconciliation. + LoadBalancerFailedReason = "LoadBalancerFailed" +) + +const ( + // InstanceReadyCondition reports on current status of the EC2 instance. Ready indicates the instance is in a Running state. + InstanceReadyCondition clusterv1beta1.ConditionType = "InstanceReady" + + // DedicatedHostReleaseCondition reports on the status of dedicated host release operations. + // This condition tracks whether the dedicated host has been successfully released or if there are failures. + DedicatedHostReleaseCondition clusterv1beta1.ConditionType = "DedicatedHostRelease" + + // InstanceNotFoundReason used when the instance couldn't be retrieved. + InstanceNotFoundReason = "InstanceNotFound" + // InstanceTerminatedReason instance is in a terminated state. + InstanceTerminatedReason = "InstanceTerminated" + // InstanceStoppedReason instance is in a stopped state. + InstanceStoppedReason = "InstanceStopped" + // InstanceNotReadyReason used when the instance is in a pending state. + InstanceNotReadyReason = "InstanceNotReady" + // InstanceProvisionStartedReason set when the provisioning of an instance started. + InstanceProvisionStartedReason = "InstanceProvisionStarted" + // InstanceProvisionFailedReason used for failures during instance provisioning. + InstanceProvisionFailedReason = "InstanceProvisionFailed" + // WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + // WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" +) + +const ( + // SecurityGroupsReadyCondition indicates the security groups are up to date on the AWSMachine. + SecurityGroupsReadyCondition clusterv1beta1.ConditionType = "SecurityGroupsReady" + + // SecurityGroupsFailedReason used when the security groups could not be synced. + SecurityGroupsFailedReason = "SecurityGroupsSyncFailed" +) + +const ( + // ELBAttachedCondition will report true when a control plane is successfully registered with an ELB. + // When set to false, severity can be an Error if the subnet is not found or unavailable in the instance's AZ. + // Note this is only applicable to control plane machines. + // Only applicable to control plane machines. + ELBAttachedCondition clusterv1beta1.ConditionType = "ELBAttached" + + // ELBAttachFailedReason used when a control plane node fails to attach to the ELB. + ELBAttachFailedReason = "ELBAttachFailed" + // ELBDetachFailedReason used when a control plane node fails to detach from an ELB. + ELBDetachFailedReason = "ELBDetachFailed" +) + +const ( + // S3BucketReadyCondition indicates an S3 bucket has been created successfully. + S3BucketReadyCondition clusterv1beta1.ConditionType = "S3BucketCreated" + + // S3BucketFailedReason is used when any errors occur during reconciliation of an S3 bucket. + S3BucketFailedReason = "S3BucketCreationFailed" + + // DedicatedHostReleaseFailedReason used when the dedicated host release fails. + DedicatedHostReleaseFailedReason = "DedicatedHostReleaseFailed" +) diff --git a/pkg/capi/aws/api/v1beta2/defaults.go b/pkg/capi/aws/api/v1beta2/defaults.go new file mode 100644 index 000000000000..8ae799f7b6c3 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/defaults.go @@ -0,0 +1,86 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +// SetDefaults_Bastion is used by defaulter-gen. +func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck + // Default to allow open access to the bastion host if no CIDR Blocks have been set + if len(obj.AllowedCIDRBlocks) == 0 && !obj.DisableIngressRules { + obj.AllowedCIDRBlocks = []string{"0.0.0.0/0"} + } +} + +// SetDefaults_NetworkSpec is used by defaulter-gen. +func SetDefaults_NetworkSpec(obj *NetworkSpec) { //nolint:golint,stylecheck + // Default to Calico ingress rules if no rules have been set + if obj.CNI == nil { + obj.CNI = &CNISpec{ + CNIIngressRules: CNIIngressRules{ + { + Description: "bgp (calico)", + Protocol: SecurityGroupProtocolTCP, + FromPort: 179, + ToPort: 179, + }, + { + Description: "IP-in-IP (calico)", + Protocol: SecurityGroupProtocolIPinIP, + FromPort: -1, + ToPort: 65535, + }, + }, + } + } +} + +// SetDefaults_AWSClusterSpec is used by defaulter-gen. +func SetDefaults_AWSClusterSpec(s *AWSClusterSpec) { //nolint:golint,stylecheck + if s.IdentityRef == nil { + s.IdentityRef = &AWSIdentityReference{ + Kind: ControllerIdentityKind, + Name: AWSClusterControllerIdentityName, + } + } + if s.ControlPlaneLoadBalancer == nil { + s.ControlPlaneLoadBalancer = &AWSLoadBalancerSpec{ + Scheme: &ELBSchemeInternetFacing, + } + } + if s.ControlPlaneLoadBalancer.LoadBalancerType == "" { + s.ControlPlaneLoadBalancer.LoadBalancerType = LoadBalancerTypeClassic + } + if s.SecondaryControlPlaneLoadBalancer != nil { + if s.SecondaryControlPlaneLoadBalancer.LoadBalancerType == "" { + s.SecondaryControlPlaneLoadBalancer.LoadBalancerType = LoadBalancerTypeNLB + } + if s.SecondaryControlPlaneLoadBalancer.Scheme == nil { + s.SecondaryControlPlaneLoadBalancer.Scheme = &ELBSchemeInternal + } + } +} + +// SetDefaults_Labels is used to default cluster scope resources for clusterctl move. +//nolint:golint,stylecheck +// Defaults to set label if no labels have been set + +// SetDefaults_AWSMachineSpec is used by defaulter-gen. +func SetDefaults_AWSMachineSpec(obj *AWSMachineSpec) { //nolint:golint,stylecheck + if obj.InstanceMetadataOptions == nil { + obj.InstanceMetadataOptions = &InstanceMetadataOptions{} + } + obj.InstanceMetadataOptions.SetDefaults() +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/doc.go b/pkg/capi/aws/api/v1beta2/doc.go similarity index 73% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/doc.go rename to pkg/capi/aws/api/v1beta2/doc.go index 9308d1fb621b..4ed8bbddb80e 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/doc.go +++ b/pkg/capi/aws/api/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2024 The Kubernetes Authors. +Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1beta2 contains API Schema definitions for the controlplane v1beta2 API group // +gencrdrefdocs:force -// +groupName=controlplane.cluster.x-k8s.io -// +k8s:defaulter-gen=TypeMeta +// +groupName=infrastructure.cluster.x-k8s.io + +// Package v1beta2 contains the v1beta2 API implementation. package v1beta2 diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/groupversion_info.go b/pkg/capi/aws/api/v1beta2/groupversion_info.go similarity index 78% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/groupversion_info.go rename to pkg/capi/aws/api/v1beta2/groupversion_info.go index ea4ec8f78411..1d921ac08c87 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/groupversion_info.go +++ b/pkg/capi/aws/api/v1beta2/groupversion_info.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The Kubernetes Authors. +Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1beta2 contains API Schema definitions for the controlplane v1beta2 API group. +// Package v1beta2 contains API Schema definitions for the infrastructure v1beta2 API group // +kubebuilder:object:generate=true -// +groupName=controlplane.cluster.x-k8s.io +// +groupName=infrastructure.cluster.x-k8s.io package v1beta2 import ( @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta2"} + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta2"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/pkg/capi/aws/api/v1beta2/network_types.go b/pkg/capi/aws/api/v1beta2/network_types.go new file mode 100644 index 000000000000..82eb30dcd291 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/network_types.go @@ -0,0 +1,1098 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "fmt" + "sort" + "time" +) + +const ( + // DefaultAPIServerPort defines the API server port when defining a Load Balancer. + DefaultAPIServerPort = 6443 + // DefaultAPIServerPortString defines the API server port as a string for convenience. + DefaultAPIServerPortString = "6443" + // DefaultAPIServerHealthCheckPath the API server health check path. + DefaultAPIServerHealthCheckPath = "/readyz" + // DefaultAPIServerHealthCheckIntervalSec the API server health check interval in seconds. + DefaultAPIServerHealthCheckIntervalSec = 10 + // DefaultAPIServerHealthCheckTimeoutSec the API server health check timeout in seconds. + DefaultAPIServerHealthCheckTimeoutSec = 5 + // DefaultAPIServerHealthThresholdCount the API server health check threshold count. + DefaultAPIServerHealthThresholdCount = 5 + // DefaultAPIServerUnhealthThresholdCount the API server unhealthy check threshold count. + DefaultAPIServerUnhealthThresholdCount = 3 + + // ZoneTypeAvailabilityZone defines the regular AWS zones in the Region. + ZoneTypeAvailabilityZone ZoneType = "availability-zone" + // ZoneTypeLocalZone defines the AWS zone type in Local Zone infrastructure. + ZoneTypeLocalZone ZoneType = "local-zone" + // ZoneTypeWavelengthZone defines the AWS zone type in Wavelength infrastructure. + ZoneTypeWavelengthZone ZoneType = "wavelength-zone" +) + +// NetworkStatus encapsulates AWS networking resources. +type NetworkStatus struct { + // SecurityGroups is a map from the role/kind of the security group to its unique name, if any. + SecurityGroups map[SecurityGroupRole]SecurityGroup `json:"securityGroups,omitempty"` + + // APIServerELB is the Kubernetes api server load balancer. + APIServerELB LoadBalancer `json:"apiServerElb,omitempty"` + + // SecondaryAPIServerELB is the secondary Kubernetes api server load balancer. + SecondaryAPIServerELB LoadBalancer `json:"secondaryAPIServerELB,omitempty"` + + // NatGatewaysIPs contains the public IPs of the NAT Gateways + NatGatewaysIPs []string `json:"natGatewaysIPs,omitempty"` +} + +// ELBScheme defines the scheme of a load balancer. +type ELBScheme string + +var ( + // ELBSchemeInternetFacing defines an internet-facing, publicly + // accessible AWS ELB scheme. + ELBSchemeInternetFacing = ELBScheme("internet-facing") + + // ELBSchemeInternal defines an internal-only facing + // load balancer internal to an ELB. + ELBSchemeInternal = ELBScheme("internal") +) + +func (e ELBScheme) String() string { + return string(e) +} + +// Equals returns true if two ELBScheme are equal. +func (e ELBScheme) Equals(other *ELBScheme) bool { + if other == nil { + return false + } + + return e == *other +} + +// ELBProtocol defines listener protocols for a load balancer. +type ELBProtocol string + +func (e ELBProtocol) String() string { + return string(e) +} + +var ( + // ELBProtocolTCP defines the ELB API string representing the TCP protocol. + ELBProtocolTCP = ELBProtocol("TCP") + // ELBProtocolSSL defines the ELB API string representing the TLS protocol. + ELBProtocolSSL = ELBProtocol("SSL") + // ELBProtocolHTTP defines the ELB API string representing the HTTP protocol at L7. + ELBProtocolHTTP = ELBProtocol("HTTP") + // ELBProtocolHTTPS defines the ELB API string representing the HTTP protocol at L7. + ELBProtocolHTTPS = ELBProtocol("HTTPS") + // ELBProtocolTLS defines the NLB API string representing the TLS protocol. + ELBProtocolTLS = ELBProtocol("TLS") + // ELBProtocolUDP defines the NLB API string representing the UDP protocol. + ELBProtocolUDP = ELBProtocol("UDP") +) + +// TargetGroupHealthCheck defines health check settings for the target group. +type TargetGroupHealthCheck struct { + Protocol *string `json:"protocol,omitempty"` + Path *string `json:"path,omitempty"` + Port *string `json:"port,omitempty"` + IntervalSeconds *int64 `json:"intervalSeconds,omitempty"` + TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` + ThresholdCount *int64 `json:"thresholdCount,omitempty"` + UnhealthyThresholdCount *int64 `json:"unhealthyThresholdCount,omitempty"` +} + +// TargetGroupHealthCheckAPISpec defines the optional health check settings for the API target group. +type TargetGroupHealthCheckAPISpec struct { + // The approximate amount of time, in seconds, between health checks of an individual + // target. + // +kubebuilder:validation:Minimum=5 + // +kubebuilder:validation:Maximum=300 + // +optional + IntervalSeconds *int64 `json:"intervalSeconds,omitempty"` + + // The amount of time, in seconds, during which no response from a target means + // a failed health check. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=120 + // +optional + TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` + + // The number of consecutive health check successes required before considering + // a target healthy. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=10 + // +optional + ThresholdCount *int64 `json:"thresholdCount,omitempty"` + + // The number of consecutive health check failures required before considering + // a target unhealthy. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=10 + // +optional + UnhealthyThresholdCount *int64 `json:"unhealthyThresholdCount,omitempty"` +} + +// TargetGroupHealthCheckAdditionalSpec defines the optional health check settings for the additional target groups. +type TargetGroupHealthCheckAdditionalSpec struct { + // The protocol to use to health check connect with the target. When not specified the Protocol + // will be the same of the listener. + // +kubebuilder:validation:Enum=TCP;HTTP;HTTPS + // +optional + Protocol *string `json:"protocol,omitempty"` + + // The port the load balancer uses when performing health checks for additional target groups. When + // not specified this value will be set for the same of listener port. + // +optional + Port *string `json:"port,omitempty"` + + // The destination for health checks on the targets when using the protocol HTTP or HTTPS, + // otherwise the path will be ignored. + // +optional + Path *string `json:"path,omitempty"` + // The approximate amount of time, in seconds, between health checks of an individual + // target. + // +kubebuilder:validation:Minimum=5 + // +kubebuilder:validation:Maximum=300 + // +optional + IntervalSeconds *int64 `json:"intervalSeconds,omitempty"` + + // The amount of time, in seconds, during which no response from a target means + // a failed health check. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=120 + // +optional + TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` + + // The number of consecutive health check successes required before considering + // a target healthy. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=10 + // +optional + ThresholdCount *int64 `json:"thresholdCount,omitempty"` + + // The number of consecutive health check failures required before considering + // a target unhealthy. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=10 + // +optional + UnhealthyThresholdCount *int64 `json:"unhealthyThresholdCount,omitempty"` +} + +// TargetGroupAttribute defines attribute key values for V2 Load Balancer Attributes. +type TargetGroupAttribute string + +var ( + // TargetGroupAttributeEnablePreserveClientIP defines the attribute key for enabling preserve client IP. + TargetGroupAttributeEnablePreserveClientIP = "preserve_client_ip.enabled" + + // TargetGroupAttributeEnableConnectionTermination defines the attribute key for terminating + // established connections to unhealthy targets. + TargetGroupAttributeEnableConnectionTermination = "target_health_state.unhealthy.connection_termination.enabled" + + // TargetGroupAttributeUnhealthyDrainingIntervalSeconds defines the attribute key for the + // unhealthy target connection draining interval. + TargetGroupAttributeUnhealthyDrainingIntervalSeconds = "target_health_state.unhealthy.draining_interval_seconds" +) + +// LoadBalancerAttribute defines a set of attributes for a V2 load balancer. +type LoadBalancerAttribute string + +var ( + // LoadBalancerAttributeEnableLoadBalancingCrossZone defines the attribute key for enabling load balancing cross zone. + LoadBalancerAttributeEnableLoadBalancingCrossZone = "load_balancing.cross_zone.enabled" + // LoadBalancerAttributeIdleTimeTimeoutSeconds defines the attribute key for idle timeout. + LoadBalancerAttributeIdleTimeTimeoutSeconds = "idle_timeout.timeout_seconds" + // LoadBalancerAttributeIdleTimeDefaultTimeoutSecondsInSeconds defines the default idle timeout in seconds. + LoadBalancerAttributeIdleTimeDefaultTimeoutSecondsInSeconds = "60" +) + +// TargetGroupSpec specifies target group settings for a given listener. +// This is created first, and the ARN is then passed to the listener. +type TargetGroupSpec struct { + // Name of the TargetGroup. Must be unique over the same group of listeners. + // +kubebuilder:validation:MaxLength=32 + Name string `json:"name"` + // Port is the exposed port + Port int64 `json:"port"` + // +kubebuilder:validation:Enum=tcp;tls;udp;TCP;TLS;UDP + Protocol ELBProtocol `json:"protocol"` + VpcID string `json:"vpcId"` + // HealthCheck is the elb health check associated with the load balancer. + HealthCheck *TargetGroupHealthCheck `json:"targetGroupHealthCheck,omitempty"` +} + +// Listener defines an AWS network load balancer listener. +type Listener struct { + Protocol ELBProtocol `json:"protocol"` + Port int64 `json:"port"` + TargetGroup TargetGroupSpec `json:"targetGroup"` +} + +// LoadBalancer defines an AWS load balancer. +type LoadBalancer struct { + // ARN of the load balancer. Unlike the ClassicLB, ARN is used mostly + // to define and get it. + ARN string `json:"arn,omitempty"` + // The name of the load balancer. It must be unique within the set of load balancers + // defined in the region. It also serves as identifier. + // +optional + Name string `json:"name,omitempty"` + + // DNSName is the dns name of the load balancer. + DNSName string `json:"dnsName,omitempty"` + + // Scheme is the load balancer scheme, either internet-facing or private. + Scheme ELBScheme `json:"scheme,omitempty"` + + // AvailabilityZones is an array of availability zones in the VPC attached to the load balancer. + AvailabilityZones []string `json:"availabilityZones,omitempty"` + + // SubnetIDs is an array of subnets in the VPC attached to the load balancer. + SubnetIDs []string `json:"subnetIds,omitempty"` + + // SecurityGroupIDs is an array of security groups assigned to the load balancer. + SecurityGroupIDs []string `json:"securityGroupIds,omitempty"` + + // ClassicELBListeners is an array of classic elb listeners associated with the load balancer. There must be at least one. + ClassicELBListeners []ClassicELBListener `json:"listeners,omitempty"` + + // HealthCheck is the classic elb health check associated with the load balancer. + HealthCheck *ClassicELBHealthCheck `json:"healthChecks,omitempty"` + + // ClassicElbAttributes defines extra attributes associated with the load balancer. + ClassicElbAttributes ClassicELBAttributes `json:"attributes,omitempty"` + + // Tags is a map of tags associated with the load balancer. + Tags map[string]string `json:"tags,omitempty"` + + // ELBListeners is an array of listeners associated with the load balancer. There must be at least one. + ELBListeners []Listener `json:"elbListeners,omitempty"` + + // ELBAttributes defines extra attributes associated with v2 load balancers. + ELBAttributes map[string]*string `json:"elbAttributes,omitempty"` + + // LoadBalancerType sets the type for a load balancer. The default type is classic. + // +kubebuilder:validation:Enum:=classic;elb;alb;nlb + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` +} + +// IsUnmanaged returns true if the Classic ELB is unmanaged. +func (b *LoadBalancer) IsUnmanaged(clusterName string) bool { + return b.Name != "" && !Tags(b.Tags).HasOwned(clusterName) +} + +// IsManaged returns true if Classic ELB is managed. +func (b *LoadBalancer) IsManaged(clusterName string) bool { + return !b.IsUnmanaged(clusterName) +} + +// ClassicELBAttributes defines extra attributes associated with a classic load balancer. +type ClassicELBAttributes struct { + // IdleTimeout is time that the connection is allowed to be idle (no data + // has been sent over the connection) before it is closed by the load balancer. + IdleTimeout time.Duration `json:"idleTimeout,omitempty"` + + // CrossZoneLoadBalancing enables the classic load balancer load balancing. + // +optional + CrossZoneLoadBalancing bool `json:"crossZoneLoadBalancing,omitempty"` +} + +// ClassicELBListener defines an AWS classic load balancer listener. +type ClassicELBListener struct { + Protocol ELBProtocol `json:"protocol"` + Port int64 `json:"port"` + InstanceProtocol ELBProtocol `json:"instanceProtocol"` + InstancePort int64 `json:"instancePort"` +} + +// ClassicELBHealthCheck defines an AWS classic load balancer health check. +type ClassicELBHealthCheck struct { + Target string `json:"target"` + Interval time.Duration `json:"interval"` + Timeout time.Duration `json:"timeout"` + HealthyThreshold int64 `json:"healthyThreshold"` + UnhealthyThreshold int64 `json:"unhealthyThreshold"` +} + +// NetworkSpec encapsulates all things related to AWS network. +type NetworkSpec struct { + // VPC configuration. + // +optional + VPC VPCSpec `json:"vpc,omitempty"` + + // Subnets configuration. + // +optional + Subnets Subnets `json:"subnets,omitempty"` + + // CNI configuration + // +optional + CNI *CNISpec `json:"cni,omitempty"` + + // SecurityGroupOverrides is an optional set of security groups to use for cluster instances + // This is optional - if not provided new security groups will be created for the cluster + // +optional + SecurityGroupOverrides map[SecurityGroupRole]string `json:"securityGroupOverrides,omitempty"` + + // AdditionalControlPlaneIngressRules is an optional set of ingress rules to add to the control plane + // +optional + AdditionalControlPlaneIngressRules []IngressRule `json:"additionalControlPlaneIngressRules,omitempty"` + + // AdditionalNodeIngressRules is an optional set of ingress rules to add to every node + // +optional + AdditionalNodeIngressRules []IngressRule `json:"additionalNodeIngressRules,omitempty"` + + // NodePortIngressRuleCidrBlocks is an optional set of CIDR blocks to allow traffic to nodes' NodePort services. + // If none are specified here, all IPs are allowed to connect. + // +optional + NodePortIngressRuleCidrBlocks []string `json:"nodePortIngressRuleCidrBlocks,omitempty"` +} + +// IPv6 contains ipv6 specific settings for the network. +type IPv6 struct { + // CidrBlock is the CIDR block provided by Amazon when VPC has enabled IPv6. + // Mutually exclusive with IPAMPool. + // +optional + CidrBlock string `json:"cidrBlock,omitempty"` + + // PoolID is the IP pool which must be defined in case of BYO IP is defined. + // Must be specified if CidrBlock is set. + // Mutually exclusive with IPAMPool. + // +optional + PoolID string `json:"poolId,omitempty"` + + // EgressOnlyInternetGatewayID is the id of the egress only internet gateway associated with an IPv6 enabled VPC. + // +optional + EgressOnlyInternetGatewayID *string `json:"egressOnlyInternetGatewayId,omitempty"` + + // IPAMPool defines the IPAMv6 pool to be used for VPC. + // Mutually exclusive with CidrBlock. + // +optional + IPAMPool *IPAMPool `json:"ipamPool,omitempty"` +} + +// IPAMPool defines the IPAM pool to be used for VPC. +type IPAMPool struct { + // ID is the ID of the IPAM pool this provider should use to create VPC. + ID string `json:"id,omitempty"` + // Name is the name of the IPAM pool this provider should use to create VPC. + Name string `json:"name,omitempty"` + // The netmask length of the IPv4 CIDR you want to allocate to VPC from + // an Amazon VPC IP Address Manager (IPAM) pool. + // Defaults to /16 for IPv4 if not specified. + NetmaskLength int64 `json:"netmaskLength,omitempty"` +} + +// VpcCidrBlock defines the CIDR block and settings to associate with the managed VPC. Currently, only IPv4 is supported. +type VpcCidrBlock struct { + // IPv4CidrBlock is the IPv4 CIDR block to associate with the managed VPC. + // +kubebuilder:validation:MinLength=1 + IPv4CidrBlock string `json:"ipv4CidrBlock"` +} + +// VPCSpec configures an AWS VPC. +type VPCSpec struct { + // ID is the vpc-id of the VPC this provider should use to create resources. + ID string `json:"id,omitempty"` + + // CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + // Defaults to 10.0.0.0/16. + // Mutually exclusive with IPAMPool. + CidrBlock string `json:"cidrBlock,omitempty"` + + // SecondaryCidrBlocks are additional CIDR blocks to be associated when the provider creates a managed VPC. + // Defaults to none. Mutually exclusive with IPAMPool. This makes sense to use if, for example, you want to use + // a separate IP range for pods (e.g. Cilium ENI mode). + // +optional + SecondaryCidrBlocks []VpcCidrBlock `json:"secondaryCidrBlocks,omitempty"` + + // IPAMPool defines the IPAMv4 pool to be used for VPC. + // Mutually exclusive with CidrBlock. + IPAMPool *IPAMPool `json:"ipamPool,omitempty"` + + // IPv6 contains ipv6 specific settings for the network. Supported only in managed clusters. + // This field cannot be set on AWSCluster object. + // +optional + IPv6 *IPv6 `json:"ipv6,omitempty"` + + // InternetGatewayID is the id of the internet gateway associated with the VPC. + // +optional + InternetGatewayID *string `json:"internetGatewayId,omitempty"` + + // CarrierGatewayID is the id of the internet gateway associated with the VPC, + // for carrier network (Wavelength Zones). + // +optional + // +kubebuilder:validation:XValidation:rule="self.startsWith('cagw-')",message="Carrier Gateway ID must start with 'cagw-'" + CarrierGatewayID *string `json:"carrierGatewayId,omitempty"` + + // Tags is a collection of tags describing the resource. + Tags Tags `json:"tags,omitempty"` + + // AvailabilityZoneUsageLimit specifies the maximum number of availability zones (AZ) that + // should be used in a region when automatically creating subnets. If a region has more + // than this number of AZs then this number of AZs will be picked randomly when creating + // default subnets. Defaults to 3 + // +kubebuilder:default=3 + // +kubebuilder:validation:Minimum=1 + AvailabilityZoneUsageLimit *int `json:"availabilityZoneUsageLimit,omitempty"` + + // AvailabilityZoneSelection specifies how AZs should be selected if there are more AZs + // in a region than specified by AvailabilityZoneUsageLimit. There are 2 selection schemes: + // Ordered - selects based on alphabetical order + // Random - selects AZs randomly in a region + // Defaults to Ordered + // +kubebuilder:default=Ordered + // +kubebuilder:validation:Enum=Ordered;Random + AvailabilityZoneSelection *AZSelectionScheme `json:"availabilityZoneSelection,omitempty"` + + // EmptyRoutesDefaultVPCSecurityGroup specifies whether the default VPC security group ingress + // and egress rules should be removed. + // + // By default, when creating a VPC, AWS creates a security group called `default` with ingress and egress + // rules that allow traffic from anywhere. The group could be used as a potential surface attack and + // it's generally suggested that the group rules are removed or modified appropriately. + // + // NOTE: This only applies when the VPC is managed by the Cluster API AWS controller. + // + // +optional + EmptyRoutesDefaultVPCSecurityGroup bool `json:"emptyRoutesDefaultVPCSecurityGroup,omitempty"` + + // PrivateDNSHostnameTypeOnLaunch is the type of hostname to assign to instances in the subnet at launch. + // For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) + // or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name). + // +optional + // +kubebuilder:validation:Enum:=ip-name;resource-name + PrivateDNSHostnameTypeOnLaunch *string `json:"privateDnsHostnameTypeOnLaunch,omitempty"` + + // ElasticIPPool contains specific configuration to allocate Public IPv4 address (Elastic IP) from user-defined pool + // brought to AWS for core infrastructure resources, like NAT Gateways and Public Network Load Balancers for + // the API Server. + // +optional + ElasticIPPool *ElasticIPPool `json:"elasticIpPool,omitempty"` + + // SubnetSchema specifies how CidrBlock should be divided on subnets in the VPC depending on the number of AZs. + // PreferPrivate - one private subnet for each AZ plus one other subnet that will be further sub-divided for the public subnets. + // PreferPublic - have the reverse logic of PreferPrivate, one public subnet for each AZ plus one other subnet + // that will be further sub-divided for the private subnets. + // Defaults to PreferPrivate + // +optional + // +kubebuilder:default=PreferPrivate + // +kubebuilder:validation:Enum=PreferPrivate;PreferPublic + SubnetSchema *SubnetSchemaType `json:"subnetSchema,omitempty"` +} + +// String returns a string representation of the VPC. +func (v *VPCSpec) String() string { + return fmt.Sprintf("id=%s", v.ID) +} + +// IsUnmanaged returns true if the VPC is unmanaged. +func (v *VPCSpec) IsUnmanaged(clusterName string) bool { + return v.ID != "" && !v.Tags.HasOwned(clusterName) +} + +// IsManaged returns true if VPC is managed. +func (v *VPCSpec) IsManaged(clusterName string) bool { + return !v.IsUnmanaged(clusterName) +} + +// IsIPv6Enabled returns true if the IPv6 block is defined on the network spec. +func (v *VPCSpec) IsIPv6Enabled() bool { + return v.IPv6 != nil +} + +// GetElasticIPPool returns the custom Elastic IP Pool configuration when present. +func (v *VPCSpec) GetElasticIPPool() *ElasticIPPool { + return v.ElasticIPPool +} + +// GetPublicIpv4Pool returns the custom public IPv4 pool brought to AWS when present. +func (v *VPCSpec) GetPublicIpv4Pool() *string { + if v.ElasticIPPool == nil { + return nil + } + if v.ElasticIPPool.PublicIpv4Pool != nil { + return v.ElasticIPPool.PublicIpv4Pool + } + return nil +} + +// SubnetSpec configures an AWS Subnet. +type SubnetSpec struct { + // ID defines a unique identifier to reference this resource. + // If you're bringing your subnet, set the AWS subnet-id here, it must start with `subnet-`. + // + // When the VPC is managed by CAPA, and you'd like the provider to create a subnet for you, + // the id can be set to any placeholder value that does not start with `subnet-`; + // upon creation, the subnet AWS identifier will be populated in the `ResourceID` field and + // the `id` field is going to be used as the subnet name. If you specify a tag + // called `Name`, it takes precedence. + ID string `json:"id"` + + // ResourceID is the subnet identifier from AWS, READ ONLY. + // This field is populated when the provider manages the subnet. + // +optional + ResourceID string `json:"resourceID,omitempty"` + + // CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + CidrBlock string `json:"cidrBlock,omitempty"` + + // IPv6CidrBlock is the IPv6 CIDR block to be used when the provider creates a managed VPC. + // A subnet can have an IPv4 and an IPv6 address. + // IPv6 is only supported in managed clusters, this field cannot be set on AWSCluster object. + // +optional + IPv6CidrBlock string `json:"ipv6CidrBlock,omitempty"` + + // AvailabilityZone defines the availability zone to use for this subnet in the cluster's region. + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // IsPublic defines the subnet as a public subnet. A subnet is public when it is associated with a route table that has a route to an internet gateway. + // +optional + IsPublic bool `json:"isPublic"` + + // IsIPv6 defines the subnet as an IPv6 subnet. A subnet is IPv6 when it is associated with a VPC that has IPv6 enabled. + // IPv6 is only supported in managed clusters, this field cannot be set on AWSCluster object. + // +optional + IsIPv6 bool `json:"isIpv6,omitempty"` + + // RouteTableID is the routing table id associated with the subnet. + // +optional + RouteTableID *string `json:"routeTableId,omitempty"` + + // NatGatewayID is the NAT gateway id associated with the subnet. + // Ignored unless the subnet is managed by the provider, in which case this is set on the public subnet where the NAT gateway resides. It is then used to determine routes for private subnets in the same AZ as the public subnet. + // +optional + NatGatewayID *string `json:"natGatewayId,omitempty"` + + // Tags is a collection of tags describing the resource. + Tags Tags `json:"tags,omitempty"` + + // ZoneType defines the type of the zone where the subnet is created. + // + // The valid values are availability-zone, local-zone, and wavelength-zone. + // + // Subnet with zone type availability-zone (regular) is always selected to create cluster + // resources, like Load Balancers, NAT Gateways, Contol Plane nodes, etc. + // + // Subnet with zone type local-zone or wavelength-zone is not eligible to automatically create + // regular cluster resources. + // + // The public subnet in availability-zone or local-zone is associated with regular public + // route table with default route entry to a Internet Gateway. + // + // The public subnet in wavelength-zone is associated with a carrier public + // route table with default route entry to a Carrier Gateway. + // + // The private subnet in the availability-zone is associated with a private route table with + // the default route entry to a NAT Gateway created in that zone. + // + // The private subnet in the local-zone or wavelength-zone is associated with a private route table with + // the default route entry re-using the NAT Gateway in the Region (preferred from the + // parent zone, the zone type availability-zone in the region, or first table available). + // + // +kubebuilder:validation:Enum=availability-zone;local-zone;wavelength-zone + // +optional + ZoneType *ZoneType `json:"zoneType,omitempty"` + + // ParentZoneName is the zone name where the current subnet's zone is tied when + // the zone is a Local Zone. + // + // The subnets in Local Zone or Wavelength Zone locations consume the ParentZoneName + // to select the correct private route table to egress traffic to the internet. + // + // +optional + ParentZoneName *string `json:"parentZoneName,omitempty"` +} + +// GetResourceID returns the identifier for this subnet, +// if the subnet was not created or reconciled, it returns the subnet ID. +func (s *SubnetSpec) GetResourceID() string { + if s.ResourceID != "" { + return s.ResourceID + } + return s.ID +} + +// String returns a string representation of the subnet. +func (s *SubnetSpec) String() string { + return fmt.Sprintf("id=%s/az=%s/public=%v", s.GetResourceID(), s.AvailabilityZone, s.IsPublic) +} + +// IsEdge returns the true when the subnet is created in the edge zone, +// Local Zones. +func (s *SubnetSpec) IsEdge() bool { + if s.ZoneType == nil { + return false + } + if s.ZoneType.Equal(ZoneTypeLocalZone) { + return true + } + if s.ZoneType.Equal(ZoneTypeWavelengthZone) { + return true + } + return false +} + +// IsEdgeWavelength returns true only when the subnet is created in Wavelength Zone. +func (s *SubnetSpec) IsEdgeWavelength() bool { + if s.ZoneType == nil { + return false + } + if *s.ZoneType == ZoneTypeWavelengthZone { + return true + } + return false +} + +// SetZoneInfo updates the subnets with zone information. + +// Subnets is a slice of Subnet. +// +listType=map +// +listMapKey=id +type Subnets []SubnetSpec + +// ToMap returns a map from id to subnet. +func (s Subnets) ToMap() map[string]*SubnetSpec { + res := make(map[string]*SubnetSpec) + for i := range s { + x := s[i] + res[x.GetResourceID()] = &x + } + return res +} + +// IDs returns a slice of the subnet ids. +func (s Subnets) IDs() []string { + res := []string{} + for _, subnet := range s { + // Prevent returning edge zones (Local Zone) to regular Subnet IDs. + // Edge zones should not deploy control plane nodes, and does not support Nat Gateway and + // Network Load Balancers. Any resource for the core infrastructure should not consume edge + // zones. + if subnet.IsEdge() { + continue + } + res = append(res, subnet.GetResourceID()) + } + return res +} + +// IDsWithEdge returns a slice of the subnet ids. +func (s Subnets) IDsWithEdge() []string { + res := []string{} + for _, subnet := range s { + res = append(res, subnet.GetResourceID()) + } + return res +} + +// FindByID returns a single subnet matching the given id or nil. +// +// The returned pointer can be used to write back into the original slice. +func (s Subnets) FindByID(id string) *SubnetSpec { + for i := range s { + x := &(s[i]) // pointer to original structure + if x.GetResourceID() == id { + return x + } + } + return nil +} + +// FindEqual returns a subnet spec that is equal to the one passed in. +// Two subnets are defined equal to each other if their id is equal +// or if they are in the same vpc and the cidr block is the same. +// +// The returned pointer can be used to write back into the original slice. +func (s Subnets) FindEqual(spec *SubnetSpec) *SubnetSpec { + for i := range s { + x := &(s[i]) // pointer to original structure + if (spec.GetResourceID() != "" && x.GetResourceID() == spec.GetResourceID()) || + (spec.CidrBlock == x.CidrBlock) || + (spec.IPv6CidrBlock != "" && spec.IPv6CidrBlock == x.IPv6CidrBlock) { + return x + } + } + return nil +} + +// FilterPrivate returns a slice containing all subnets marked as private. +func (s Subnets) FilterPrivate() (res Subnets) { + for _, x := range s { + // Subnets in AWS Local Zones or Wavelength should not be used by core infrastructure. + if x.IsEdge() { + continue + } + if !x.IsPublic { + res = append(res, x) + } + } + return +} + +// FilterNonCni returns the subnets that are NOT intended for usage with the CNI pod network +// (i.e. do NOT have the `sigs.k8s.io/cluster-api-provider-aws/association=secondary` tag). +func (s Subnets) FilterNonCni() (res Subnets) { + for _, x := range s { + if x.Tags[NameAWSSubnetAssociation] != SecondarySubnetTagValue { + res = append(res, x) + } + } + return +} + +// FilterPublic returns a slice containing all subnets marked as public. +func (s Subnets) FilterPublic() (res Subnets) { + for _, x := range s { + // Subnets in AWS Local Zones or Wavelength should not be used by core infrastructure. + if x.IsEdge() { + continue + } + if x.IsPublic { + res = append(res, x) + } + } + return +} + +// FilterByZone returns a slice containing all subnets that live in the availability zone specified. +func (s Subnets) FilterByZone(zone string) (res Subnets) { + for _, x := range s { + if x.AvailabilityZone == zone { + res = append(res, x) + } + } + return +} + +// GetUniqueZones returns a slice containing the unique zones of the subnets. +func (s Subnets) GetUniqueZones() []string { + keys := make(map[string]bool) + zones := []string{} + for _, x := range s { + if _, value := keys[x.AvailabilityZone]; len(x.AvailabilityZone) > 0 && !value { + keys[x.AvailabilityZone] = true + zones = append(zones, x.AvailabilityZone) + } + } + return zones +} + +// SetZoneInfo updates the subnets with zone information. + +// HasPublicSubnetWavelength returns true when there are subnets in Wavelength zone. +func (s Subnets) HasPublicSubnetWavelength() bool { + for _, sub := range s { + if sub.ZoneType == nil { + return false + } + if sub.IsPublic && *sub.ZoneType == ZoneTypeWavelengthZone { + return true + } + } + return false +} + +// CNISpec defines configuration for CNI. +type CNISpec struct { + // CNIIngressRules specify rules to apply to control plane and worker node security groups. + // The source for the rule will be set to control plane and worker security group IDs. + CNIIngressRules CNIIngressRules `json:"cniIngressRules,omitempty"` +} + +// CNIIngressRules is a slice of CNIIngressRule. +type CNIIngressRules []CNIIngressRule + +// CNIIngressRule defines an AWS ingress rule for CNI requirements. +type CNIIngressRule struct { + Description string `json:"description"` + Protocol SecurityGroupProtocol `json:"protocol"` + FromPort int64 `json:"fromPort"` + ToPort int64 `json:"toPort"` +} + +// RouteTable defines an AWS routing table. +type RouteTable struct { + ID string `json:"id"` +} + +// SecurityGroupRole defines the unique role of a security group. +// +kubebuilder:validation:Enum=bastion;node;controlplane;apiserver-lb;lb;node-eks-additional +type SecurityGroupRole string + +var ( + // SecurityGroupBastion defines an SSH bastion role. + SecurityGroupBastion = SecurityGroupRole("bastion") + + // SecurityGroupNode defines a Kubernetes workload node role. + SecurityGroupNode = SecurityGroupRole("node") + + // SecurityGroupEKSNodeAdditional defines an extra node group from eks nodes. + SecurityGroupEKSNodeAdditional = SecurityGroupRole("node-eks-additional") + + // SecurityGroupControlPlane defines a Kubernetes control plane node role. + SecurityGroupControlPlane = SecurityGroupRole("controlplane") + + // SecurityGroupAPIServerLB defines a Kubernetes API Server Load Balancer role. + SecurityGroupAPIServerLB = SecurityGroupRole("apiserver-lb") + + // SecurityGroupLB defines a container for the cloud provider to inject its load balancer ingress rules. + SecurityGroupLB = SecurityGroupRole("lb") +) + +// SecurityGroup defines an AWS security group. +type SecurityGroup struct { + // ID is a unique identifier. + ID string `json:"id"` + + // Name is the security group name. + Name string `json:"name"` + + // IngressRules is the inbound rules associated with the security group. + // +optional + IngressRules IngressRules `json:"ingressRule,omitempty"` + + // Tags is a map of tags associated with the security group. + Tags Tags `json:"tags,omitempty"` +} + +// String returns a string representation of the security group. +func (s *SecurityGroup) String() string { + return fmt.Sprintf("id=%s/name=%s", s.ID, s.Name) +} + +// SecurityGroupProtocol defines the protocol type for a security group rule. +type SecurityGroupProtocol string + +var ( + // SecurityGroupProtocolAll is a wildcard for all IP protocols. + SecurityGroupProtocolAll = SecurityGroupProtocol("-1") + + // SecurityGroupProtocolIPinIP represents the IP in IP protocol in ingress rules. + SecurityGroupProtocolIPinIP = SecurityGroupProtocol("4") + + // SecurityGroupProtocolTCP represents the TCP protocol in ingress rules. + SecurityGroupProtocolTCP = SecurityGroupProtocol("tcp") + + // SecurityGroupProtocolUDP represents the UDP protocol in ingress rules. + SecurityGroupProtocolUDP = SecurityGroupProtocol("udp") + + // SecurityGroupProtocolICMP represents the ICMP protocol in ingress rules. + SecurityGroupProtocolICMP = SecurityGroupProtocol("icmp") + + // SecurityGroupProtocolICMPv6 represents the ICMPv6 protocol in ingress rules. + SecurityGroupProtocolICMPv6 = SecurityGroupProtocol("58") + + // SecurityGroupProtocolESP represents the ESP protocol in ingress rules. + SecurityGroupProtocolESP = SecurityGroupProtocol("50") +) + +// IngressRule defines an AWS ingress rule for security groups. +type IngressRule struct { + // Description provides extended information about the ingress rule. + Description string `json:"description"` + // Protocol is the protocol for the ingress rule. Accepted values are "-1" (all), "4" (IP in IP),"tcp", "udp", "icmp", and "58" (ICMPv6), "50" (ESP). + // +kubebuilder:validation:Enum="-1";"4";tcp;udp;icmp;"58";"50" + Protocol SecurityGroupProtocol `json:"protocol"` + // FromPort is the start of port range. + FromPort int64 `json:"fromPort"` + // ToPort is the end of port range. + ToPort int64 `json:"toPort"` + + // List of CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID. + // +optional + CidrBlocks []string `json:"cidrBlocks,omitempty"` + + // List of IPv6 CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID. + // +optional + IPv6CidrBlocks []string `json:"ipv6CidrBlocks,omitempty"` + + // The security group id to allow access from. Cannot be specified with CidrBlocks. + // +optional + SourceSecurityGroupIDs []string `json:"sourceSecurityGroupIds,omitempty"` + + // The security group role to allow access from. Cannot be specified with CidrBlocks. + // The field will be combined with source security group IDs if specified. + // +optional + SourceSecurityGroupRoles []SecurityGroupRole `json:"sourceSecurityGroupRoles,omitempty"` + + // NatGatewaysIPsSource use the NAT gateways IPs as the source for the ingress rule. + // +optional + NatGatewaysIPsSource bool `json:"natGatewaysIPsSource,omitempty"` +} + +// String returns a string representation of the ingress rule. +func (i IngressRule) String() string { + return fmt.Sprintf("protocol=%s/range=[%d-%d]/description=%s", i.Protocol, i.FromPort, i.ToPort, i.Description) +} + +// IngressRules is a slice of AWS ingress rules for security groups. +type IngressRules []IngressRule + +// Difference returns the difference between this slice and the other slice. +func (i IngressRules) Difference(o IngressRules) (out IngressRules) { + for index := range i { + x := i[index] + found := false + for oIndex := range o { + y := o[oIndex] + if x.Equals(&y) { + found = true + break + } + } + + if !found { + out = append(out, x) + } + } + + return +} + +// Equals returns true if two IngressRule are equal. +func (i *IngressRule) Equals(o *IngressRule) bool { + // ipv4 + if len(i.CidrBlocks) != len(o.CidrBlocks) { + return false + } + + sort.Strings(i.CidrBlocks) + sort.Strings(o.CidrBlocks) + + for i, v := range i.CidrBlocks { + if v != o.CidrBlocks[i] { + return false + } + } + // ipv6 + if len(i.IPv6CidrBlocks) != len(o.IPv6CidrBlocks) { + return false + } + + sort.Strings(i.IPv6CidrBlocks) + sort.Strings(o.IPv6CidrBlocks) + + for i, v := range i.IPv6CidrBlocks { + if v != o.IPv6CidrBlocks[i] { + return false + } + } + + if len(i.SourceSecurityGroupIDs) != len(o.SourceSecurityGroupIDs) { + return false + } + + sort.Strings(i.SourceSecurityGroupIDs) + sort.Strings(o.SourceSecurityGroupIDs) + + for i, v := range i.SourceSecurityGroupIDs { + if v != o.SourceSecurityGroupIDs[i] { + return false + } + } + + if i.Description != o.Description || i.Protocol != o.Protocol { + return false + } + + // AWS seems to ignore the From/To port when set on protocols where it doesn't apply, but + // we avoid serializing it out for clarity's sake. + // See: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html + switch i.Protocol { + case SecurityGroupProtocolTCP, + SecurityGroupProtocolUDP, + SecurityGroupProtocolICMP, + SecurityGroupProtocolICMPv6: + return i.FromPort == o.FromPort && i.ToPort == o.ToPort + case SecurityGroupProtocolAll, SecurityGroupProtocolIPinIP, SecurityGroupProtocolESP: + // FromPort / ToPort are not applicable + } + + return true +} + +// ZoneType defines listener AWS Availability Zone type. +type ZoneType string + +// String returns the string representation for the zone type. +func (z ZoneType) String() string { + return string(z) +} + +// Equal compares two zone types. +func (z ZoneType) Equal(other ZoneType) bool { + return z == other +} + +// ElasticIPPool allows configuring a Elastic IP pool for resources allocating +// public IPv4 addresses on public subnets. +type ElasticIPPool struct { + // PublicIpv4Pool sets a custom Public IPv4 Pool used to create Elastic IP address for resources + // created in public IPv4 subnets. Every IPv4 address, Elastic IP, will be allocated from the custom + // Public IPv4 pool that you brought to AWS, instead of Amazon-provided pool. The public IPv4 pool + // resource ID starts with 'ipv4pool-ec2'. + // + // +kubebuilder:validation:MaxLength=30 + // +optional + PublicIpv4Pool *string `json:"publicIpv4Pool,omitempty"` + + // PublicIpv4PoolFallBackOrder defines the fallback action when the Public IPv4 Pool has been exhausted, + // no more IPv4 address available in the pool. + // + // When set to 'amazon-pool', the controller check if the pool has available IPv4 address, when pool has reached the + // IPv4 limit, the address will be claimed from Amazon-pool (default). + // + // When set to 'none', the controller will fail the Elastic IP allocation when the publicIpv4Pool is exhausted. + // + // +kubebuilder:validation:Enum:=amazon-pool;none + // +optional + PublicIpv4PoolFallBackOrder *PublicIpv4PoolFallbackOrder `json:"publicIpv4PoolFallbackOrder,omitempty"` + + // TODO(mtulio): add future support of user-defined Elastic IP to allow users to assign BYO Public IP from + // 'static'/preallocated amazon-provided IPsstrucute currently holds only 'BYO Public IP from Public IPv4 Pool' (user brought to AWS), + // although a dedicated structure would help to hold 'BYO Elastic IP' variants like: + // - AllocationIdPoolApiLoadBalancer: an user-defined (static) IP address to the Public API Load Balancer. + // - AllocationIdPoolNatGateways: an user-defined (static) IP address to allocate to NAT Gateways (egress traffic). +} + +// PublicIpv4PoolFallbackOrder defines the list of available fallback action when the PublicIpv4Pool is exhausted. +// 'none' let the controllers return failures when the PublicIpv4Pool is exhausted - no more IPv4 available. +// 'amazon-pool' let the controllers to skip the PublicIpv4Pool and use the Amazon pool, the default. +// +kubebuilder:validation:XValidation:rule="self in ['none','amazon-pool']",message="allowed values are 'none' and 'amazon-pool'" +type PublicIpv4PoolFallbackOrder string + +const ( + // PublicIpv4PoolFallbackOrderAmazonPool refers to use Amazon-pool Public IPv4 Pool as a fallback strategy. + PublicIpv4PoolFallbackOrderAmazonPool = PublicIpv4PoolFallbackOrder("amazon-pool") + + // PublicIpv4PoolFallbackOrderNone refers to not use any fallback strategy. + PublicIpv4PoolFallbackOrderNone = PublicIpv4PoolFallbackOrder("none") +) + +func (r PublicIpv4PoolFallbackOrder) String() string { + return string(r) +} + +// Equal compares PublicIpv4PoolFallbackOrder types and return true if input param is equal. +func (r PublicIpv4PoolFallbackOrder) Equal(e PublicIpv4PoolFallbackOrder) bool { + return r == e +} diff --git a/pkg/capi/aws/api/v1beta2/s3bucket.go b/pkg/capi/aws/api/v1beta2/s3bucket.go new file mode 100644 index 000000000000..9efef7baa3d3 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/s3bucket.go @@ -0,0 +1,40 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "net" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// Validate validates S3Bucket fields. + +// Feature gate is not enabled but ignition is enabled then send a forbidden error. + +// Validation rules taken from https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html. +func validateS3BucketName(name string) []*field.Error { + var errs field.ErrorList + + path := field.NewPath("spec", "s3Bucket", "name") + + if net.ParseIP(name) != nil { + errs = append(errs, field.Invalid(path, name, "must not be formatted as an IP address (for example, 192.168.5.4)")) + } + + return errs +} diff --git a/pkg/capi/aws/api/v1beta2/tags.go b/pkg/capi/aws/api/v1beta2/tags.go new file mode 100644 index 000000000000..764d06f73d0d --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/tags.go @@ -0,0 +1,275 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "fmt" + "regexp" + + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/validation/field" + + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// Tags defines a map of tags. +type Tags map[string]string + +// HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling. +func (t Tags) HasOwned(cluster string) bool { + value, ok := t[ClusterTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// HasAWSCloudProviderOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of the in-tree cloud provider. +func (t Tags) HasAWSCloudProviderOwned(cluster string) bool { + value, ok := t[ClusterAWSCloudProviderTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// GetRole returns the Cluster API role for the tagged resource. +func (t Tags) GetRole() string { + return t[NameAWSClusterAPIRole] +} + +// Difference returns the difference between this map of tags and the other map of tags. +// Items are considered equals if key and value are equals. +func (t Tags) Difference(other Tags) Tags { + res := make(Tags, len(t)) + + for key, value := range t { + if otherValue, ok := other[key]; ok && value == otherValue { + continue + } + res[key] = value + } + + return res +} + +// Merge merges in tags from other. If a tag already exists, it is replaced by the tag in other. +func (t Tags) Merge(other Tags) { + for k, v := range other { + t[k] = v + } +} + +// Validate checks if tags are valid for the AWS API/Resources. +// Keys must have at least 1 and max 128 characters. +// Values must be max 256 characters long. +// Keys and Values can only have alphabets, numbers, spaces and _ . : / = + - @ as characters. +// Tag's key cannot have prefix "aws:". +// Max count of User tags for a specific resource can be 50. +func (t Tags) Validate() []*field.Error { + // Defines the maximum number of user tags which can be created for a specific resource + const maxUserTagsAllowed = 50 + var errs field.ErrorList + userTagCount := len(t) + re := regexp.MustCompile(`^[a-zA-Z0-9\s\_\.\:\=\+\-\@\/]*$`) + + for k, v := range t { + if len(k) < 1 { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), k, "key cannot be empty"), + ) + } + if len(k) > 128 { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), k, "key cannot be longer than 128 characters"), + ) + } + if len(v) > 256 { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), v, "value cannot be longer than 256 characters"), + ) + } + if wrongUserTagNomenclature(k) { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), k, "user created tag's key cannot have prefix aws:"), + ) + } + val := re.MatchString(k) + if !val { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), k, "key cannot have characters other than alphabets, numbers, spaces and _ . : / = + - @ ."), + ) + } + val = re.MatchString(v) + if !val { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), v, "value cannot have characters other than alphabets, numbers, spaces and _ . : / = + - @ ."), + ) + } + } + + if userTagCount > maxUserTagsAllowed { + errs = append(errs, + field.Invalid(field.NewPath("spec", "additionalTags"), t, "user created tags cannot be more than 50"), + ) + } + + return errs +} + +// Checks whether the tag created is user tag or not. +func wrongUserTagNomenclature(k string) bool { + return len(k) > 3 && k[0:4] == "aws:" +} + +// ResourceLifecycle configures the lifecycle of a resource. +type ResourceLifecycle string + +const ( + // ResourceLifecycleOwned is the value we use when tagging resources to indicate + // that the resource is considered owned and managed by the cluster, + // and in particular that the lifecycle is tied to the lifecycle of the cluster. + ResourceLifecycleOwned = ResourceLifecycle("owned") + + // ResourceLifecycleShared is the value we use when tagging resources to indicate + // that the resource is shared between multiple clusters, and should not be destroyed + // if the cluster is destroyed. + ResourceLifecycleShared = ResourceLifecycle("shared") + + // NameKubernetesAWSCloudProviderPrefix is the tag name used by the cloud provider to logically + // separate independent cluster resources. We use it to identify which resources we expect + // to be permissive about state changes. + // logically independent clusters running in the same AZ. + // The tag key = NameKubernetesAWSCloudProviderPrefix + clusterID + // The tag value is an ownership value. + NameKubernetesAWSCloudProviderPrefix = "kubernetes.io/cluster/" + + // NameAWSProviderPrefix is the tag prefix we use to differentiate + // cluster-api-provider-aws owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAWSProviderPrefix = "sigs.k8s.io/cluster-api-provider-aws/" + + // NameAWSProviderOwned is the tag name we use to differentiate + // cluster-api-provider-aws owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAWSProviderOwned = NameAWSProviderPrefix + "cluster/" + + // NameAWSClusterAPIRole is the tag name we use to mark roles for resources + // dedicated to this cluster api provider implementation. + NameAWSClusterAPIRole = NameAWSProviderPrefix + "role" + + // NameAWSSubnetAssociation is the tag name we use to mark association for resources + // dedicated to this cluster api provider implementation. + NameAWSSubnetAssociation = NameAWSProviderPrefix + "association" + + // SecondarySubnetTagValue is the secondary subnet tag constant value. + SecondarySubnetTagValue = "secondary" + + // APIServerRoleTagValue describes the value for the apiserver role. + APIServerRoleTagValue = "apiserver" + + // BastionRoleTagValue describes the value for the bastion role. + BastionRoleTagValue = "bastion" + + // CommonRoleTagValue describes the value for the common role. + CommonRoleTagValue = "common" + + // PublicRoleTagValue describes the value for the public role. + PublicRoleTagValue = "public" + + // PrivateRoleTagValue describes the value for the private role. + PrivateRoleTagValue = "private" + + // MachineNameTagKey is the key for machine name. + MachineNameTagKey = "MachineName" + + // LaunchTemplateBootstrapDataSecret is the tag we use to store the `/` + // of the bootstrap secret that was used to create the user data for the latest launch + // template version. + LaunchTemplateBootstrapDataSecret = NameAWSProviderPrefix + "bootstrap-data-secret" + + // LaunchTemplateBootstrapDataHash is the tag we use to store the hash of the raw bootstrap data. + // If bootstrap data is stored in S3, this hash relates to that data, not to the EC2 instance + // user data which only references the S3 object. We store this tag on launch template versions + // so that S3 bootstrap data objects can be deleted when they get outdated. + LaunchTemplateBootstrapDataHash = NameAWSProviderPrefix + "bootstrap-data-hash" +) + +// ClusterTagKey generates the key for resources associated with a cluster. +func ClusterTagKey(name string) string { + return fmt.Sprintf("%s%s", NameAWSProviderOwned, name) +} + +// ClusterAWSCloudProviderTagKey generates the key for resources associated a cluster's AWS cloud provider. +func ClusterAWSCloudProviderTagKey(name string) string { + return fmt.Sprintf("%s%s", NameKubernetesAWSCloudProviderPrefix, name) +} + +// BuildParams is used to build tags around an aws resource. +type BuildParams struct { + // Lifecycle determines the resource lifecycle. + Lifecycle ResourceLifecycle + + // ClusterName is the cluster associated with the resource. + ClusterName string + + // ResourceID is the unique identifier of the resource to be tagged. + ResourceID string + + // Name is the name of the resource, it's applied as the tag "Name" on AWS. + // +optional + Name *string + + // Role is the role associated to the resource. + // +optional + Role *string + + // Any additional tags to be added to the resource. + // +optional + Additional Tags +} + +// WithMachineName tags the namespaced machine name +// The machine name will be tagged with key "MachineName". +func (b BuildParams) WithMachineName(m *clusterv1.Machine) BuildParams { + machineNamespacedName := types.NamespacedName{Namespace: m.Namespace, Name: m.Name} + b.Additional[MachineNameTagKey] = machineNamespacedName.String() + return b +} + +// WithCloudProvider tags the cluster ownership for a resource. +func (b BuildParams) WithCloudProvider(name string) BuildParams { + b.Additional[ClusterAWSCloudProviderTagKey(name)] = string(ResourceLifecycleOwned) + return b +} + +// Build builds tags including the cluster tag and returns them in map form. +func Build(params BuildParams) Tags { + tags := make(Tags) + + // Add the name tag first so that it can be overwritten by a user-provided tag in the `Additional` tags. + if params.Name != nil { + tags["Name"] = *params.Name + } + + for k, v := range params.Additional { + tags[k] = v + } + + if params.ClusterName != "" { + tags[ClusterTagKey(params.ClusterName)] = string(params.Lifecycle) + } + if params.Role != nil { + tags[NameAWSClusterAPIRole] = *params.Role + } + + return tags +} diff --git a/pkg/capi/aws/api/v1beta2/types.go b/pkg/capi/aws/api/v1beta2/types.go new file mode 100644 index 000000000000..81a3be6db35b --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/types.go @@ -0,0 +1,603 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "strings" + + "k8s.io/apimachinery/pkg/util/sets" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // PreventDeletionLabel can be used in situations where preventing delation is allowed. The docs + // and the CRD will call this out where its allowed. + PreventDeletionLabel = "aws.cluster.x-k8s.io/prevent-deletion" +) + +// AWSResourceReference is a reference to a specific AWS resource by ID or filters. +// Only one of ID or Filters may be specified. Specifying more than one will result in +// a validation error. +type AWSResourceReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // Filters is a set of key/value pairs used to identify a resource + // They are applied according to the rules defined by the AWS API: + // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html + // +optional + Filters []Filter `json:"filters,omitempty"` +} + +// AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. +// Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +// a validation error. +type AMIReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // EKSOptimizedLookupType If specified, will look up an EKS Optimized image in SSM Parameter store + // +kubebuilder:validation:Enum:=AmazonLinux;AmazonLinuxGPU;AmazonLinux2023;AmazonLinux2023GPU + // +optional + EKSOptimizedLookupType *EKSAMILookupType `json:"eksLookupType,omitempty"` +} + +// Filter is a filter used to identify an AWS resource. +type Filter struct { + // Name of the filter. Filter names are case-sensitive. + Name string `json:"name"` + + // Values includes one or more filter values. Filter values are case-sensitive. + Values []string `json:"values"` +} + +// AWSMachineProviderConditionType is a valid value for AWSMachineProviderCondition.Type. +type AWSMachineProviderConditionType string + +// Valid conditions for an AWS machine instance. +const ( + // MachineCreated indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreated AWSMachineProviderConditionType = "MachineCreated" +) + +const ( + // ExternalResourceGCAnnotation is the name of an annotation that indicates if + // external resources should be garbage collected for the cluster. + ExternalResourceGCAnnotation = "aws.cluster.x-k8s.io/external-resource-gc" + + // ExternalResourceGCTasksAnnotation is the name of an annotation that indicates what + // external resources tasks should be executed by garbage collector for the cluster. + ExternalResourceGCTasksAnnotation = "aws.cluster.x-k8s.io/external-resource-tasks-gc" +) + +// GCTask defines a task to be executed by the garbage collector. +type GCTask string + +var ( + // GCTaskLoadBalancer defines a task to cleaning up resources for AWS load balancers. + GCTaskLoadBalancer = GCTask("load-balancer") + + // GCTaskTargetGroup defines a task to cleaning up resources for AWS target groups. + GCTaskTargetGroup = GCTask("target-group") + + // GCTaskSecurityGroup defines a task to cleaning up resources for AWS security groups. + GCTaskSecurityGroup = GCTask("security-group") +) + +// AZSelectionScheme defines the scheme of selecting AZs. +type AZSelectionScheme string + +var ( + // AZSelectionSchemeOrdered will select AZs based on alphabetical order. + AZSelectionSchemeOrdered = AZSelectionScheme("Ordered") + + // AZSelectionSchemeRandom will select AZs randomly. + AZSelectionSchemeRandom = AZSelectionScheme("Random") +) + +// InstanceState describes the state of an AWS instance. +type InstanceState string + +var ( + // InstanceStatePending is the string representing an instance in a pending state. + InstanceStatePending = InstanceState("pending") + + // InstanceStateRunning is the string representing an instance in a running state. + InstanceStateRunning = InstanceState("running") + + // InstanceStateShuttingDown is the string representing an instance shutting down. + InstanceStateShuttingDown = InstanceState("shutting-down") + + // InstanceStateTerminated is the string representing an instance that has been terminated. + InstanceStateTerminated = InstanceState("terminated") + + // InstanceStateStopping is the string representing an instance + // that is in the process of being stopped and can be restarted. + InstanceStateStopping = InstanceState("stopping") + + // InstanceStateStopped is the string representing an instance + // that has been stopped and can be restarted. + InstanceStateStopped = InstanceState("stopped") + + // InstanceRunningStates defines the set of states in which an EC2 instance is + // running or going to be running soon. + InstanceRunningStates = sets.NewString( + string(InstanceStatePending), + string(InstanceStateRunning), + ) + + // InstanceOperationalStates defines the set of states in which an EC2 instance is + // or can return to running, and supports all EC2 operations. + InstanceOperationalStates = InstanceRunningStates.Union( + sets.NewString( + string(InstanceStateStopping), + string(InstanceStateStopped), + ), + ) + + // InstanceKnownStates represents all known EC2 instance states. + InstanceKnownStates = InstanceOperationalStates.Union( + sets.NewString( + string(InstanceStateShuttingDown), + string(InstanceStateTerminated), + ), + ) +) + +// Instance describes an AWS instance. +type Instance struct { + ID string `json:"id"` + + // The current state of the instance. + State InstanceState `json:"instanceState,omitempty"` + + // The instance type. + Type string `json:"type,omitempty"` + + // The ID of the subnet of the instance. + SubnetID string `json:"subnetId,omitempty"` + + // The ID of the AMI used to launch the instance. + ImageID string `json:"imageId,omitempty"` + + // The name of the SSH key pair. + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // SecurityGroupIDs are one or more security group IDs this instance belongs to. + SecurityGroupIDs []string `json:"securityGroupIds,omitempty"` + + // UserData is the raw data script passed to the instance which is run upon bootstrap. + // This field must not be base64 encoded and should only be used when running a new instance. + UserData *string `json:"userData,omitempty"` + + // The name of the IAM instance profile associated with the instance, if applicable. + IAMProfile string `json:"iamProfile,omitempty"` + + // Addresses contains the AWS instance associated addresses. + Addresses []clusterv1beta1.MachineAddress `json:"addresses,omitempty"` + + // The private IPv4 address assigned to the instance. + PrivateIP *string `json:"privateIp,omitempty"` + + // The public IPv4 address assigned to the instance, if applicable. + PublicIP *string `json:"publicIp,omitempty"` + + // Specifies whether enhanced networking with ENA is enabled. + ENASupport *bool `json:"enaSupport,omitempty"` + + // Indicates whether the instance is optimized for Amazon EBS I/O. + EBSOptimized *bool `json:"ebsOptimized,omitempty"` + + // Configuration options for the root storage volume. + // +optional + RootVolume *Volume `json:"rootVolume,omitempty"` + + // Configuration options for the non root storage volumes. + // +optional + NonRootVolumes []Volume `json:"nonRootVolumes,omitempty"` + + // Specifies ENIs attached to instance + NetworkInterfaces []string `json:"networkInterfaces,omitempty"` + + // NetworkInterfaceType is the interface type of the primary network Interface. + NetworkInterfaceType NetworkInterfaceType `json:"networkInterfaceType,omitempty"` + + // The tags associated with the instance. + Tags map[string]string `json:"tags,omitempty"` + + // Availability zone of instance + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // SpotMarketOptions option for configuring instances to be run using AWS Spot instances. + SpotMarketOptions *SpotMarketOptions `json:"spotMarketOptions,omitempty"` + + // PlacementGroupName specifies the name of the placement group in which to launch the instance. + // +optional + PlacementGroupName string `json:"placementGroupName,omitempty"` + + // PlacementGroupPartition is the partition number within the placement group in which to launch the instance. + // This value is only valid if the placement group, referred in `PlacementGroupName`, was created with + // strategy set to partition. + // +kubebuilder:validation:Minimum:=1 + // +kubebuilder:validation:Maximum:=7 + // +optional + PlacementGroupPartition int64 `json:"placementGroupPartition,omitempty"` + + // Tenancy indicates if instance should run on shared or single-tenant hardware. + // +optional + Tenancy string `json:"tenancy,omitempty"` + + // IDs of the instance's volumes + // +optional + VolumeIDs []string `json:"volumeIDs,omitempty"` + + // InstanceMetadataOptions is the metadata options for the EC2 instance. + // +optional + InstanceMetadataOptions *InstanceMetadataOptions `json:"instanceMetadataOptions,omitempty"` + + // PrivateDNSName is the options for the instance hostname. + // +optional + PrivateDNSName *PrivateDNSName `json:"privateDnsName,omitempty"` + + // PublicIPOnLaunch is the option to associate a public IP on instance launch + // +optional + PublicIPOnLaunch *bool `json:"publicIPOnLaunch,omitempty"` + + // CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched. + // +optional + CapacityReservationID *string `json:"capacityReservationId,omitempty"` + + // MarketType specifies the type of market for the EC2 instance. Valid values include: + // "OnDemand" (default): The instance runs as a standard OnDemand instance. + // "Spot": The instance runs as a Spot instance. When SpotMarketOptions is provided, the marketType defaults to "Spot". + // "CapacityBlock": The instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations. + // If this value is selected, CapacityReservationID must be specified to identify the target reservation. + // If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot". + // +optional + MarketType MarketType `json:"marketType,omitempty"` + + // HostAffinity specifies the dedicated host affinity setting for the instance. + // When hostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped. + // When hostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host. + // When HostAffinity is defined, HostID is required. + // +optional + // +kubebuilder:validation:Enum:=default;host + HostAffinity *string `json:"hostAffinity,omitempty"` + + // HostID specifies the dedicated host on which the instance should be started. + // +optional + HostID *string `json:"hostID,omitempty"` + + // DynamicHostAllocation enables automatic allocation of dedicated hosts. + // This field is mutually exclusive with HostID. + // +optional + DynamicHostAllocation *DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"` + + // CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include: + // "Open": The instance may make use of open Capacity Reservations that match its AZ and InstanceType + // "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads + // "CapacityReservationsOnly": The instance will only run if matched or targeted to a Capacity Reservation. Note that this is incompatible with a MarketType of `Spot` + // +kubebuilder:validation:Enum="";None;CapacityReservationsOnly;Open + // +optional + CapacityReservationPreference CapacityReservationPreference `json:"capacityReservationPreference,omitempty"` + + // CPUOptions defines CPU-related settings for the instance, including the confidential computing policy. + // When omitted, this means no opinion and the AWS platform is left to choose a reasonable default. + // +optional + CPUOptions CPUOptions `json:"cpuOptions,omitempty,omitzero"` +} + +// CapacityReservationPreference describes the preferred use of capacity reservations +// of an instance +// +kubebuilder:validation:Enum:="";None;CapacityReservationsOnly;Open +type CapacityReservationPreference string + +const ( + // CapacityReservationPreferenceNone the instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads + CapacityReservationPreferenceNone CapacityReservationPreference = "None" + + // CapacityReservationPreferenceOnly the instance will only run if matched or targeted to a Capacity Reservation. Note that this is incompatible with a MarketType of `Spot` + CapacityReservationPreferenceOnly CapacityReservationPreference = "CapacityReservationsOnly" + + // CapacityReservationPreferenceOpen the instance may make use of open Capacity Reservations that match its AZ and InstanceType. + CapacityReservationPreferenceOpen CapacityReservationPreference = "Open" +) + +// DedicatedHostInfo contains information about a dedicated host. +type DedicatedHostInfo struct { + // HostID is the ID of the dedicated host. + HostID string `json:"hostID"` + + // InstanceFamily is the instance family supported by the host. + InstanceFamily string `json:"instanceFamily"` + + // InstanceType is the instance type supported by the host. + InstanceType string `json:"instanceType"` + + // AvailabilityZone is the AZ where the host is located. + AvailabilityZone string `json:"availabilityZone"` + + // State is the current state of the dedicated host. + State string `json:"state"` + + // TotalCapacity is the total number of instances that can be launched on the host. + TotalCapacity int32 `json:"totalCapacity"` + + // AvailableCapacity is the number of instances that can still be launched on the host. + AvailableCapacity int32 `json:"availableCapacity"` + + // Tags associated with the dedicated host. + Tags map[string]string `json:"tags,omitempty"` +} + +// MarketType describes the market type of an Instance +// +kubebuilder:validation:Enum:=OnDemand;Spot;CapacityBlock +type MarketType string + +const ( + // MarketTypeOnDemand is a MarketType enum value + MarketTypeOnDemand MarketType = "OnDemand" + + // MarketTypeSpot is a MarketType enum value + MarketTypeSpot MarketType = "Spot" + + // MarketTypeCapacityBlock is a MarketType enum value + MarketTypeCapacityBlock MarketType = "CapacityBlock" +) + +// InstanceMetadataState describes the state of InstanceMetadataOptions.HttpEndpoint and InstanceMetadataOptions.InstanceMetadataTags +type InstanceMetadataState string + +const ( + // InstanceMetadataEndpointStateDisabled represents the disabled state + InstanceMetadataEndpointStateDisabled = InstanceMetadataState("disabled") + + // InstanceMetadataEndpointStateEnabled represents the enabled state + InstanceMetadataEndpointStateEnabled = InstanceMetadataState("enabled") +) + +// HTTPTokensState describes the state of InstanceMetadataOptions.HTTPTokensState +type HTTPTokensState string + +const ( + // HTTPTokensStateOptional represents the optional state + HTTPTokensStateOptional = HTTPTokensState("optional") + + // HTTPTokensStateRequired represents the required state (IMDSv2) + HTTPTokensStateRequired = HTTPTokensState("required") +) + +// InstanceMetadataOptions describes metadata options for the EC2 instance. +type InstanceMetadataOptions struct { + // Enables or disables the HTTP metadata endpoint on your instances. + // + // If you specify a value of disabled, you cannot access your instance metadata. + // + // Default: enabled + // + // +kubebuilder:validation:Enum:=enabled;disabled + // +kubebuilder:default=enabled + HTTPEndpoint InstanceMetadataState `json:"httpEndpoint,omitempty"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + // + // Default: 1 + // + // +kubebuilder:validation:Minimum:=1 + // +kubebuilder:validation:Maximum:=64 + // +kubebuilder:default=1 + HTTPPutResponseHopLimit int64 `json:"httpPutResponseHopLimit,omitempty"` + + // The state of token usage for your instance metadata requests. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a session token on your request. If you retrieve the IAM role + // credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid session token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a session token with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credentials + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + // + // Default: optional + // + // +kubebuilder:validation:Enum:=optional;required + // +kubebuilder:default=optional + HTTPTokens HTTPTokensState `json:"httpTokens,omitempty"` + + // Set to enabled to allow access to instance tags from the instance metadata. + // Set to disabled to turn off access to instance tags from the instance metadata. + // For more information, see Work with instance tags using the instance metadata + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS). + // + // Default: disabled + // + // +kubebuilder:validation:Enum:=enabled;disabled + // +kubebuilder:default=disabled + InstanceMetadataTags InstanceMetadataState `json:"instanceMetadataTags,omitempty"` +} + +// SetDefaults sets the default values for the InstanceMetadataOptions. +func (obj *InstanceMetadataOptions) SetDefaults() { + if obj.HTTPEndpoint == "" { + obj.HTTPEndpoint = InstanceMetadataEndpointStateEnabled + } + if obj.HTTPPutResponseHopLimit == 0 { + obj.HTTPPutResponseHopLimit = 1 + } + if obj.HTTPTokens == "" { + obj.HTTPTokens = HTTPTokensStateOptional // Defaults to IMDSv1 + } + if obj.InstanceMetadataTags == "" { + obj.InstanceMetadataTags = InstanceMetadataEndpointStateDisabled + } +} + +// Volume encapsulates the configuration options for the storage device. +type Volume struct { + // Device name + // +optional + DeviceName string `json:"deviceName,omitempty"` + + // Size specifies size (in Gi) of the storage device. + // Must be greater than the image snapshot size or 8 (whichever is greater). + // +kubebuilder:validation:Minimum=8 + Size int64 `json:"size"` + + // Type is the type of the volume (e.g. gp2, io1, etc...). + // +optional + Type VolumeType `json:"type,omitempty"` + + // IOPS is the number of IOPS requested for the disk. Not applicable to all types. + // +optional + IOPS int64 `json:"iops,omitempty"` + + // Throughput to provision in MiB/s supported for the volume type. Not applicable to all types. + // +optional + Throughput *int64 `json:"throughput,omitempty"` + + // Encrypted is whether the volume should be encrypted or not. + // +optional + Encrypted *bool `json:"encrypted,omitempty"` + + // EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. + // If Encrypted is set and this is omitted, the default AWS key will be used. + // The key must already exist and be accessible by the controller. + // +optional + EncryptionKey string `json:"encryptionKey,omitempty"` +} + +// VolumeType describes the EBS volume type. +// See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html +type VolumeType string + +var ( + // VolumeTypeIO1 is the string representing a provisioned iops ssd io1 volume. + VolumeTypeIO1 = VolumeType("io1") + + // VolumeTypeIO2 is the string representing a provisioned iops ssd io2 volume. + VolumeTypeIO2 = VolumeType("io2") + + // VolumeTypeGP2 is the string representing a general purpose ssd gp2 volume. + VolumeTypeGP2 = VolumeType("gp2") + + // VolumeTypeGP3 is the string representing a general purpose ssd gp3 volume. + VolumeTypeGP3 = VolumeType("gp3") + + // VolumeTypesGP are volume types provisioned for general purpose io. + VolumeTypesGP = sets.NewString( + string(VolumeTypeIO1), + string(VolumeTypeIO2), + ) + + // VolumeTypesProvisioned are volume types provisioned for high performance io. + VolumeTypesProvisioned = sets.NewString( + string(VolumeTypeIO1), + string(VolumeTypeIO2), + ) +) + +// SpotMarketOptions defines the options available to a user when configuring +// Machines to run on Spot instances. +// Most users should provide an empty struct. +type SpotMarketOptions struct { + // MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + // +optional + // +kubebuilder:validation:pattern="^[0-9]+(\.[0-9]+)?$" + MaxPrice *string `json:"maxPrice,omitempty"` +} + +// EKSAMILookupType specifies which AWS AMI to use for a AWSMachine and AWSMachinePool. +type EKSAMILookupType string + +const ( + // AmazonLinux is the default AMI type. + AmazonLinux EKSAMILookupType = "AmazonLinux" + // AmazonLinuxGPU is the AmazonLinux GPU AMI type. + AmazonLinuxGPU EKSAMILookupType = "AmazonLinuxGPU" + // AmazonLinux2023 is the AmazonLinux 2023 AMI type. + AmazonLinux2023 EKSAMILookupType = "AmazonLinux2023" + // AmazonLinux2023GPU is the AmazonLinux 2023 GPU AMI type. + AmazonLinux2023GPU EKSAMILookupType = "AmazonLinux2023GPU" +) + +// PrivateDNSName is the options for the instance hostname. +type PrivateDNSName struct { + // EnableResourceNameDNSAAAARecord indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. + // +optional + EnableResourceNameDNSAAAARecord *bool `json:"enableResourceNameDnsAAAARecord,omitempty"` + // EnableResourceNameDNSARecord indicates whether to respond to DNS queries for instance hostnames with DNS A records. + // +optional + EnableResourceNameDNSARecord *bool `json:"enableResourceNameDnsARecord,omitempty"` + // The type of hostname to assign to an instance. + // +optional + // +kubebuilder:validation:Enum:=ip-name;resource-name + HostnameType *string `json:"hostnameType,omitempty"` +} + +// SubnetSchemaType specifies how given network should be divided on subnets +// in the VPC depending on the number of AZs. +type SubnetSchemaType string + +// Name returns subnet schema type name without prefix. +func (s *SubnetSchemaType) Name() string { + return strings.ToLower(strings.TrimPrefix(string(*s), "Prefer")) +} + +var ( + // SubnetSchemaPreferPrivate allocates more subnets in the VPC to private subnets. + SubnetSchemaPreferPrivate = SubnetSchemaType("PreferPrivate") + // SubnetSchemaPreferPublic allocates more subnets in the VPC to public subnets. + SubnetSchemaPreferPublic = SubnetSchemaType("PreferPublic") +) + +// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance. +// +kubebuilder:validation:Enum=Disabled;AMDEncryptedVirtualizationNestedPaging +type AWSConfidentialComputePolicy string + +const ( + // AWSConfidentialComputePolicyDisabled disables confidential computing for the instance. + AWSConfidentialComputePolicyDisabled AWSConfidentialComputePolicy = "Disabled" + // AWSConfidentialComputePolicySEVSNP enables AMD SEV-SNP as the confidential computing technology for the instance. + AWSConfidentialComputePolicySEVSNP AWSConfidentialComputePolicy = "AMDEncryptedVirtualizationNestedPaging" +) + +// CPUOptions defines CPU-related settings for the instance, including the confidential computing policy. +// +kubebuilder:validation:MinProperties=1 +type CPUOptions struct { + // ConfidentialCompute specifies whether confidential computing should be enabled for the instance, + // and, if so, which confidential computing technology to use. + // Valid values are: Disabled, AMDEncryptedVirtualizationNestedPaging + // When set to Disabled, confidential computing will be disabled for the instance. + // When set to AMDEncryptedVirtualizationNestedPaging, AMD SEV-SNP will be used as the confidential computing technology for the instance. + // In this case, ensure the following conditions are met: + // 1) The selected instance type supports AMD SEV-SNP. + // 2) The selected AWS region supports AMD SEV-SNP. + // 3) The selected AMI supports AMD SEV-SNP. + // More details can be checked at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html + // When omitted, this means no opinion and the AWS platform is left to choose a reasonable default, + // which is subject to change without notice. The current default is Disabled. + // +optional + ConfidentialCompute AWSConfidentialComputePolicy `json:"confidentialCompute,omitempty"` +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_conversion.go b/pkg/capi/aws/api/v1beta2/webhooks.go similarity index 56% rename from vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_conversion.go rename to pkg/capi/aws/api/v1beta2/webhooks.go index a1c5824fe9df..b5e444b762af 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_conversion.go +++ b/pkg/capi/aws/api/v1beta2/webhooks.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,10 +14,22 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1beta2 -// Hub marks GCPClusterTemplate as a conversion hub. -func (*GCPClusterTemplate) Hub() {} +import ( + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" +) -// Hub marks GCPClusterTemplateList as a conversion hub. -func (*GCPClusterTemplateList) Hub() {} +func aggregateObjErrors(gk schema.GroupKind, name string, allErrs field.ErrorList) error { + if len(allErrs) == 0 { + return nil + } + + return apierrors.NewInvalid( + gk, + name, + allErrs, + ) +} diff --git a/pkg/capi/aws/api/v1beta2/zz_generated.deepcopy.go b/pkg/capi/aws/api/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 000000000000..fd7211238824 --- /dev/null +++ b/pkg/capi/aws/api/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,2322 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AMIReference) DeepCopyInto(out *AMIReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.EKSOptimizedLookupType != nil { + in, out := &in.EKSOptimizedLookupType, &out.EKSOptimizedLookupType + *out = new(EKSAMILookupType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMIReference. +func (in *AMIReference) DeepCopy() *AMIReference { + if in == nil { + return nil + } + out := new(AMIReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSCluster) DeepCopyInto(out *AWSCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSCluster. +func (in *AWSCluster) DeepCopy() *AWSCluster { + if in == nil { + return nil + } + out := new(AWSCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentity) DeepCopyInto(out *AWSClusterControllerIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentity. +func (in *AWSClusterControllerIdentity) DeepCopy() *AWSClusterControllerIdentity { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentityList) DeepCopyInto(out *AWSClusterControllerIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterControllerIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentityList. +func (in *AWSClusterControllerIdentityList) DeepCopy() *AWSClusterControllerIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentitySpec) DeepCopyInto(out *AWSClusterControllerIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentitySpec. +func (in *AWSClusterControllerIdentitySpec) DeepCopy() *AWSClusterControllerIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterIdentitySpec) DeepCopyInto(out *AWSClusterIdentitySpec) { + *out = *in + if in.AllowedNamespaces != nil { + in, out := &in.AllowedNamespaces, &out.AllowedNamespaces + *out = new(AllowedNamespaces) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterIdentitySpec. +func (in *AWSClusterIdentitySpec) DeepCopy() *AWSClusterIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterList) DeepCopyInto(out *AWSClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterList. +func (in *AWSClusterList) DeepCopy() *AWSClusterList { + if in == nil { + return nil + } + out := new(AWSClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentity) DeepCopyInto(out *AWSClusterRoleIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentity. +func (in *AWSClusterRoleIdentity) DeepCopy() *AWSClusterRoleIdentity { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentityList) DeepCopyInto(out *AWSClusterRoleIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterRoleIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentityList. +func (in *AWSClusterRoleIdentityList) DeepCopy() *AWSClusterRoleIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentitySpec) DeepCopyInto(out *AWSClusterRoleIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) + in.AWSRoleSpec.DeepCopyInto(&out.AWSRoleSpec) + if in.SourceIdentityRef != nil { + in, out := &in.SourceIdentityRef, &out.SourceIdentityRef + *out = new(AWSIdentityReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentitySpec. +func (in *AWSClusterRoleIdentitySpec) DeepCopy() *AWSClusterRoleIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterSpec) DeepCopyInto(out *AWSClusterSpec) { + *out = *in + in.NetworkSpec.DeepCopyInto(&out.NetworkSpec) + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ControlPlaneLoadBalancer != nil { + in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer + *out = new(AWSLoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + if in.SecondaryControlPlaneLoadBalancer != nil { + in, out := &in.SecondaryControlPlaneLoadBalancer, &out.SecondaryControlPlaneLoadBalancer + *out = new(AWSLoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + in.Bastion.DeepCopyInto(&out.Bastion) + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(AWSIdentityReference) + **out = **in + } + if in.S3Bucket != nil { + in, out := &in.S3Bucket, &out.S3Bucket + *out = new(S3Bucket) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterSpec. +func (in *AWSClusterSpec) DeepCopy() *AWSClusterSpec { + if in == nil { + return nil + } + out := new(AWSClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentity) DeepCopyInto(out *AWSClusterStaticIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentity. +func (in *AWSClusterStaticIdentity) DeepCopy() *AWSClusterStaticIdentity { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentityList) DeepCopyInto(out *AWSClusterStaticIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterStaticIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentityList. +func (in *AWSClusterStaticIdentityList) DeepCopy() *AWSClusterStaticIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentitySpec) DeepCopyInto(out *AWSClusterStaticIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentitySpec. +func (in *AWSClusterStaticIdentitySpec) DeepCopy() *AWSClusterStaticIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStatus) DeepCopyInto(out *AWSClusterStatus) { + *out = *in + in.Network.DeepCopyInto(&out.Network) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(v1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(Instance) + (*in).DeepCopyInto(*out) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStatus. +func (in *AWSClusterStatus) DeepCopy() *AWSClusterStatus { + if in == nil { + return nil + } + out := new(AWSClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplate) DeepCopyInto(out *AWSClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplate. +func (in *AWSClusterTemplate) DeepCopy() *AWSClusterTemplate { + if in == nil { + return nil + } + out := new(AWSClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplateList) DeepCopyInto(out *AWSClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateList. +func (in *AWSClusterTemplateList) DeepCopy() *AWSClusterTemplateList { + if in == nil { + return nil + } + out := new(AWSClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplateResource) DeepCopyInto(out *AWSClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateResource. +func (in *AWSClusterTemplateResource) DeepCopy() *AWSClusterTemplateResource { + if in == nil { + return nil + } + out := new(AWSClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplateSpec) DeepCopyInto(out *AWSClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateSpec. +func (in *AWSClusterTemplateSpec) DeepCopy() *AWSClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AWSClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSIdentityReference) DeepCopyInto(out *AWSIdentityReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIdentityReference. +func (in *AWSIdentityReference) DeepCopy() *AWSIdentityReference { + if in == nil { + return nil + } + out := new(AWSIdentityReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLoadBalancerSpec) DeepCopyInto(out *AWSLoadBalancerSpec) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(ELBScheme) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HealthCheckProtocol != nil { + in, out := &in.HealthCheckProtocol, &out.HealthCheckProtocol + *out = new(ELBProtocol) + **out = **in + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(TargetGroupHealthCheckAPISpec) + (*in).DeepCopyInto(*out) + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdditionalListeners != nil { + in, out := &in.AdditionalListeners, &out.AdditionalListeners + *out = make([]AdditionalListenerSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.IngressRules != nil { + in, out := &in.IngressRules, &out.IngressRules + *out = make([]IngressRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLoadBalancerSpec. +func (in *AWSLoadBalancerSpec) DeepCopy() *AWSLoadBalancerSpec { + if in == nil { + return nil + } + out := new(AWSLoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachine) DeepCopyInto(out *AWSMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachine. +func (in *AWSMachine) DeepCopy() *AWSMachine { + if in == nil { + return nil + } + out := new(AWSMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineList) DeepCopyInto(out *AWSMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineList. +func (in *AWSMachineList) DeepCopy() *AWSMachineList { + if in == nil { + return nil + } + out := new(AWSMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineSpec) DeepCopyInto(out *AWSMachineSpec) { + *out = *in + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.InstanceMetadataOptions != nil { + in, out := &in.InstanceMetadataOptions, &out.InstanceMetadataOptions + *out = new(InstanceMetadataOptions) + **out = **in + } + in.AMI.DeepCopyInto(&out.AMI) + out.CPUOptions = in.CPUOptions + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(bool) + **out = **in + } + if in.ElasticIPPool != nil { + in, out := &in.ElasticIPPool, &out.ElasticIPPool + *out = new(ElasticIPPool) + (*in).DeepCopyInto(*out) + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(AWSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroupOverrides != nil { + in, out := &in.SecurityGroupOverrides, &out.SecurityGroupOverrides + *out = make(map[SecurityGroupRole]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(Volume) + (*in).DeepCopyInto(*out) + } + if in.NonRootVolumes != nil { + in, out := &in.NonRootVolumes, &out.NonRootVolumes + *out = make([]Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UncompressedUserData != nil { + in, out := &in.UncompressedUserData, &out.UncompressedUserData + *out = new(bool) + **out = **in + } + out.CloudInit = in.CloudInit + if in.Ignition != nil { + in, out := &in.Ignition, &out.Ignition + *out = new(Ignition) + (*in).DeepCopyInto(*out) + } + if in.SpotMarketOptions != nil { + in, out := &in.SpotMarketOptions, &out.SpotMarketOptions + *out = new(SpotMarketOptions) + (*in).DeepCopyInto(*out) + } + if in.PrivateDNSName != nil { + in, out := &in.PrivateDNSName, &out.PrivateDNSName + *out = new(PrivateDNSName) + (*in).DeepCopyInto(*out) + } + if in.CapacityReservationID != nil { + in, out := &in.CapacityReservationID, &out.CapacityReservationID + *out = new(string) + **out = **in + } + if in.HostID != nil { + in, out := &in.HostID, &out.HostID + *out = new(string) + **out = **in + } + if in.HostAffinity != nil { + in, out := &in.HostAffinity, &out.HostAffinity + *out = new(string) + **out = **in + } + if in.DynamicHostAllocation != nil { + in, out := &in.DynamicHostAllocation, &out.DynamicHostAllocation + *out = new(DynamicHostAllocationSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineSpec. +func (in *AWSMachineSpec) DeepCopy() *AWSMachineSpec { + if in == nil { + return nil + } + out := new(AWSMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineStatus) DeepCopyInto(out *AWSMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(InstanceState) + **out = **in + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DedicatedHost != nil { + in, out := &in.DedicatedHost, &out.DedicatedHost + *out = new(DedicatedHostStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineStatus. +func (in *AWSMachineStatus) DeepCopy() *AWSMachineStatus { + if in == nil { + return nil + } + out := new(AWSMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplate) DeepCopyInto(out *AWSMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplate. +func (in *AWSMachineTemplate) DeepCopy() *AWSMachineTemplate { + if in == nil { + return nil + } + out := new(AWSMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplateList) DeepCopyInto(out *AWSMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateList. +func (in *AWSMachineTemplateList) DeepCopy() *AWSMachineTemplateList { + if in == nil { + return nil + } + out := new(AWSMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplateResource) DeepCopyInto(out *AWSMachineTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateResource. +func (in *AWSMachineTemplateResource) DeepCopy() *AWSMachineTemplateResource { + if in == nil { + return nil + } + out := new(AWSMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplateSpec) DeepCopyInto(out *AWSMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateSpec. +func (in *AWSMachineTemplateSpec) DeepCopy() *AWSMachineTemplateSpec { + if in == nil { + return nil + } + out := new(AWSMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplateStatus) DeepCopyInto(out *AWSMachineTemplateStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.NodeInfo != nil { + in, out := &in.NodeInfo, &out.NodeInfo + *out = new(NodeInfo) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateStatus. +func (in *AWSMachineTemplateStatus) DeepCopy() *AWSMachineTemplateStatus { + if in == nil { + return nil + } + out := new(AWSMachineTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSResourceReference) DeepCopyInto(out *AWSResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make([]Filter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSResourceReference. +func (in *AWSResourceReference) DeepCopy() *AWSResourceReference { + if in == nil { + return nil + } + out := new(AWSResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSRoleSpec) DeepCopyInto(out *AWSRoleSpec) { + *out = *in + if in.PolicyARNs != nil { + in, out := &in.PolicyARNs, &out.PolicyARNs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSRoleSpec. +func (in *AWSRoleSpec) DeepCopy() *AWSRoleSpec { + if in == nil { + return nil + } + out := new(AWSRoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalListenerSpec) DeepCopyInto(out *AdditionalListenerSpec) { + *out = *in + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(TargetGroupHealthCheckAdditionalSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalListenerSpec. +func (in *AdditionalListenerSpec) DeepCopy() *AdditionalListenerSpec { + if in == nil { + return nil + } + out := new(AdditionalListenerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { + *out = *in + if in.NamespaceList != nil { + in, out := &in.NamespaceList, &out.NamespaceList + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Selector.DeepCopyInto(&out.Selector) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedNamespaces. +func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces { + if in == nil { + return nil + } + out := new(AllowedNamespaces) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Bastion) DeepCopyInto(out *Bastion) { + *out = *in + if in.AllowedCIDRBlocks != nil { + in, out := &in.AllowedCIDRBlocks, &out.AllowedCIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bastion. +func (in *Bastion) DeepCopy() *Bastion { + if in == nil { + return nil + } + out := new(Bastion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildParams) DeepCopyInto(out *BuildParams) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Role != nil { + in, out := &in.Role, &out.Role + *out = new(string) + **out = **in + } + if in.Additional != nil { + in, out := &in.Additional, &out.Additional + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildParams. +func (in *BuildParams) DeepCopy() *BuildParams { + if in == nil { + return nil + } + out := new(BuildParams) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CNIIngressRule) DeepCopyInto(out *CNIIngressRule) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNIIngressRule. +func (in *CNIIngressRule) DeepCopy() *CNIIngressRule { + if in == nil { + return nil + } + out := new(CNIIngressRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in CNIIngressRules) DeepCopyInto(out *CNIIngressRules) { + { + in := &in + *out = make(CNIIngressRules, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNIIngressRules. +func (in CNIIngressRules) DeepCopy() CNIIngressRules { + if in == nil { + return nil + } + out := new(CNIIngressRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CNISpec) DeepCopyInto(out *CNISpec) { + *out = *in + if in.CNIIngressRules != nil { + in, out := &in.CNIIngressRules, &out.CNIIngressRules + *out = make(CNIIngressRules, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNISpec. +func (in *CNISpec) DeepCopy() *CNISpec { + if in == nil { + return nil + } + out := new(CNISpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CPUOptions) DeepCopyInto(out *CPUOptions) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUOptions. +func (in *CPUOptions) DeepCopy() *CPUOptions { + if in == nil { + return nil + } + out := new(CPUOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBAttributes) DeepCopyInto(out *ClassicELBAttributes) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBAttributes. +func (in *ClassicELBAttributes) DeepCopy() *ClassicELBAttributes { + if in == nil { + return nil + } + out := new(ClassicELBAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBHealthCheck) DeepCopyInto(out *ClassicELBHealthCheck) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBHealthCheck. +func (in *ClassicELBHealthCheck) DeepCopy() *ClassicELBHealthCheck { + if in == nil { + return nil + } + out := new(ClassicELBHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBListener) DeepCopyInto(out *ClassicELBListener) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBListener. +func (in *ClassicELBListener) DeepCopy() *ClassicELBListener { + if in == nil { + return nil + } + out := new(ClassicELBListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudInit) DeepCopyInto(out *CloudInit) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudInit. +func (in *CloudInit) DeepCopy() *CloudInit { + if in == nil { + return nil + } + out := new(CloudInit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DedicatedHostInfo) DeepCopyInto(out *DedicatedHostInfo) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DedicatedHostInfo. +func (in *DedicatedHostInfo) DeepCopy() *DedicatedHostInfo { + if in == nil { + return nil + } + out := new(DedicatedHostInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DedicatedHostStatus) DeepCopyInto(out *DedicatedHostStatus) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DedicatedHostStatus. +func (in *DedicatedHostStatus) DeepCopy() *DedicatedHostStatus { + if in == nil { + return nil + } + out := new(DedicatedHostStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicHostAllocationSpec) DeepCopyInto(out *DynamicHostAllocationSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicHostAllocationSpec. +func (in *DynamicHostAllocationSpec) DeepCopy() *DynamicHostAllocationSpec { + if in == nil { + return nil + } + out := new(DynamicHostAllocationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ElasticIPPool) DeepCopyInto(out *ElasticIPPool) { + *out = *in + if in.PublicIpv4Pool != nil { + in, out := &in.PublicIpv4Pool, &out.PublicIpv4Pool + *out = new(string) + **out = **in + } + if in.PublicIpv4PoolFallBackOrder != nil { + in, out := &in.PublicIpv4PoolFallBackOrder, &out.PublicIpv4PoolFallBackOrder + *out = new(PublicIpv4PoolFallbackOrder) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElasticIPPool. +func (in *ElasticIPPool) DeepCopy() *ElasticIPPool { + if in == nil { + return nil + } + out := new(ElasticIPPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAMPool) DeepCopyInto(out *IPAMPool) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAMPool. +func (in *IPAMPool) DeepCopy() *IPAMPool { + if in == nil { + return nil + } + out := new(IPAMPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPv6) DeepCopyInto(out *IPv6) { + *out = *in + if in.EgressOnlyInternetGatewayID != nil { + in, out := &in.EgressOnlyInternetGatewayID, &out.EgressOnlyInternetGatewayID + *out = new(string) + **out = **in + } + if in.IPAMPool != nil { + in, out := &in.IPAMPool, &out.IPAMPool + *out = new(IPAMPool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPv6. +func (in *IPv6) DeepCopy() *IPv6 { + if in == nil { + return nil + } + out := new(IPv6) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Ignition) DeepCopyInto(out *Ignition) { + *out = *in + if in.Proxy != nil { + in, out := &in.Proxy, &out.Proxy + *out = new(IgnitionProxy) + (*in).DeepCopyInto(*out) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(IgnitionTLS) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ignition. +func (in *Ignition) DeepCopy() *Ignition { + if in == nil { + return nil + } + out := new(Ignition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IgnitionProxy) DeepCopyInto(out *IgnitionProxy) { + *out = *in + if in.HTTPProxy != nil { + in, out := &in.HTTPProxy, &out.HTTPProxy + *out = new(string) + **out = **in + } + if in.HTTPSProxy != nil { + in, out := &in.HTTPSProxy, &out.HTTPSProxy + *out = new(string) + **out = **in + } + if in.NoProxy != nil { + in, out := &in.NoProxy, &out.NoProxy + *out = make([]IgnitionNoProxy, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionProxy. +func (in *IgnitionProxy) DeepCopy() *IgnitionProxy { + if in == nil { + return nil + } + out := new(IgnitionProxy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IgnitionTLS) DeepCopyInto(out *IgnitionTLS) { + *out = *in + if in.CASources != nil { + in, out := &in.CASources, &out.CASources + *out = make([]IgnitionCASource, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionTLS. +func (in *IgnitionTLS) DeepCopy() *IgnitionTLS { + if in == nil { + return nil + } + out := new(IgnitionTLS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressRule) DeepCopyInto(out *IngressRule) { + *out = *in + if in.CidrBlocks != nil { + in, out := &in.CidrBlocks, &out.CidrBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IPv6CidrBlocks != nil { + in, out := &in.IPv6CidrBlocks, &out.IPv6CidrBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceSecurityGroupIDs != nil { + in, out := &in.SourceSecurityGroupIDs, &out.SourceSecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceSecurityGroupRoles != nil { + in, out := &in.SourceSecurityGroupRoles, &out.SourceSecurityGroupRoles + *out = make([]SecurityGroupRole, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRule. +func (in *IngressRule) DeepCopy() *IngressRule { + if in == nil { + return nil + } + out := new(IngressRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in IngressRules) DeepCopyInto(out *IngressRules) { + { + in := &in + *out = make(IngressRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRules. +func (in IngressRules) DeepCopy() IngressRules { + if in == nil { + return nil + } + out := new(IngressRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Instance) DeepCopyInto(out *Instance) { + *out = *in + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.SecurityGroupIDs != nil { + in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(string) + **out = **in + } + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(string) + **out = **in + } + if in.ENASupport != nil { + in, out := &in.ENASupport, &out.ENASupport + *out = new(bool) + **out = **in + } + if in.EBSOptimized != nil { + in, out := &in.EBSOptimized, &out.EBSOptimized + *out = new(bool) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(Volume) + (*in).DeepCopyInto(*out) + } + if in.NonRootVolumes != nil { + in, out := &in.NonRootVolumes, &out.NonRootVolumes + *out = make([]Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SpotMarketOptions != nil { + in, out := &in.SpotMarketOptions, &out.SpotMarketOptions + *out = new(SpotMarketOptions) + (*in).DeepCopyInto(*out) + } + if in.VolumeIDs != nil { + in, out := &in.VolumeIDs, &out.VolumeIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.InstanceMetadataOptions != nil { + in, out := &in.InstanceMetadataOptions, &out.InstanceMetadataOptions + *out = new(InstanceMetadataOptions) + **out = **in + } + if in.PrivateDNSName != nil { + in, out := &in.PrivateDNSName, &out.PrivateDNSName + *out = new(PrivateDNSName) + (*in).DeepCopyInto(*out) + } + if in.PublicIPOnLaunch != nil { + in, out := &in.PublicIPOnLaunch, &out.PublicIPOnLaunch + *out = new(bool) + **out = **in + } + if in.CapacityReservationID != nil { + in, out := &in.CapacityReservationID, &out.CapacityReservationID + *out = new(string) + **out = **in + } + if in.HostAffinity != nil { + in, out := &in.HostAffinity, &out.HostAffinity + *out = new(string) + **out = **in + } + if in.HostID != nil { + in, out := &in.HostID, &out.HostID + *out = new(string) + **out = **in + } + if in.DynamicHostAllocation != nil { + in, out := &in.DynamicHostAllocation, &out.DynamicHostAllocation + *out = new(DynamicHostAllocationSpec) + (*in).DeepCopyInto(*out) + } + out.CPUOptions = in.CPUOptions +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance. +func (in *Instance) DeepCopy() *Instance { + if in == nil { + return nil + } + out := new(Instance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceMetadataOptions) DeepCopyInto(out *InstanceMetadataOptions) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceMetadataOptions. +func (in *InstanceMetadataOptions) DeepCopy() *InstanceMetadataOptions { + if in == nil { + return nil + } + out := new(InstanceMetadataOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Listener) DeepCopyInto(out *Listener) { + *out = *in + in.TargetGroup.DeepCopyInto(&out.TargetGroup) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Listener. +func (in *Listener) DeepCopy() *Listener { + if in == nil { + return nil + } + out := new(Listener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SubnetIDs != nil { + in, out := &in.SubnetIDs, &out.SubnetIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SecurityGroupIDs != nil { + in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ClassicELBListeners != nil { + in, out := &in.ClassicELBListeners, &out.ClassicELBListeners + *out = make([]ClassicELBListener, len(*in)) + copy(*out, *in) + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(ClassicELBHealthCheck) + **out = **in + } + out.ClassicElbAttributes = in.ClassicElbAttributes + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ELBListeners != nil { + in, out := &in.ELBListeners, &out.ELBListeners + *out = make([]Listener, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ELBAttributes != nil { + in, out := &in.ELBAttributes, &out.ELBAttributes + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + in.VPC.DeepCopyInto(&out.VPC) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CNI != nil { + in, out := &in.CNI, &out.CNI + *out = new(CNISpec) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroupOverrides != nil { + in, out := &in.SecurityGroupOverrides, &out.SecurityGroupOverrides + *out = make(map[SecurityGroupRole]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AdditionalControlPlaneIngressRules != nil { + in, out := &in.AdditionalControlPlaneIngressRules, &out.AdditionalControlPlaneIngressRules + *out = make([]IngressRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AdditionalNodeIngressRules != nil { + in, out := &in.AdditionalNodeIngressRules, &out.AdditionalNodeIngressRules + *out = make([]IngressRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NodePortIngressRuleCidrBlocks != nil { + in, out := &in.NodePortIngressRuleCidrBlocks, &out.NodePortIngressRuleCidrBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make(map[SecurityGroupRole]SecurityGroup, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + in.APIServerELB.DeepCopyInto(&out.APIServerELB) + in.SecondaryAPIServerELB.DeepCopyInto(&out.SecondaryAPIServerELB) + if in.NatGatewaysIPs != nil { + in, out := &in.NatGatewaysIPs, &out.NatGatewaysIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeInfo) DeepCopyInto(out *NodeInfo) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInfo. +func (in *NodeInfo) DeepCopy() *NodeInfo { + if in == nil { + return nil + } + out := new(NodeInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDNSName) DeepCopyInto(out *PrivateDNSName) { + *out = *in + if in.EnableResourceNameDNSAAAARecord != nil { + in, out := &in.EnableResourceNameDNSAAAARecord, &out.EnableResourceNameDNSAAAARecord + *out = new(bool) + **out = **in + } + if in.EnableResourceNameDNSARecord != nil { + in, out := &in.EnableResourceNameDNSARecord, &out.EnableResourceNameDNSARecord + *out = new(bool) + **out = **in + } + if in.HostnameType != nil { + in, out := &in.HostnameType, &out.HostnameType + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDNSName. +func (in *PrivateDNSName) DeepCopy() *PrivateDNSName { + if in == nil { + return nil + } + out := new(PrivateDNSName) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteTable) DeepCopyInto(out *RouteTable) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTable. +func (in *RouteTable) DeepCopy() *RouteTable { + if in == nil { + return nil + } + out := new(RouteTable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *S3Bucket) DeepCopyInto(out *S3Bucket) { + *out = *in + if in.NodesIAMInstanceProfiles != nil { + in, out := &in.NodesIAMInstanceProfiles, &out.NodesIAMInstanceProfiles + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PresignedURLDuration != nil { + in, out := &in.PresignedURLDuration, &out.PresignedURLDuration + *out = new(v1.Duration) + **out = **in + } + if in.BestEffortDeleteObjects != nil { + in, out := &in.BestEffortDeleteObjects, &out.BestEffortDeleteObjects + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Bucket. +func (in *S3Bucket) DeepCopy() *S3Bucket { + if in == nil { + return nil + } + out := new(S3Bucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in + if in.IngressRules != nil { + in, out := &in.IngressRules, &out.IngressRules + *out = make(IngressRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpotMarketOptions) DeepCopyInto(out *SpotMarketOptions) { + *out = *in + if in.MaxPrice != nil { + in, out := &in.MaxPrice, &out.MaxPrice + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpotMarketOptions. +func (in *SpotMarketOptions) DeepCopy() *SpotMarketOptions { + if in == nil { + return nil + } + out := new(SpotMarketOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + if in.RouteTableID != nil { + in, out := &in.RouteTableID, &out.RouteTableID + *out = new(string) + **out = **in + } + if in.NatGatewayID != nil { + in, out := &in.NatGatewayID, &out.NatGatewayID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ZoneType != nil { + in, out := &in.ZoneType, &out.ZoneType + *out = new(ZoneType) + **out = **in + } + if in.ParentZoneName != nil { + in, out := &in.ParentZoneName, &out.ParentZoneName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Subnets) DeepCopyInto(out *Subnets) { + { + in := &in + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnets. +func (in Subnets) DeepCopy() Subnets { + if in == nil { + return nil + } + out := new(Subnets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Tags) DeepCopyInto(out *Tags) { + { + in := &in + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. +func (in Tags) DeepCopy() Tags { + if in == nil { + return nil + } + out := new(Tags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetGroupHealthCheck) DeepCopyInto(out *TargetGroupHealthCheck) { + *out = *in + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.IntervalSeconds != nil { + in, out := &in.IntervalSeconds, &out.IntervalSeconds + *out = new(int64) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int64) + **out = **in + } + if in.ThresholdCount != nil { + in, out := &in.ThresholdCount, &out.ThresholdCount + *out = new(int64) + **out = **in + } + if in.UnhealthyThresholdCount != nil { + in, out := &in.UnhealthyThresholdCount, &out.UnhealthyThresholdCount + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetGroupHealthCheck. +func (in *TargetGroupHealthCheck) DeepCopy() *TargetGroupHealthCheck { + if in == nil { + return nil + } + out := new(TargetGroupHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetGroupHealthCheckAPISpec) DeepCopyInto(out *TargetGroupHealthCheckAPISpec) { + *out = *in + if in.IntervalSeconds != nil { + in, out := &in.IntervalSeconds, &out.IntervalSeconds + *out = new(int64) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int64) + **out = **in + } + if in.ThresholdCount != nil { + in, out := &in.ThresholdCount, &out.ThresholdCount + *out = new(int64) + **out = **in + } + if in.UnhealthyThresholdCount != nil { + in, out := &in.UnhealthyThresholdCount, &out.UnhealthyThresholdCount + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetGroupHealthCheckAPISpec. +func (in *TargetGroupHealthCheckAPISpec) DeepCopy() *TargetGroupHealthCheckAPISpec { + if in == nil { + return nil + } + out := new(TargetGroupHealthCheckAPISpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetGroupHealthCheckAdditionalSpec) DeepCopyInto(out *TargetGroupHealthCheckAdditionalSpec) { + *out = *in + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.IntervalSeconds != nil { + in, out := &in.IntervalSeconds, &out.IntervalSeconds + *out = new(int64) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int64) + **out = **in + } + if in.ThresholdCount != nil { + in, out := &in.ThresholdCount, &out.ThresholdCount + *out = new(int64) + **out = **in + } + if in.UnhealthyThresholdCount != nil { + in, out := &in.UnhealthyThresholdCount, &out.UnhealthyThresholdCount + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetGroupHealthCheckAdditionalSpec. +func (in *TargetGroupHealthCheckAdditionalSpec) DeepCopy() *TargetGroupHealthCheckAdditionalSpec { + if in == nil { + return nil + } + out := new(TargetGroupHealthCheckAdditionalSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetGroupSpec) DeepCopyInto(out *TargetGroupSpec) { + *out = *in + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(TargetGroupHealthCheck) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetGroupSpec. +func (in *TargetGroupSpec) DeepCopy() *TargetGroupSpec { + if in == nil { + return nil + } + out := new(TargetGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSpec) DeepCopyInto(out *VPCSpec) { + *out = *in + if in.SecondaryCidrBlocks != nil { + in, out := &in.SecondaryCidrBlocks, &out.SecondaryCidrBlocks + *out = make([]VpcCidrBlock, len(*in)) + copy(*out, *in) + } + if in.IPAMPool != nil { + in, out := &in.IPAMPool, &out.IPAMPool + *out = new(IPAMPool) + **out = **in + } + if in.IPv6 != nil { + in, out := &in.IPv6, &out.IPv6 + *out = new(IPv6) + (*in).DeepCopyInto(*out) + } + if in.InternetGatewayID != nil { + in, out := &in.InternetGatewayID, &out.InternetGatewayID + *out = new(string) + **out = **in + } + if in.CarrierGatewayID != nil { + in, out := &in.CarrierGatewayID, &out.CarrierGatewayID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AvailabilityZoneUsageLimit != nil { + in, out := &in.AvailabilityZoneUsageLimit, &out.AvailabilityZoneUsageLimit + *out = new(int) + **out = **in + } + if in.AvailabilityZoneSelection != nil { + in, out := &in.AvailabilityZoneSelection, &out.AvailabilityZoneSelection + *out = new(AZSelectionScheme) + **out = **in + } + if in.PrivateDNSHostnameTypeOnLaunch != nil { + in, out := &in.PrivateDNSHostnameTypeOnLaunch, &out.PrivateDNSHostnameTypeOnLaunch + *out = new(string) + **out = **in + } + if in.ElasticIPPool != nil { + in, out := &in.ElasticIPPool, &out.ElasticIPPool + *out = new(ElasticIPPool) + (*in).DeepCopyInto(*out) + } + if in.SubnetSchema != nil { + in, out := &in.SubnetSchema, &out.SubnetSchema + *out = new(SubnetSchemaType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSpec. +func (in *VPCSpec) DeepCopy() *VPCSpec { + if in == nil { + return nil + } + out := new(VPCSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Volume) DeepCopyInto(out *Volume) { + *out = *in + if in.Throughput != nil { + in, out := &in.Throughput, &out.Throughput + *out = new(int64) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume. +func (in *Volume) DeepCopy() *Volume { + if in == nil { + return nil + } + out := new(Volume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VpcCidrBlock) DeepCopyInto(out *VpcCidrBlock) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VpcCidrBlock. +func (in *VpcCidrBlock) DeepCopy() *VpcCidrBlock { + if in == nil { + return nil + } + out := new(VpcCidrBlock) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsmachinepool_types.go b/pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsmachinepool_types.go rename to pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/conditions_consts.go b/pkg/capi/aws/exp/api/v1beta1/conditions_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/conditions_consts.go rename to pkg/capi/aws/exp/api/v1beta1/conditions_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/doc.go b/pkg/capi/aws/exp/api/v1beta1/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/doc.go rename to pkg/capi/aws/exp/api/v1beta1/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/finalizers.go b/pkg/capi/aws/exp/api/v1beta1/finalizers.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/finalizers.go rename to pkg/capi/aws/exp/api/v1beta1/finalizers.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/groupversion_info.go b/pkg/capi/aws/exp/api/v1beta1/groupversion_info.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/groupversion_info.go rename to pkg/capi/aws/exp/api/v1beta1/groupversion_info.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/types.go b/pkg/capi/aws/exp/api/v1beta1/types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/types.go rename to pkg/capi/aws/exp/api/v1beta1/types.go diff --git a/pkg/capi/aws/exp/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/aws/exp/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..e636d297f710 --- /dev/null +++ b/pkg/capi/aws/exp/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,500 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLaunchTemplate) DeepCopyInto(out *AWSLaunchTemplate) { + *out = *in + in.AMI.DeepCopyInto(&out.AMI) + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(v1beta2.Volume) + (*in).DeepCopyInto(*out) + } + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.VersionNumber != nil { + in, out := &in.VersionNumber, &out.VersionNumber + *out = new(int64) + **out = **in + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]v1beta2.AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpotMarketOptions != nil { + in, out := &in.SpotMarketOptions, &out.SpotMarketOptions + *out = new(v1beta2.SpotMarketOptions) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLaunchTemplate. +func (in *AWSLaunchTemplate) DeepCopy() *AWSLaunchTemplate { + if in == nil { + return nil + } + out := new(AWSLaunchTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePool) DeepCopyInto(out *AWSMachinePool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePool. +func (in *AWSMachinePool) DeepCopy() *AWSMachinePool { + if in == nil { + return nil + } + out := new(AWSMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachinePool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolInstanceStatus) DeepCopyInto(out *AWSMachinePoolInstanceStatus) { + *out = *in + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolInstanceStatus. +func (in *AWSMachinePoolInstanceStatus) DeepCopy() *AWSMachinePoolInstanceStatus { + if in == nil { + return nil + } + out := new(AWSMachinePoolInstanceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolList) DeepCopyInto(out *AWSMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolList. +func (in *AWSMachinePoolList) DeepCopy() *AWSMachinePoolList { + if in == nil { + return nil + } + out := new(AWSMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachinePoolList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolSpec) DeepCopyInto(out *AWSMachinePoolSpec) { + *out = *in + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]v1beta2.AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(v1beta2.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.AWSLaunchTemplate.DeepCopyInto(&out.AWSLaunchTemplate) + if in.MixedInstancesPolicy != nil { + in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy + *out = new(MixedInstancesPolicy) + (*in).DeepCopyInto(*out) + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.DefaultCoolDown = in.DefaultCoolDown + if in.RefreshPreferences != nil { + in, out := &in.RefreshPreferences, &out.RefreshPreferences + *out = new(RefreshPreferences) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolSpec. +func (in *AWSMachinePoolSpec) DeepCopy() *AWSMachinePoolSpec { + if in == nil { + return nil + } + out := new(AWSMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolStatus) DeepCopyInto(out *AWSMachinePoolStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]AWSMachinePoolInstanceStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LaunchTemplateVersion != nil { + in, out := &in.LaunchTemplateVersion, &out.LaunchTemplateVersion + *out = new(string) + **out = **in + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.ASGStatus != nil { + in, out := &in.ASGStatus, &out.ASGStatus + *out = new(ASGStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolStatus. +func (in *AWSMachinePoolStatus) DeepCopy() *AWSMachinePoolStatus { + if in == nil { + return nil + } + out := new(AWSMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(v1beta2.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DesiredCapacity != nil { + in, out := &in.DesiredCapacity, &out.DesiredCapacity + *out = new(int32) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.DefaultCoolDown = in.DefaultCoolDown + if in.MixedInstancesPolicy != nil { + in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy + *out = new(MixedInstancesPolicy) + (*in).DeepCopyInto(*out) + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]v1beta2.Instance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalingGroup. +func (in *AutoScalingGroup) DeepCopy() *AutoScalingGroup { + if in == nil { + return nil + } + out := new(AutoScalingGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceMapping) DeepCopyInto(out *BlockDeviceMapping) { + *out = *in + out.Ebs = in.Ebs +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceMapping. +func (in *BlockDeviceMapping) DeepCopy() *BlockDeviceMapping { + if in == nil { + return nil + } + out := new(BlockDeviceMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EBS) DeepCopyInto(out *EBS) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EBS. +func (in *EBS) DeepCopy() *EBS { + if in == nil { + return nil + } + out := new(EBS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstancesDistribution) DeepCopyInto(out *InstancesDistribution) { + *out = *in + if in.OnDemandBaseCapacity != nil { + in, out := &in.OnDemandBaseCapacity, &out.OnDemandBaseCapacity + *out = new(int64) + **out = **in + } + if in.OnDemandPercentageAboveBaseCapacity != nil { + in, out := &in.OnDemandPercentageAboveBaseCapacity, &out.OnDemandPercentageAboveBaseCapacity + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancesDistribution. +func (in *InstancesDistribution) DeepCopy() *InstancesDistribution { + if in == nil { + return nil + } + out := new(InstancesDistribution) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixedInstancesPolicy) DeepCopyInto(out *MixedInstancesPolicy) { + *out = *in + if in.InstancesDistribution != nil { + in, out := &in.InstancesDistribution, &out.InstancesDistribution + *out = new(InstancesDistribution) + (*in).DeepCopyInto(*out) + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]Overrides, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixedInstancesPolicy. +func (in *MixedInstancesPolicy) DeepCopy() *MixedInstancesPolicy { + if in == nil { + return nil + } + out := new(MixedInstancesPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Overrides) DeepCopyInto(out *Overrides) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overrides. +func (in *Overrides) DeepCopy() *Overrides { + if in == nil { + return nil + } + out := new(Overrides) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RefreshPreferences) DeepCopyInto(out *RefreshPreferences) { + *out = *in + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(string) + **out = **in + } + if in.InstanceWarmup != nil { + in, out := &in.InstanceWarmup, &out.InstanceWarmup + *out = new(int64) + **out = **in + } + if in.MinHealthyPercentage != nil { + in, out := &in.MinHealthyPercentage, &out.MinHealthyPercentage + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefreshPreferences. +func (in *RefreshPreferences) DeepCopy() *RefreshPreferences { + if in == nil { + return nil + } + out := new(RefreshPreferences) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Tags) DeepCopyInto(out *Tags) { + { + in := &in + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. +func (in Tags) DeepCopy() Tags { + if in == nil { + return nil + } + out := new(Tags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Taint) DeepCopyInto(out *Taint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. +func (in *Taint) DeepCopy() *Taint { + if in == nil { + return nil + } + out := new(Taint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Taints) DeepCopyInto(out *Taints) { + { + in := &in + *out = make(Taints, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. +func (in Taints) DeepCopy() Taints { + if in == nil { + return nil + } + out := new(Taints) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateConfig) DeepCopyInto(out *UpdateConfig) { + *out = *in + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(int) + **out = **in + } + if in.MaxUnavailablePercentage != nil { + in, out := &in.MaxUnavailablePercentage, &out.MaxUnavailablePercentage + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateConfig. +func (in *UpdateConfig) DeepCopy() *UpdateConfig { + if in == nil { + return nil + } + out := new(UpdateConfig) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmachinepool_types.go b/pkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmachinepool_types.go rename to pkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/conditions_consts.go b/pkg/capi/aws/exp/api/v1beta2/conditions_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/conditions_consts.go rename to pkg/capi/aws/exp/api/v1beta2/conditions_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/doc.go b/pkg/capi/aws/exp/api/v1beta2/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/doc.go rename to pkg/capi/aws/exp/api/v1beta2/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/finalizers.go b/pkg/capi/aws/exp/api/v1beta2/finalizers.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/finalizers.go rename to pkg/capi/aws/exp/api/v1beta2/finalizers.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/groupversion_info.go b/pkg/capi/aws/exp/api/v1beta2/groupversion_info.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/groupversion_info.go rename to pkg/capi/aws/exp/api/v1beta2/groupversion_info.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/types.go b/pkg/capi/aws/exp/api/v1beta2/types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/types.go rename to pkg/capi/aws/exp/api/v1beta2/types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/validation.go b/pkg/capi/aws/exp/api/v1beta2/validation.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/validation.go rename to pkg/capi/aws/exp/api/v1beta2/validation.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/aws/exp/api/v1beta2/zz_generated.deepcopy.go similarity index 59% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.deepcopy.go rename to pkg/capi/aws/exp/api/v1beta2/zz_generated.deepcopy.go index 3919507c2da8..f9fe2a6b15a3 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.deepcopy.go +++ b/pkg/capi/aws/exp/api/v1beta2/zz_generated.deepcopy.go @@ -1,13 +1,13 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -18,82 +18,31 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v1beta1 +package v1beta2 import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + apiv1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" + "sigs.k8s.io/cluster-api/api/core/v1beta1" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSFargateProfile) DeepCopyInto(out *AWSFargateProfile) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSFargateProfile. -func (in *AWSFargateProfile) DeepCopy() *AWSFargateProfile { - if in == nil { - return nil - } - out := new(AWSFargateProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSFargateProfile) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSFargateProfileList) DeepCopyInto(out *AWSFargateProfileList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSFargateProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSFargateProfileList. -func (in *AWSFargateProfileList) DeepCopy() *AWSFargateProfileList { - if in == nil { - return nil - } - out := new(AWSFargateProfileList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSFargateProfileList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSLaunchTemplate) DeepCopyInto(out *AWSLaunchTemplate) { *out = *in in.AMI.DeepCopyInto(&out.AMI) if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume - *out = new(v1beta2.Volume) + *out = new(apiv1beta2.Volume) (*in).DeepCopyInto(*out) } + if in.NonRootVolumes != nil { + in, out := &in.NonRootVolumes, &out.NonRootVolumes + *out = make([]apiv1beta2.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.SSHKeyName != nil { in, out := &in.SSHKeyName, &out.SSHKeyName *out = new(string) @@ -106,16 +55,31 @@ func (in *AWSLaunchTemplate) DeepCopyInto(out *AWSLaunchTemplate) { } if in.AdditionalSecurityGroups != nil { in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]v1beta2.AWSResourceReference, len(*in)) + *out = make([]apiv1beta2.AWSResourceReference, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.SpotMarketOptions != nil { in, out := &in.SpotMarketOptions, &out.SpotMarketOptions - *out = new(v1beta2.SpotMarketOptions) + *out = new(apiv1beta2.SpotMarketOptions) + (*in).DeepCopyInto(*out) + } + if in.InstanceMetadataOptions != nil { + in, out := &in.InstanceMetadataOptions, &out.InstanceMetadataOptions + *out = new(apiv1beta2.InstanceMetadataOptions) + **out = **in + } + if in.PrivateDNSName != nil { + in, out := &in.PrivateDNSName, &out.PrivateDNSName + *out = new(apiv1beta2.PrivateDNSName) (*in).DeepCopyInto(*out) } + if in.CapacityReservationID != nil { + in, out := &in.CapacityReservationID, &out.CapacityReservationID + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLaunchTemplate. @@ -128,6 +92,46 @@ func (in *AWSLaunchTemplate) DeepCopy() *AWSLaunchTemplate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLifecycleHook) DeepCopyInto(out *AWSLifecycleHook) { + *out = *in + if in.NotificationTargetARN != nil { + in, out := &in.NotificationTargetARN, &out.NotificationTargetARN + *out = new(string) + **out = **in + } + if in.RoleARN != nil { + in, out := &in.RoleARN, &out.RoleARN + *out = new(string) + **out = **in + } + if in.HeartbeatTimeout != nil { + in, out := &in.HeartbeatTimeout, &out.HeartbeatTimeout + *out = new(v1.Duration) + **out = **in + } + if in.DefaultResult != nil { + in, out := &in.DefaultResult, &out.DefaultResult + *out = new(LifecycleHookDefaultResult) + **out = **in + } + if in.NotificationMetadata != nil { + in, out := &in.NotificationMetadata, &out.NotificationMetadata + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLifecycleHook. +func (in *AWSLifecycleHook) DeepCopy() *AWSLifecycleHook { + if in == nil { + return nil + } + out := new(AWSLifecycleHook) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSMachinePool) DeepCopyInto(out *AWSMachinePool) { *out = *in @@ -215,16 +219,21 @@ func (in *AWSMachinePoolSpec) DeepCopyInto(out *AWSMachinePoolSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.AvailabilityZoneSubnetType != nil { + in, out := &in.AvailabilityZoneSubnetType, &out.AvailabilityZoneSubnetType + *out = new(AZSubnetType) + **out = **in + } if in.Subnets != nil { in, out := &in.Subnets, &out.Subnets - *out = make([]v1beta2.AWSResourceReference, len(*in)) + *out = make([]apiv1beta2.AWSResourceReference, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.AdditionalTags != nil { in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(v1beta2.Tags, len(*in)) + *out = make(apiv1beta2.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -241,11 +250,29 @@ func (in *AWSMachinePoolSpec) DeepCopyInto(out *AWSMachinePoolSpec) { copy(*out, *in) } out.DefaultCoolDown = in.DefaultCoolDown + out.DefaultInstanceWarmup = in.DefaultInstanceWarmup if in.RefreshPreferences != nil { in, out := &in.RefreshPreferences, &out.RefreshPreferences *out = new(RefreshPreferences) (*in).DeepCopyInto(*out) } + if in.SuspendProcesses != nil { + in, out := &in.SuspendProcesses, &out.SuspendProcesses + *out = new(SuspendProcessesTypes) + (*in).DeepCopyInto(*out) + } + if in.Ignition != nil { + in, out := &in.Ignition, &out.Ignition + *out = new(apiv1beta2.Ignition) + (*in).DeepCopyInto(*out) + } + if in.AWSLifecycleHooks != nil { + in, out := &in.AWSLifecycleHooks, &out.AWSLifecycleHooks + *out = make([]AWSLifecycleHook, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolSpec. @@ -263,7 +290,7 @@ func (in *AWSMachinePoolStatus) DeepCopyInto(out *AWSMachinePoolStatus) { *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(corev1beta1.Conditions, len(*in)) + *out = make(v1beta1.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -307,212 +334,12 @@ func (in *AWSMachinePoolStatus) DeepCopy() *AWSMachinePoolStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePool) DeepCopyInto(out *AWSManagedMachinePool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePool. -func (in *AWSManagedMachinePool) DeepCopy() *AWSManagedMachinePool { - if in == nil { - return nil - } - out := new(AWSManagedMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedMachinePool) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolList) DeepCopyInto(out *AWSManagedMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSManagedMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolList. -func (in *AWSManagedMachinePoolList) DeepCopy() *AWSManagedMachinePoolList { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedMachinePoolList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolSpec) DeepCopyInto(out *AWSManagedMachinePoolSpec) { - *out = *in - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SubnetIDs != nil { - in, out := &in.SubnetIDs, &out.SubnetIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(v1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RoleAdditionalPolicies != nil { - in, out := &in.RoleAdditionalPolicies, &out.RoleAdditionalPolicies - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AMIVersion != nil { - in, out := &in.AMIVersion, &out.AMIVersion - *out = new(string) - **out = **in - } - if in.AMIType != nil { - in, out := &in.AMIType, &out.AMIType - *out = new(ManagedMachineAMIType) - **out = **in - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make(Taints, len(*in)) - copy(*out, *in) - } - if in.DiskSize != nil { - in, out := &in.DiskSize, &out.DiskSize - *out = new(int32) - **out = **in - } - if in.InstanceType != nil { - in, out := &in.InstanceType, &out.InstanceType - *out = new(string) - **out = **in - } - if in.Scaling != nil { - in, out := &in.Scaling, &out.Scaling - *out = new(ManagedMachinePoolScaling) - (*in).DeepCopyInto(*out) - } - if in.RemoteAccess != nil { - in, out := &in.RemoteAccess, &out.RemoteAccess - *out = new(ManagedRemoteAccess) - (*in).DeepCopyInto(*out) - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.CapacityType != nil { - in, out := &in.CapacityType, &out.CapacityType - *out = new(ManagedMachinePoolCapacityType) - **out = **in - } - if in.UpdateConfig != nil { - in, out := &in.UpdateConfig, &out.UpdateConfig - *out = new(UpdateConfig) - (*in).DeepCopyInto(*out) - } - if in.AWSLaunchTemplate != nil { - in, out := &in.AWSLaunchTemplate, &out.AWSLaunchTemplate - *out = new(AWSLaunchTemplate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolSpec. -func (in *AWSManagedMachinePoolSpec) DeepCopy() *AWSManagedMachinePoolSpec { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolStatus) DeepCopyInto(out *AWSManagedMachinePoolStatus) { - *out = *in - if in.LaunchTemplateID != nil { - in, out := &in.LaunchTemplateID, &out.LaunchTemplateID - *out = new(string) - **out = **in - } - if in.LaunchTemplateVersion != nil { - in, out := &in.LaunchTemplateVersion, &out.LaunchTemplateVersion - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(corev1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolStatus. -func (in *AWSManagedMachinePoolStatus) DeepCopy() *AWSManagedMachinePoolStatus { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { *out = *in if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make(v1beta2.Tags, len(*in)) + *out = make(apiv1beta2.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -528,6 +355,7 @@ func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { copy(*out, *in) } out.DefaultCoolDown = in.DefaultCoolDown + out.DefaultInstanceWarmup = in.DefaultInstanceWarmup if in.MixedInstancesPolicy != nil { in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy *out = new(MixedInstancesPolicy) @@ -535,11 +363,16 @@ func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { } if in.Instances != nil { in, out := &in.Instances, &out.Instances - *out = make([]v1beta2.Instance, len(*in)) + *out = make([]apiv1beta2.Instance, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.CurrentlySuspendProcesses != nil { + in, out := &in.CurrentlySuspendProcesses, &out.CurrentlySuspendProcesses + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalingGroup. @@ -583,94 +416,6 @@ func (in *EBS) DeepCopy() *EBS { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateProfileSpec) DeepCopyInto(out *FargateProfileSpec) { - *out = *in - if in.SubnetIDs != nil { - in, out := &in.SubnetIDs, &out.SubnetIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(v1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Selectors != nil { - in, out := &in.Selectors, &out.Selectors - *out = make([]FargateSelector, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileSpec. -func (in *FargateProfileSpec) DeepCopy() *FargateProfileSpec { - if in == nil { - return nil - } - out := new(FargateProfileSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateProfileStatus) DeepCopyInto(out *FargateProfileStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(corev1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileStatus. -func (in *FargateProfileStatus) DeepCopy() *FargateProfileStatus { - if in == nil { - return nil - } - out := new(FargateProfileStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateSelector) DeepCopyInto(out *FargateSelector) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateSelector. -func (in *FargateSelector) DeepCopy() *FargateSelector { - if in == nil { - return nil - } - out := new(FargateSelector) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstancesDistribution) DeepCopyInto(out *InstancesDistribution) { *out = *in @@ -696,56 +441,6 @@ func (in *InstancesDistribution) DeepCopy() *InstancesDistribution { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { - *out = *in - if in.MinSize != nil { - in, out := &in.MinSize, &out.MinSize - *out = new(int32) - **out = **in - } - if in.MaxSize != nil { - in, out := &in.MaxSize, &out.MaxSize - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. -func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { - if in == nil { - return nil - } - out := new(ManagedMachinePoolScaling) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedRemoteAccess) DeepCopyInto(out *ManagedRemoteAccess) { - *out = *in - if in.SSHKeyName != nil { - in, out := &in.SSHKeyName, &out.SSHKeyName - *out = new(string) - **out = **in - } - if in.SourceSecurityGroups != nil { - in, out := &in.SourceSecurityGroups, &out.SourceSecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedRemoteAccess. -func (in *ManagedRemoteAccess) DeepCopy() *ManagedRemoteAccess { - if in == nil { - return nil - } - out := new(ManagedRemoteAccess) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MixedInstancesPolicy) DeepCopyInto(out *MixedInstancesPolicy) { *out = *in @@ -786,6 +481,66 @@ func (in *Overrides) DeepCopy() *Overrides { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Processes) DeepCopyInto(out *Processes) { + *out = *in + if in.Launch != nil { + in, out := &in.Launch, &out.Launch + *out = new(bool) + **out = **in + } + if in.Terminate != nil { + in, out := &in.Terminate, &out.Terminate + *out = new(bool) + **out = **in + } + if in.AddToLoadBalancer != nil { + in, out := &in.AddToLoadBalancer, &out.AddToLoadBalancer + *out = new(bool) + **out = **in + } + if in.AlarmNotification != nil { + in, out := &in.AlarmNotification, &out.AlarmNotification + *out = new(bool) + **out = **in + } + if in.AZRebalance != nil { + in, out := &in.AZRebalance, &out.AZRebalance + *out = new(bool) + **out = **in + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(bool) + **out = **in + } + if in.InstanceRefresh != nil { + in, out := &in.InstanceRefresh, &out.InstanceRefresh + *out = new(bool) + **out = **in + } + if in.ReplaceUnhealthy != nil { + in, out := &in.ReplaceUnhealthy, &out.ReplaceUnhealthy + *out = new(bool) + **out = **in + } + if in.ScheduledActions != nil { + in, out := &in.ScheduledActions, &out.ScheduledActions + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Processes. +func (in *Processes) DeepCopy() *Processes { + if in == nil { + return nil + } + out := new(Processes) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RefreshPreferences) DeepCopyInto(out *RefreshPreferences) { *out = *in @@ -804,6 +559,11 @@ func (in *RefreshPreferences) DeepCopyInto(out *RefreshPreferences) { *out = new(int64) **out = **in } + if in.MaxHealthyPercentage != nil { + in, out := &in.MaxHealthyPercentage, &out.MaxHealthyPercentage + *out = new(int64) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefreshPreferences. @@ -816,6 +576,26 @@ func (in *RefreshPreferences) DeepCopy() *RefreshPreferences { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SuspendProcessesTypes) DeepCopyInto(out *SuspendProcessesTypes) { + *out = *in + if in.Processes != nil { + in, out := &in.Processes, &out.Processes + *out = new(Processes) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuspendProcessesTypes. +func (in *SuspendProcessesTypes) DeepCopy() *SuspendProcessesTypes { + if in == nil { + return nil + } + out := new(SuspendProcessesTypes) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in Tags) DeepCopyInto(out *Tags) { { diff --git a/pkg/capi/aws/go.mod b/pkg/capi/aws/go.mod new file mode 100644 index 000000000000..843b1db1ef67 --- /dev/null +++ b/pkg/capi/aws/go.mod @@ -0,0 +1,56 @@ +module sigs.k8s.io/cluster-api-provider-aws/v2 + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.go new file mode 100644 index 000000000000..b42d22da923b --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.go @@ -0,0 +1,103 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // AzureASOManagedClusterKind is the kind for AzureASOManagedCluster. + AzureASOManagedClusterKind = "AzureASOManagedCluster" + + // AzureASOManagedControlPlaneFinalizer is the finalizer added to AzureASOManagedControlPlanes. + AzureASOManagedControlPlaneFinalizer = "azureasomanagedcontrolplane.infrastructure.cluster.x-k8s.io" +) + +// AzureASOManagedClusterSpec defines the desired state of AzureASOManagedCluster. +type AzureASOManagedClusterSpec struct { + AzureASOManagedClusterTemplateResourceSpec `json:",inline"` + + // ControlPlaneEndpoint is the location of the API server within the control plane. CAPZ manages this field + // and it should not be set by the user. It fulfills Cluster API's cluster infrastructure provider contract. + // Because this field is programmatically set by CAPZ after resource creation, we define it as +optional + // in the API schema to permit resource admission. + //+optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` +} + +// AzureASOManagedClusterStatus defines the observed state of AzureASOManagedCluster. +type AzureASOManagedClusterStatus struct { + // Ready represents whether or not the cluster has been provisioned and is ready. It fulfills Cluster + // API's cluster infrastructure provider contract. + //+optional + Ready bool `json:"ready"` + + //+optional + Resources []ResourceStatus `json:"resources,omitempty"` +} + +// ResourceStatus represents the status of a resource. +type ResourceStatus struct { + Resource StatusResource `json:"resource"` + Ready bool `json:"ready"` +} + +// StatusResource is a handle to a resource. +type StatusResource struct { + Group string `json:"group"` + Version string `json:"version"` + Kind string `json:"kind"` + Name string `json:"name"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// AzureASOManagedCluster is the Schema for the azureasomanagedclusters API. +type AzureASOManagedCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedClusterSpec `json:"spec,omitempty"` + Status AzureASOManagedClusterStatus `json:"status,omitempty"` +} + +// GetResourceStatuses returns the status of resources. +func (a *AzureASOManagedCluster) GetResourceStatuses() []ResourceStatus { + return a.Status.Resources +} + +// SetResourceStatuses sets the status of resources. +func (a *AzureASOManagedCluster) SetResourceStatuses(r []ResourceStatus) { + a.Status.Resources = r +} + +//+kubebuilder:object:root=true + +// AzureASOManagedClusterList contains a list of AzureASOManagedCluster. +type AzureASOManagedClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedCluster{}, &AzureASOManagedClusterList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.go new file mode 100644 index 000000000000..cc47db0261de --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.go @@ -0,0 +1,63 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// AzureASOManagedClusterTemplateSpec defines the desired state of AzureASOManagedClusterTemplate. +type AzureASOManagedClusterTemplateSpec struct { + Template AzureASOManagedClusterTemplateResource `json:"template"` +} + +// AzureASOManagedClusterTemplateResource defines the templated resource. +type AzureASOManagedClusterTemplateResource struct { + Spec AzureASOManagedClusterTemplateResourceSpec `json:"spec,omitempty"` +} + +// AzureASOManagedClusterTemplateResourceSpec defines the desired state of the templated resource. +type AzureASOManagedClusterTemplateResourceSpec struct { + // Resources are embedded ASO resources to be managed by this resource. + //+optional + Resources []runtime.RawExtension `json:"resources,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// AzureASOManagedClusterTemplate is the Schema for the azureasomanagedclustertemplates API. +type AzureASOManagedClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// AzureASOManagedClusterTemplateList contains a list of AzureASOManagedClusterTemplate. +type AzureASOManagedClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedClusterTemplate{}, &AzureASOManagedClusterTemplateList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.go new file mode 100644 index 000000000000..4a0cb985b208 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.go @@ -0,0 +1,91 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// AzureASOManagedControlPlaneKind is the kind for AzureASOManagedControlPlane. +const AzureASOManagedControlPlaneKind = "AzureASOManagedControlPlane" + +// AzureASOManagedControlPlaneSpec defines the desired state of AzureASOManagedControlPlane. +type AzureASOManagedControlPlaneSpec struct { + AzureASOManagedControlPlaneTemplateResourceSpec `json:",inline"` +} + +// AzureASOManagedControlPlaneStatus defines the observed state of AzureASOManagedControlPlane. +type AzureASOManagedControlPlaneStatus struct { + // Initialized represents whether or not the API server has been provisioned. It fulfills Cluster API's + // control plane provider contract. For AKS, this is equivalent to `ready`. + //+optional + Initialized bool `json:"initialized"` + + // Ready represents whether or not the API server is ready to receive requests. It fulfills Cluster API's + // control plane provider contract. For AKS, this is equivalent to `initialized`. + //+optional + Ready bool `json:"ready"` + + // Version is the observed Kubernetes version of the control plane. It fulfills Cluster API's control + // plane provider contract. + //+optional + Version string `json:"version,omitempty"` + + //+optional + Resources []ResourceStatus `json:"resources,omitempty"` + + // ControlPlaneEndpoint represents the endpoint for the cluster's API server. + //+optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// AzureASOManagedControlPlane is the Schema for the azureasomanagedcontrolplanes API. +type AzureASOManagedControlPlane struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedControlPlaneSpec `json:"spec,omitempty"` + Status AzureASOManagedControlPlaneStatus `json:"status,omitempty"` +} + +// GetResourceStatuses returns the status of resources. +func (a *AzureASOManagedControlPlane) GetResourceStatuses() []ResourceStatus { + return a.Status.Resources +} + +// SetResourceStatuses sets the status of resources. +func (a *AzureASOManagedControlPlane) SetResourceStatuses(r []ResourceStatus) { + a.Status.Resources = r +} + +//+kubebuilder:object:root=true + +// AzureASOManagedControlPlaneList contains a list of AzureASOManagedControlPlane. +type AzureASOManagedControlPlaneList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedControlPlane `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedControlPlane{}, &AzureASOManagedControlPlaneList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplanetemplate_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplanetemplate_types.go new file mode 100644 index 000000000000..6fce8124e5cb --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplanetemplate_types.go @@ -0,0 +1,68 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// AzureASOManagedControlPlaneTemplateSpec defines the desired state of AzureASOManagedControlPlane. +type AzureASOManagedControlPlaneTemplateSpec struct { + Template AzureASOManagedControlPlaneResource `json:"template"` +} + +// AzureASOManagedControlPlaneResource defines the templated resource. +type AzureASOManagedControlPlaneResource struct { + Spec AzureASOManagedControlPlaneTemplateResourceSpec `json:"spec,omitempty"` +} + +// AzureASOManagedControlPlaneTemplateResourceSpec defines the desired state of the templated resource. +type AzureASOManagedControlPlaneTemplateResourceSpec struct { + // Version is the Kubernetes version of the control plane. It fulfills Cluster API's control plane + // provider contract. + //+optional + Version string `json:"version,omitempty"` + + // Resources are embedded ASO resources to be managed by this resource. + //+optional + Resources []runtime.RawExtension `json:"resources,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// AzureASOManagedControlPlaneTemplate is the Schema for the azureasomanagedcontrolplanetemplates API. +type AzureASOManagedControlPlaneTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedControlPlaneTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// AzureASOManagedControlPlaneTemplateList contains a list of AzureASOManagedControlPlaneTemplate. +type AzureASOManagedControlPlaneTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedControlPlaneTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedControlPlaneTemplate{}, &AzureASOManagedControlPlaneTemplateList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.go new file mode 100644 index 000000000000..160933a1280f --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.go @@ -0,0 +1,86 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // AzureASOManagedMachinePoolKind is the kind for AzureASOManagedMachinePool. + AzureASOManagedMachinePoolKind = "AzureASOManagedMachinePool" + + // ReplicasManagedByAKS is the value of the CAPI replica manager annotation that maps to the AKS built-in autoscaler. + ReplicasManagedByAKS = "aks" +) + +// AzureASOManagedMachinePoolSpec defines the desired state of AzureASOManagedMachinePool. +type AzureASOManagedMachinePoolSpec struct { + AzureASOManagedMachinePoolTemplateResourceSpec `json:",inline"` +} + +// AzureASOManagedMachinePoolStatus defines the observed state of AzureASOManagedMachinePool. +type AzureASOManagedMachinePoolStatus struct { + // Replicas is the current number of provisioned replicas. It fulfills Cluster API's machine pool + // infrastructure provider contract. + //+optional + Replicas int32 `json:"replicas"` + + // Ready represents whether or not the infrastructure is ready to be used. It fulfills Cluster API's + // machine pool infrastructure provider contract. + //+optional + Ready bool `json:"ready"` + + //+optional + Resources []ResourceStatus `json:"resources,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// AzureASOManagedMachinePool is the Schema for the azureasomanagedmachinepools API. +type AzureASOManagedMachinePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedMachinePoolSpec `json:"spec,omitempty"` + Status AzureASOManagedMachinePoolStatus `json:"status,omitempty"` +} + +// GetResourceStatuses returns the status of resources. +func (a *AzureASOManagedMachinePool) GetResourceStatuses() []ResourceStatus { + return a.Status.Resources +} + +// SetResourceStatuses sets the status of resources. +func (a *AzureASOManagedMachinePool) SetResourceStatuses(r []ResourceStatus) { + a.Status.Resources = r +} + +//+kubebuilder:object:root=true + +// AzureASOManagedMachinePoolList contains a list of AzureASOManagedMachinePool. +type AzureASOManagedMachinePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedMachinePool `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedMachinePool{}, &AzureASOManagedMachinePoolList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.go b/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.go new file mode 100644 index 000000000000..a33b0764ddd6 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.go @@ -0,0 +1,67 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// AzureASOManagedMachinePoolTemplateSpec defines the desired state of AzureASOManagedMachinePoolTemplate. +type AzureASOManagedMachinePoolTemplateSpec struct { + Template AzureASOManagedControlPlaneResource `json:"template"` +} + +// AzureASOManagedMachinePoolResource defines the templated resource. +type AzureASOManagedMachinePoolResource struct { + Spec AzureASOManagedMachinePoolTemplateResourceSpec `json:"spec,omitempty"` +} + +// AzureASOManagedMachinePoolTemplateResourceSpec defines the desired state of the templated resource. +type AzureASOManagedMachinePoolTemplateResourceSpec struct { + // ProviderIDList is the list of cloud provider IDs for the instances. It fulfills Cluster API's machine + // pool infrastructure provider contract. + ProviderIDList []string `json:"providerIDList,omitempty"` + + // Resources are embedded ASO resources to be managed by this resource. + //+optional + Resources []runtime.RawExtension `json:"resources,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// AzureASOManagedMachinePoolTemplate is the Schema for the azureasomanagedmachinepooltemplates API. +type AzureASOManagedMachinePoolTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureASOManagedMachinePoolTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// AzureASOManagedMachinePoolTemplateList contains a list of AzureASOManagedMachinePoolTemplate. +type AzureASOManagedMachinePoolTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureASOManagedMachinePoolTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureASOManagedMachinePoolTemplate{}, &AzureASOManagedMachinePoolTemplateList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azurecluster_default.go b/pkg/capi/azure/api/v1beta1/azurecluster_default.go new file mode 100644 index 000000000000..e21c6deccb4a --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azurecluster_default.go @@ -0,0 +1,396 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "k8s.io/utils/ptr" +) + +const ( + // DefaultVnetCIDR is the default Vnet CIDR. + DefaultVnetCIDR = "10.0.0.0/8" + // DefaultControlPlaneSubnetCIDR is the default Control Plane Subnet CIDR. + DefaultControlPlaneSubnetCIDR = "10.0.0.0/16" + // DefaultNodeSubnetCIDR is the default Node Subnet CIDR. + DefaultNodeSubnetCIDR = "10.1.0.0/16" + // DefaultClusterSubnetCIDR is the default Cluster Subnet CIDR. + DefaultClusterSubnetCIDR = "10.0.0.0/16" + // DefaultNodeSubnetCIDRPattern is the pattern that will be used to generate the default subnets CIDRs. + DefaultNodeSubnetCIDRPattern = "10.%d.0.0/16" + // DefaultAzureBastionSubnetCIDR is the default Subnet CIDR for AzureBastion. + DefaultAzureBastionSubnetCIDR = "10.255.255.224/27" + // DefaultAzureBastionSubnetName is the default Subnet Name for AzureBastion. + DefaultAzureBastionSubnetName = "AzureBastionSubnet" + // DefaultAzureBastionSubnetRole is the default Subnet role for AzureBastion. + DefaultAzureBastionSubnetRole = SubnetBastion + // DefaultInternalLBIPAddress is the default internal load balancer ip address. + DefaultInternalLBIPAddress = "10.0.0.100" + // DefaultOutboundRuleIdleTimeoutInMinutes is the default for IdleTimeoutInMinutes for the load balancer. + DefaultOutboundRuleIdleTimeoutInMinutes = 4 + // DefaultAzureCloud is the public cloud that will be used by most users. + DefaultAzureCloud = "AzurePublicCloud" +) + +func (c *AzureCluster) setResourceGroupDefault() { + if c.Spec.ResourceGroup == "" { + c.Spec.ResourceGroup = c.Name + } +} + +func (c *AzureCluster) setAzureEnvironmentDefault() { + if c.Spec.AzureEnvironment == "" { + c.Spec.AzureEnvironment = DefaultAzureCloud + } +} + +// setSubnetDefaults ensures a fully populated, default subnet configuration +// and in certain scenarios creates new, default subnet configurations. + +// If we already have a cluster subnet defined, ensure it has sensible defaults +// for all properties. + +// If we already have a control plane subnet defined, ensure it has sensible defaults +// for all properties. + +// If we don't have either a control plane subnet or a cluster subnet, +// create a new control plane subnet from scratch and populate with sensible defaults. + +// anyNodeSubnetFound tracks whether or not we have one or more node subnets defined. + +// nodeSubnetCounter tracks all node subnets to aid automatic CIDR configuration. + +// Skip all non-node subnets + +// Set has sensible defaults for this existing node subnet. + +// Because there can be multiple node subnets, we have to update any changes +// after applying defaults to the explicit item at the current index. + +// We need at least one subnet for nodes. +// If no node subnets are defined, and there is no cluster subnet defined, +// create a default 10.1.0.0/16 node subnet. + +// NAT gateway only supports the use of IPv4 public IP addresses for outbound connectivity. +// So default use the NAT gateway for outbound traffic in IPv4 cluster instead of loadbalancer. +// We assume that if the ID is set, the subnet already exists so we shouldn't add a NAT gateway. + +func (c *AzureCluster) setVnetPeeringDefaults() { + for i, peering := range c.Spec.NetworkSpec.Vnet.Peerings { + if peering.ResourceGroup == "" { + c.Spec.NetworkSpec.Vnet.Peerings[i].ResourceGroup = c.Spec.ResourceGroup + } + } +} + +// If the API Server ILB feature is enabled, create a default internal LB IP or use the specified one + +// if no private IP is found, we should create a default internal LB IP + +// SetNodeOutboundLBDefaults sets the default values for the NodeOutboundLB. +func (c *AzureCluster) SetNodeOutboundLBDefaults() { + if c.Spec.NetworkSpec.NodeOutboundLB == nil { + if !c.Spec.ControlPlaneEnabled || c.Spec.NetworkSpec.APIServerLB.Type == Internal { + return + } + + var needsOutboundLB bool + for _, subnet := range c.Spec.NetworkSpec.Subnets { + if (subnet.Role == SubnetNode || subnet.Role == SubnetCluster) && subnet.IsIPv6Enabled() { + needsOutboundLB = true + break + } + } + + // If we don't default the outbound LB when there are some subnets with NAT gateway, + // and some without, those without wouldn't have outbound traffic. So taking the + // safer route, we configure the outbound LB in that scenario. + if !needsOutboundLB { + return + } + + c.Spec.NetworkSpec.NodeOutboundLB = &LoadBalancerSpec{} + } + + lb := c.Spec.NetworkSpec.NodeOutboundLB + lb.LoadBalancerClassSpec.setNodeOutboundLBDefaults() + + if lb.Name == "" { + lb.Name = c.ObjectMeta.Name + } + + if lb.FrontendIPsCount == nil { + lb.FrontendIPsCount = ptr.To[int32](1) + } + + c.setOutboundLBFrontendIPs(lb, generateNodeOutboundIPName) + c.SetNodeOutboundLBBackendPoolNameDefault() +} + +// SetControlPlaneOutboundLBDefaults sets the default values for the control plane's outbound LB. +func (c *AzureCluster) SetControlPlaneOutboundLBDefaults() { + lb := c.Spec.NetworkSpec.ControlPlaneOutboundLB + + if lb == nil { + return + } + + lb.LoadBalancerClassSpec.setControlPlaneOutboundLBDefaults() + if lb.Name == "" { + lb.Name = generateControlPlaneOutboundLBName(c.ObjectMeta.Name) + } + if lb.FrontendIPsCount == nil { + lb.FrontendIPsCount = ptr.To[int32](1) + } + c.setOutboundLBFrontendIPs(lb, generateControlPlaneOutboundIPName) + c.SetControlPlaneOutboundLBBackendPoolNameDefault() +} + +// SetBackendPoolNameDefault defaults the backend pool name of the LBs. +func (c *AzureCluster) SetBackendPoolNameDefault() { + c.SetAPIServerLBBackendPoolNameDefault() + c.SetNodeOutboundLBBackendPoolNameDefault() + c.SetControlPlaneOutboundLBBackendPoolNameDefault() +} + +// SetAPIServerLBBackendPoolNameDefault defaults the name of the backend pool for apiserver LB. +func (c *AzureCluster) SetAPIServerLBBackendPoolNameDefault() { + apiServerLB := c.Spec.NetworkSpec.APIServerLB + if apiServerLB.BackendPool.Name == "" { + apiServerLB.BackendPool.Name = generateBackendAddressPoolName(apiServerLB.Name) + } +} + +// SetNodeOutboundLBBackendPoolNameDefault defaults the name of the backend pool for node outbound LB. +func (c *AzureCluster) SetNodeOutboundLBBackendPoolNameDefault() { + nodeOutboundLB := c.Spec.NetworkSpec.NodeOutboundLB + if nodeOutboundLB != nil && nodeOutboundLB.BackendPool.Name == "" { + nodeOutboundLB.BackendPool.Name = generateOutboundBackendAddressPoolName(nodeOutboundLB.Name) + } +} + +// SetControlPlaneOutboundLBBackendPoolNameDefault defaults the name of the backend pool for control plane outbound LB. +func (c *AzureCluster) SetControlPlaneOutboundLBBackendPoolNameDefault() { + controlPlaneOutboundLB := c.Spec.NetworkSpec.ControlPlaneOutboundLB + if controlPlaneOutboundLB != nil && controlPlaneOutboundLB.BackendPool.Name == "" { + controlPlaneOutboundLB.BackendPool.Name = generateOutboundBackendAddressPoolName(generateControlPlaneOutboundLBName(c.ObjectMeta.Name)) + } +} + +// setOutboundLBFrontendIPs sets the frontend ips for the given load balancer. +// The name of the frontend ip is generated using generatePublicIPName function. +func (c *AzureCluster) setOutboundLBFrontendIPs(lb *LoadBalancerSpec, generatePublicIPName func(string) string) { + switch *lb.FrontendIPsCount { + case 0: + lb.FrontendIPs = []FrontendIP{} + case 1: + lb.FrontendIPs = []FrontendIP{ + { + Name: generateFrontendIPConfigName(lb.Name), + PublicIP: &PublicIPSpec{ + Name: generatePublicIPName(c.ObjectMeta.Name), + }, + }, + } + default: + lb.FrontendIPs = make([]FrontendIP, *lb.FrontendIPsCount) + for i := 0; i < int(*lb.FrontendIPsCount); i++ { + lb.FrontendIPs[i] = FrontendIP{ + Name: withIndex(generateFrontendIPConfigName(lb.Name), i+1), + PublicIP: &PublicIPSpec{ + Name: withIndex(generatePublicIPName(c.ObjectMeta.Name), i+1), + }, + } + } + } +} + +func (c *AzureCluster) setBastionDefaults() { + if c.Spec.BastionSpec.AzureBastion != nil { + if c.Spec.BastionSpec.AzureBastion.Name == "" { + c.Spec.BastionSpec.AzureBastion.Name = generateAzureBastionName(c.ObjectMeta.Name) + } + // Ensure defaults for the Subnet settings. + if c.Spec.BastionSpec.AzureBastion.Subnet.Name == "" { + c.Spec.BastionSpec.AzureBastion.Subnet.Name = DefaultAzureBastionSubnetName + } + if len(c.Spec.BastionSpec.AzureBastion.Subnet.CIDRBlocks) == 0 { + c.Spec.BastionSpec.AzureBastion.Subnet.CIDRBlocks = []string{DefaultAzureBastionSubnetCIDR} + } + if c.Spec.BastionSpec.AzureBastion.Subnet.Role == "" { + c.Spec.BastionSpec.AzureBastion.Subnet.Role = DefaultAzureBastionSubnetRole + } + // Ensure defaults for the PublicIP settings. + if c.Spec.BastionSpec.AzureBastion.PublicIP.Name == "" { + c.Spec.BastionSpec.AzureBastion.PublicIP.Name = generateAzureBastionPublicIPName(c.ObjectMeta.Name) + } + } +} + +func (lb *LoadBalancerClassSpec) setAPIServerLBDefaults() { + if lb.Type == "" { + lb.Type = Public + } + if lb.SKU == "" { + lb.SKU = SKUStandard + } + if lb.IdleTimeoutInMinutes == nil { + lb.IdleTimeoutInMinutes = ptr.To[int32](DefaultOutboundRuleIdleTimeoutInMinutes) + } +} + +func (lb *LoadBalancerClassSpec) setNodeOutboundLBDefaults() { + lb.setOutboundLBDefaults() +} + +func (lb *LoadBalancerClassSpec) setControlPlaneOutboundLBDefaults() { + lb.setOutboundLBDefaults() +} + +func (lb *LoadBalancerClassSpec) setOutboundLBDefaults() { + lb.Type = Public + lb.SKU = SKUStandard + if lb.IdleTimeoutInMinutes == nil { + lb.IdleTimeoutInMinutes = ptr.To[int32](DefaultOutboundRuleIdleTimeoutInMinutes) + } +} + +// generateVnetName generates a virtual network name, based on the cluster name. +func generateVnetName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "vnet") +} + +// generateClusterSubnetSubnetName generates a subnet name, based on the cluster name. +func generateClusterSubnetSubnetName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "subnet") +} + +// generateControlPlaneSubnetName generates a node subnet name, based on the cluster name. +func generateControlPlaneSubnetName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "controlplane-subnet") +} + +// generateNodeSubnetName generates a node subnet name, based on the cluster name. +func generateNodeSubnetName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "node-subnet") +} + +// generateAzureBastionName generates an azure bastion name. +func generateAzureBastionName(clusterName string) string { + return fmt.Sprintf("%s-azure-bastion", clusterName) +} + +// generateAzureBastionPublicIPName generates an azure bastion public ip name. +func generateAzureBastionPublicIPName(clusterName string) string { + return fmt.Sprintf("%s-azure-bastion-pip", clusterName) +} + +// generateClusterSecurityGroupName generates a security group name, based on the cluster name. +func generateClusterSecurityGroupName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "nsg") +} + +// generateControlPlaneSecurityGroupName generates a control plane security group name, based on the cluster name. +func generateControlPlaneSecurityGroupName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "controlplane-nsg") +} + +// generateNodeSecurityGroupName generates a node security group name, based on the cluster name. +func generateNodeSecurityGroupName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "node-nsg") +} + +// generateClusterRouteTableName generates a route table name, based on the cluster name. +func generateClusterRouteTableName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "routetable") +} + +// generateNodeRouteTableName generates a node route table name, based on the cluster name. +func generateNodeRouteTableName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "node-routetable") +} + +// generateInternalLBName generates a internal load balancer name, based on the cluster name. +func generateInternalLBName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "internal-lb") +} + +// generatePublicLBName generates a public load balancer name, based on the cluster name. +func generatePublicLBName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "public-lb") +} + +// generateControlPlaneOutboundLBName generates the name of the control plane outbound LB. +func generateControlPlaneOutboundLBName(clusterName string) string { + return fmt.Sprintf("%s-outbound-lb", clusterName) +} + +// generatePublicIPName generates a public IP name, based on the cluster name and a hash. +func generatePublicIPName(clusterName string) string { + return fmt.Sprintf("pip-%s-apiserver", clusterName) +} + +// generateFrontendIPConfigName generates a load balancer frontend IP config name. +func generateFrontendIPConfigName(lbName string) string { + return fmt.Sprintf("%s-%s", lbName, "frontEnd") +} + +// generatePrivateIPConfigName generates a load balancer frontend private IP config name. +func generatePrivateIPConfigName(lbName string) string { + return fmt.Sprintf("%s-%s", lbName, "frontEnd-internal-ip") +} + +// generateNodeOutboundIPName generates a public IP name, based on the cluster name. +func generateNodeOutboundIPName(clusterName string) string { + return fmt.Sprintf("pip-%s-node-outbound", clusterName) +} + +// generateControlPlaneOutboundIPName generates a public IP name, based on the cluster name. +func generateControlPlaneOutboundIPName(clusterName string) string { + return fmt.Sprintf("pip-%s-controlplane-outbound", clusterName) +} + +// generateClusterNatGatewayName generates a NAT gateway name. +func generateClusterNatGatewayName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "natgw") +} + +// generateNatGatewayName generates a NAT gateway name. +func generateNatGatewayName(clusterName string) string { + return fmt.Sprintf("%s-%s", clusterName, "node-natgw") +} + +// generateNatGatewayIPName generates a NAT gateway IP name. +func generateNatGatewayIPName(natGatewayName string) string { + return fmt.Sprintf("pip-%s", natGatewayName) +} + +// withIndex appends the index as suffix to a generated name. +func withIndex(name string, n int) string { + return fmt.Sprintf("%s-%d", name, n) +} + +// generateBackendAddressPoolName generates a load balancer backend address pool name. +func generateBackendAddressPoolName(lbName string) string { + return fmt.Sprintf("%s-%s", lbName, "backendPool") +} + +// generateOutboundBackendAddressPoolName generates a load balancer outbound backend address pool name. +func generateOutboundBackendAddressPoolName(lbName string) string { + return fmt.Sprintf("%s-%s", lbName, "outboundBackendPool") +} diff --git a/pkg/capi/azure/api/v1beta1/azurecluster_types.go b/pkg/capi/azure/api/v1beta1/azurecluster_types.go new file mode 100644 index 000000000000..08195026981a --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azurecluster_types.go @@ -0,0 +1,138 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // ClusterFinalizer allows ReconcileAzureCluster to clean up Azure resources associated with AzureCluster before + // removing it from the apiserver. + ClusterFinalizer = "azurecluster.infrastructure.cluster.x-k8s.io" + + // ClusterLabelNamespace indicates the namespace of the cluster. + ClusterLabelNamespace = "azurecluster.infrastructure.cluster.x-k8s.io/cluster-namespace" +) + +// AzureClusterSpec defines the desired state of AzureCluster. +type AzureClusterSpec struct { + AzureClusterClassSpec `json:",inline"` + + // NetworkSpec encapsulates all things related to Azure network. + // +optional + NetworkSpec NetworkSpec `json:"networkSpec,omitempty"` + + // +optional + ResourceGroup string `json:"resourceGroup,omitempty"` + + // BastionSpec encapsulates all things related to the Bastions in the cluster. + // +optional + BastionSpec BastionSpec `json:"bastionSpec,omitempty"` + + // ControlPlaneEnabled enables control plane components in the cluster. + // +kubebuilder:default=true + // +optional + ControlPlaneEnabled bool `json:"controlPlaneEnabled,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. It is not recommended to set + // this when creating an AzureCluster as CAPZ will set this for you. However, if it is set, CAPZ will not change it. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"` +} + +// AzureClusterStatus defines the observed state of AzureCluster. +type AzureClusterStatus struct { + // FailureDomains specifies the list of unique failure domains for the location/region of the cluster. + // A FailureDomain maps to Availability Zone with an Azure Region (if the region support them). An + // Availability Zone is a separate data center within a region and they can be used to ensure + // the cluster is more resilient to failure. + // See: https://learn.microsoft.com/azure/reliability/availability-zones-overview + // This list will be used by Cluster API to try and spread the machines across the failure domains. + // +optional + FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` + + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Conditions defines current service state of the AzureCluster. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the + // next reconciliation loop. + // +optional + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message" +// +kubebuilder:printcolumn:name="Resource Group",type="string",priority=1,JSONPath=".spec.resourceGroup" +// +kubebuilder:printcolumn:name="SubscriptionID",type="string",priority=1,JSONPath=".spec.subscriptionID" +// +kubebuilder:printcolumn:name="Location",type="string",priority=1,JSONPath=".spec.location" +// +kubebuilder:printcolumn:name="Endpoint",type="string",priority=1,JSONPath=".spec.controlPlaneEndpoint.host",description="Control Plane Endpoint" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureCluster" +// +kubebuilder:resource:path=azureclusters,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// AzureCluster is the Schema for the azureclusters API. +type AzureCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureClusterSpec `json:"spec,omitempty"` + Status AzureClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureClusterList contains a list of AzureClusters. +type AzureClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureCluster `json:"items"` +} + +// GetConditions returns the list of conditions for an AzureCluster API object. +func (c *AzureCluster) GetConditions() clusterv1beta1.Conditions { + return c.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureCluster object. +func (c *AzureCluster) SetConditions(conditions clusterv1beta1.Conditions) { + c.Status.Conditions = conditions +} + +// GetFutures returns the list of long running operation states for an AzureCluster API object. +func (c *AzureCluster) GetFutures() Futures { + return c.Status.LongRunningOperationStates +} + +// SetFutures will set the given long running operation states on an AzureCluster object. +func (c *AzureCluster) SetFutures(futures Futures) { + c.Status.LongRunningOperationStates = futures +} + +func init() { + SchemeBuilder.Register(&AzureCluster{}, &AzureClusterList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azurecluster_validation.go b/pkg/capi/azure/api/v1beta1/azurecluster_validation.go new file mode 100644 index 000000000000..3f2b8584a1df --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azurecluster_validation.go @@ -0,0 +1,630 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "net" + "reflect" + "regexp" + + corev1 "k8s.io/api/core/v1" + + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/utils/ptr" +) + +const ( + // can't use: \/"'[]:|<>+=;,.?*@&, Can't start with underscore. Can't end with period or hyphen. + // not using . in the name to avoid issues when the name is part of DNS name. + clusterNameRegex = `^[a-z0-9][a-z0-9-]{0,42}[a-z0-9]$` + // max length of 44 to allow for cluster name to be used as a prefix for VMs and other resources that + // have limitations as outlined here https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules. + clusterNameMaxLength = 44 + // obtained from https://learn.microsoft.com/rest/api/resources/resourcegroups/createorupdate#uri-parameters. + resourceGroupRegex = `^[-\w\._\(\)]+$` + // described in https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules. + subnetRegex = `^[-\w\._]+$` + loadBalancerRegex = `^[-\w\._]+$` + // MaxLoadBalancerOutboundIPs is the maximum number of outbound IPs in a Standard LoadBalancer frontend configuration. + MaxLoadBalancerOutboundIPs = 16 + // MinLBIdleTimeoutInMinutes is the minimum number of minutes for the LB idle timeout. + MinLBIdleTimeoutInMinutes = 4 + // MaxLBIdleTimeoutInMinutes is the maximum number of minutes for the LB idle timeout. + MaxLBIdleTimeoutInMinutes = 30 + // Network security rules should be a number between 100 and 4096. + // https://learn.microsoft.com/azure/virtual-network/network-security-groups-overview#security-rules + minRulePriority = 100 + maxRulePriority = 4096 + // Must start with 'Microsoft.', then an alpha character, then can include alnum. + serviceEndpointServiceRegexPattern = `^Microsoft\.[a-zA-Z]{1,42}[a-zA-Z0-9]{0,42}$` + // Must start with an alpha character and then can include alnum OR be only *. + serviceEndpointLocationRegexPattern = `^([a-z]{1,42}\d{0,5}|[*])$` + // described in https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules. + privateEndpointRegex = `^[-\w\._]+$` + // resource ID Pattern. + resourceIDPattern = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` +) + +var ( + serviceEndpointServiceRegex = regexp.MustCompile(serviceEndpointServiceRegexPattern) + serviceEndpointLocationRegex = regexp.MustCompile(serviceEndpointLocationRegexPattern) +) + +// validateCluster validates a cluster. + +// validateClusterSpec validates a ClusterSpec. + +// If ClusterSpec has non-nil ExtendedLocation field but not enable EdgeZone feature gate flag, ClusterSpec validation failed. + +// validateClusterName validates ClusterName. +func (c *AzureCluster) validateClusterName() field.ErrorList { + var allErrs field.ErrorList + if len(c.Name) > clusterNameMaxLength { + allErrs = append(allErrs, field.Invalid(field.NewPath("metadata").Child("Name"), c.Name, + fmt.Sprintf("Cluster Name longer than allowed length of %d characters", clusterNameMaxLength))) + } + if success, _ := regexp.MatchString(clusterNameRegex, c.Name); !success { + allErrs = append(allErrs, field.Invalid(field.NewPath("metadata").Child("name"), c.Name, + fmt.Sprintf("Cluster Name doesn't match regex %s, can contain only lowercase alphanumeric characters and '-', must start/end with an alphanumeric character", + clusterNameRegex))) + } + if len(allErrs) == 0 { + return nil + } + return allErrs +} + +// validateBastionSpec validates a BastionSpec. +func validateBastionSpec(bastionSpec BastionSpec, fldPath *field.Path) *field.Error { + if bastionSpec.AzureBastion != nil && bastionSpec.AzureBastion.Sku != StandardBastionHostSku && bastionSpec.AzureBastion.EnableTunneling { + return field.Invalid(fldPath.Child("sku"), bastionSpec.AzureBastion.Sku, + "sku must be Standard if tunneling is enabled") + } + return nil +} + +// validateIdentityRef validates an IdentityRef. +func validateIdentityRef(identityRef *corev1.ObjectReference, fldPath *field.Path) *field.Error { + if identityRef == nil { + return field.Required(fldPath, "identityRef is required") + } + if identityRef.Kind != AzureClusterIdentityKind { + return field.NotSupported(fldPath.Child("name"), identityRef.Name, []string{"AzureClusterIdentity"}) + } + return nil +} + +// validateNetworkSpec validates a NetworkSpec. + +// If the user specifies a resourceGroup for vnet, it means +// that they intend to use a pre-existing vnet. In this case, +// we need to verify the information they provide + +// validateResourceGroup validates a ResourceGroup. +func validateResourceGroup(resourceGroup string, fldPath *field.Path) *field.Error { + if success, _ := regexp.MatchString(resourceGroupRegex, resourceGroup); !success { + return field.Invalid(fldPath, resourceGroup, + fmt.Sprintf("resourceGroup doesn't match regex %s", resourceGroupRegex)) + } + return nil +} + +// validateSubnets validates a list of Subnets. +// When configuring a cluster, it is essential to include either a control-plane subnet and a node subnet, or a user can configure a cluster subnet which will be used as a control-plane subnet and a node subnet. +func validateSubnets(controlPlaneEnabled bool, subnets Subnets, vnet VnetSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + subnetNames := make(map[string]bool, len(subnets)) + requiredSubnetRoles := map[string]bool{ + "node": false, + } + if controlPlaneEnabled { + requiredSubnetRoles["control-plane"] = false + } + clusterSubnet := false + for i, subnet := range subnets { + if err := validateSubnetName(subnet.Name, fldPath.Index(i).Child("name")); err != nil { + allErrs = append(allErrs, err) + } + if _, ok := subnetNames[subnet.Name]; ok { + allErrs = append(allErrs, field.Duplicate(fldPath, subnet.Name)) + } + subnetNames[subnet.Name] = true + if subnet.Role == SubnetCluster { + clusterSubnet = true + } else { + for role := range requiredSubnetRoles { + if role == string(subnet.Role) { + requiredSubnetRoles[role] = true + } + } + } + + for j, rule := range subnet.SecurityGroup.SecurityRules { + if err := validateSecurityRule( + rule, + fldPath.Index(i).Child("securityGroup").Child("securityRules").Index(j), + ); err != nil { + allErrs = append(allErrs, err...) + } + } + allErrs = append(allErrs, validateSubnetCIDR(subnet.CIDRBlocks, vnet.CIDRBlocks, fldPath.Index(i).Child("cidrBlocks"))...) + + if len(subnet.ServiceEndpoints) > 0 { + allErrs = append(allErrs, validateServiceEndpoints(subnet.ServiceEndpoints, fldPath.Index(i).Child("serviceEndpoints"))...) + } + + if len(subnet.PrivateEndpoints) > 0 { + allErrs = append(allErrs, validatePrivateEndpoints(subnet.PrivateEndpoints, subnet.CIDRBlocks, fldPath.Index(i).Child("privateEndpoints"))...) + } + } + + // The clusterSubnet is applicable to both the control-plane and node pools. + // Validation of requiredSubnetRoles is skipped since clusterSubnet is set to true. + if clusterSubnet { + return allErrs + } + + for k, v := range requiredSubnetRoles { + if !v { + allErrs = append(allErrs, field.Required(fldPath, + fmt.Sprintf("required role %s not included in provided subnets", k))) + } + } + return allErrs +} + +// validateSubnetName validates the Name of a Subnet. +func validateSubnetName(name string, fldPath *field.Path) *field.Error { + if success, _ := regexp.Match(subnetRegex, []byte(name)); !success { + return field.Invalid(fldPath, name, + fmt.Sprintf("name of subnet doesn't match regex %s", subnetRegex)) + } + return nil +} + +// validateSubnetCIDR validates the CIDR blocks of a Subnet. +func validateSubnetCIDR(subnetCidrBlocks []string, vnetCidrBlocks []string, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + var vnetNws []*net.IPNet + + for _, vnetCidr := range vnetCidrBlocks { + if _, vnetNw, err := net.ParseCIDR(vnetCidr); err == nil { + vnetNws = append(vnetNws, vnetNw) + } + } + + for _, subnetCidr := range subnetCidrBlocks { + subnetCidrIP, _, err := net.ParseCIDR(subnetCidr) + if err != nil { + allErrs = append(allErrs, field.Invalid(fldPath, subnetCidr, "invalid CIDR format")) + } + + var found bool + for _, vnetNw := range vnetNws { + if vnetNw.Contains(subnetCidrIP) { + found = true + break + } + } + + if !found { + allErrs = append(allErrs, field.Invalid(fldPath, subnetCidr, fmt.Sprintf("subnet CIDR not in vnet address space: %s", vnetCidrBlocks))) + } + } + + return allErrs +} + +// validateVnetCIDR validates the CIDR blocks of a Vnet. +func validateVnetCIDR(vnetCIDRBlocks []string, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + for _, vnetCidr := range vnetCIDRBlocks { + if _, _, err := net.ParseCIDR(vnetCidr); err != nil { + allErrs = append(allErrs, field.Invalid(fldPath, vnetCidr, "invalid CIDR format")) + } + } + return allErrs +} + +// validateVnetPeerings validates a list of virtual network peerings. +func validateVnetPeerings(peerings VnetPeerings, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + vnetIdentifiers := make(map[string]bool, len(peerings)) + + for _, peering := range peerings { + vnetIdentifier := peering.ResourceGroup + "/" + peering.RemoteVnetName + if _, ok := vnetIdentifiers[vnetIdentifier]; ok { + allErrs = append(allErrs, field.Duplicate(fldPath, vnetIdentifier)) + } + vnetIdentifiers[vnetIdentifier] = true + } + return allErrs +} + +// validateLoadBalancerName validates the Name of a Load Balancer. +func validateLoadBalancerName(name string, fldPath *field.Path) *field.Error { + if success, _ := regexp.Match(loadBalancerRegex, []byte(name)); !success { + return field.Invalid(fldPath, name, + fmt.Sprintf("name of load balancer doesn't match regex %s", loadBalancerRegex)) + } + return nil +} + +// validateInternalLBIPAddress validates a InternalLBIPAddress. +func validateInternalLBIPAddress(address string, cidrs []string, fldPath *field.Path) *field.Error { + ip := net.ParseIP(address) + if ip == nil { + return field.Invalid(fldPath, address, + "Internal LB IP address isn't a valid IPv4 or IPv6 address") + } + for _, cidr := range cidrs { + _, subnet, _ := net.ParseCIDR(cidr) + if subnet.Contains(ip) { + return nil + } + } + return field.Invalid(fldPath, address, + fmt.Sprintf("Internal LB IP address needs to be in control plane subnet range (%s)", cidrs)) +} + +// validateSecurityRule validates a SecurityRule. +func validateSecurityRule(rule SecurityRule, fldPath *field.Path) (allErrs field.ErrorList) { + if rule.Priority < minRulePriority || rule.Priority > maxRulePriority { + allErrs = append(allErrs, field.Invalid(fldPath, rule.Priority, fmt.Sprintf("security rule priorities should be between %d and %d", minRulePriority, maxRulePriority))) + } + + if rule.Source != nil && rule.Sources != nil { + allErrs = append(allErrs, field.Invalid(fldPath, rule.Source, "security rule cannot have both source and sources")) + } + + return allErrs +} + +// Name should be valid. + +// Name should be immutable. + +// there should be one public IP for public LB. + +// Note: FrontendIPsCount creates public IPs when set. Therefore, we check for both publicIPCount and FrontendIPsCount to be 1. + +// API Server LB should not have a Private IP if APIServerILB feature is disabled. + +// internal LB should not have a public IP. + +func validateNodeOutboundLB(lb *LoadBalancerSpec, old *LoadBalancerSpec, apiserverLB *LoadBalancerSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + var lbClassSpec, oldClassSpec *LoadBalancerClassSpec + if lb != nil { + lbClassSpec = &lb.LoadBalancerClassSpec + } + if old != nil { + oldClassSpec = &old.LoadBalancerClassSpec + } + apiserverLBClassSpec := apiserverLB.LoadBalancerClassSpec + + allErrs = append(allErrs, validateClassSpecForNodeOutboundLB(lbClassSpec, oldClassSpec, apiserverLBClassSpec, fldPath)...) + + if lb == nil { + return allErrs + } + + if old != nil && old.ID != lb.ID { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("id"), "Node outbound load balancer ID should not be modified after AzureCluster creation.")) + } + + if old != nil && old.Name != lb.Name { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("name"), "Node outbound load balancer Name should not be modified after AzureCluster creation.")) + } + + if old != nil && old.FrontendIPsCount == lb.FrontendIPsCount { + if len(old.FrontendIPs) != len(lb.FrontendIPs) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("frontendIPs"), "Node outbound load balancer FrontendIPs cannot be modified after AzureCluster creation.")) + } + + if len(old.FrontendIPs) == len(lb.FrontendIPs) { + for i, frontEndIP := range lb.FrontendIPs { + oldFrontendIP := old.FrontendIPs[i] + if oldFrontendIP.Name != frontEndIP.Name || !reflect.DeepEqual(*oldFrontendIP.PublicIP, *frontEndIP.PublicIP) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("frontendIPs").Index(i), + "Node outbound load balancer FrontendIPs cannot be modified after AzureCluster creation.")) + } + } + } + } + + if lb.FrontendIPsCount != nil && *lb.FrontendIPsCount > MaxLoadBalancerOutboundIPs { + allErrs = append(allErrs, field.Invalid(fldPath.Child("frontendIPsCount"), *lb.FrontendIPsCount, + fmt.Sprintf("Max front end ips allowed is %d", MaxLoadBalancerOutboundIPs))) + } + + return allErrs +} + +func validateControlPlaneOutboundLB(lb *LoadBalancerSpec, apiserverLB *LoadBalancerSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + var lbClassSpec *LoadBalancerClassSpec + if lb != nil { + lbClassSpec = &lb.LoadBalancerClassSpec + } + apiServerLBClassSpec := apiserverLB.LoadBalancerClassSpec + + allErrs = append(allErrs, validateClassSpecForControlPlaneOutboundLB(lbClassSpec, apiServerLBClassSpec, fldPath)...) + + if apiServerLBClassSpec.Type == Internal && lb != nil { + if lb.FrontendIPsCount != nil && *lb.FrontendIPsCount > MaxLoadBalancerOutboundIPs { + allErrs = append(allErrs, field.Invalid(fldPath.Child("frontendIPsCount"), *lb.FrontendIPsCount, + fmt.Sprintf("Max front end ips allowed is %d", MaxLoadBalancerOutboundIPs))) + } + } + + return allErrs +} + +// validatePrivateDNSZoneName validates the PrivateDNSZoneName. + +// validatePrivateDNSZoneResourceGroup validates the PrivateDNSZoneResourceGroup. +// A private DNS Zone's resource group is valid as long as privateDNSZoneName is provided with the private dns resource group name. +func validatePrivateDNSZoneResourceGroup(privateDNSZoneName string, privateDNSZoneResourceGroup string, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + if privateDNSZoneResourceGroup != "" { + if privateDNSZoneName == "" { + allErrs = append(allErrs, field.Invalid(fldPath, privateDNSZoneName, + "PrivateDNSZoneResourceGroup can only be used when PrivateDNSZoneName is provided")) + } + if err := validateResourceGroup(privateDNSZoneResourceGroup, fldPath); err != nil { + allErrs = append(allErrs, err) + } + } + + return allErrs +} + +// validateCloudProviderConfigOverrides validates CloudProviderConfigOverrides. +func validateCloudProviderConfigOverrides(oldConfig, newConfig *CloudProviderConfigOverrides, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if !reflect.DeepEqual(oldConfig, newConfig) { + allErrs = append(allErrs, field.Invalid(fldPath, newConfig, "cannot change cloudProviderConfigOverrides cluster creation")) + } + return allErrs +} + +func validateClassSpecForAPIServerLB(lb LoadBalancerClassSpec, old *LoadBalancerClassSpec, apiServerLBPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // SKU should be Standard + if lb.SKU != SKUStandard { + allErrs = append(allErrs, field.NotSupported(apiServerLBPath.Child("sku"), lb.SKU, []string{string(SKUStandard)})) + } + + // Type should be Public or Internal. + if lb.Type != Internal && lb.Type != Public { + allErrs = append(allErrs, field.NotSupported(apiServerLBPath.Child("type"), lb.Type, + []string{string(Public), string(Internal)})) + } + + // SKU should be immutable. + if old != nil && old.SKU != "" && old.SKU != lb.SKU { + allErrs = append(allErrs, field.Forbidden(apiServerLBPath.Child("sku"), "API Server load balancer SKU should not be modified after AzureCluster creation.")) + } + + // Type should be immutable. + if old != nil && old.Type != "" && old.Type != lb.Type { + allErrs = append(allErrs, field.Forbidden(apiServerLBPath.Child("type"), "API Server load balancer type should not be modified after AzureCluster creation.")) + } + + // IdletimeoutInMinutes should be immutable. + if old != nil && old.IdleTimeoutInMinutes != nil && !ptr.Equal(old.IdleTimeoutInMinutes, lb.IdleTimeoutInMinutes) { + allErrs = append(allErrs, field.Forbidden(apiServerLBPath.Child("idleTimeoutInMinutes"), "API Server load balancer idle timeout cannot be modified after AzureCluster creation.")) + } + + if lb.IdleTimeoutInMinutes != nil && (*lb.IdleTimeoutInMinutes < MinLBIdleTimeoutInMinutes || *lb.IdleTimeoutInMinutes > MaxLBIdleTimeoutInMinutes) { + allErrs = append(allErrs, field.Invalid(apiServerLBPath.Child("idleTimeoutInMinutes"), *lb.IdleTimeoutInMinutes, + fmt.Sprintf("API Server load balancer idle timeout should be between %d and %d minutes", MinLBIdleTimeoutInMinutes, MaxLBIdleTimeoutInMinutes))) + } + + return allErrs +} + +func validateClassSpecForNodeOutboundLB(lb *LoadBalancerClassSpec, old *LoadBalancerClassSpec, apiserverLB LoadBalancerClassSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // LB can be nil when disabled for private clusters. + if lb == nil && apiserverLB.Type == Internal { + return allErrs + } + + if lb == nil { + allErrs = append(allErrs, field.Required(fldPath, "Node outbound load balancer cannot be nil for public clusters.")) + return allErrs + } + + if old != nil && old.SKU != lb.SKU { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("sku"), "Node outbound load balancer SKU should not be modified after AzureCluster creation.")) + } + + if old != nil && old.Type != lb.Type { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("type"), "Node outbound load balancer Type cannot be modified after AzureCluster creation.")) + } + + if old != nil && !ptr.Equal(old.IdleTimeoutInMinutes, lb.IdleTimeoutInMinutes) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("idleTimeoutInMinutes"), "Node outbound load balancer idle timeout cannot be modified after AzureCluster creation.")) + } + + if lb.IdleTimeoutInMinutes != nil && (*lb.IdleTimeoutInMinutes < MinLBIdleTimeoutInMinutes || *lb.IdleTimeoutInMinutes > MaxLBIdleTimeoutInMinutes) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("idleTimeoutInMinutes"), *lb.IdleTimeoutInMinutes, + fmt.Sprintf("Node outbound idle timeout should be between %d and %d minutes", MinLBIdleTimeoutInMinutes, MaxLBIdleTimeoutInMinutes))) + } + + return allErrs +} + +func validateClassSpecForControlPlaneOutboundLB(lb *LoadBalancerClassSpec, apiserverLB LoadBalancerClassSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + switch apiserverLB.Type { + case Public: + if lb != nil { + allErrs = append(allErrs, field.Forbidden(fldPath, "Control plane outbound load balancer cannot be set for public clusters.")) + } + case Internal: + // Control plane outbound lb can be nil when it's disabled for private clusters. + if lb == nil { + return nil + } + + if lb.IdleTimeoutInMinutes != nil && (*lb.IdleTimeoutInMinutes < MinLBIdleTimeoutInMinutes || *lb.IdleTimeoutInMinutes > MaxLBIdleTimeoutInMinutes) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("idleTimeoutInMinutes"), *lb.IdleTimeoutInMinutes, + fmt.Sprintf("Control plane outbound idle timeout should be between %d and %d minutes", MinLBIdleTimeoutInMinutes, MaxLBIdleTimeoutInMinutes))) + } + } + + return allErrs +} + +func validateServiceEndpoints(serviceEndpoints []ServiceEndpointSpec, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + serviceEndpointsServices := make(map[string]bool, len(serviceEndpoints)) + for i, se := range serviceEndpoints { + if se.Service == "" { + allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("service"), "service is required for all service endpoints")) + } else { + if err := validateServiceEndpointServiceName(se.Service, fldPath.Index(i).Child("service")); err != nil { + allErrs = append(allErrs, err) + } + if _, ok := serviceEndpointsServices[se.Service]; ok { + allErrs = append(allErrs, field.Duplicate(fldPath.Index(i).Child("service"), se.Service)) + } + serviceEndpointsServices[se.Service] = true + } + + if len(se.Locations) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("locations"), "locations are required for all service endpoints")) + } else { + serviceEndpointsLocations := make(map[string]bool, len(se.Locations)) + for j, locationName := range se.Locations { + if err := validateServiceEndpointLocationName(locationName, fldPath.Index(i).Child("locations").Index(j)); err != nil { + allErrs = append(allErrs, err) + } + if _, ok := serviceEndpointsLocations[locationName]; ok { + allErrs = append(allErrs, field.Duplicate(fldPath.Index(i).Child("locations").Index(j), locationName)) + } + serviceEndpointsLocations[locationName] = true + } + } + } + + return allErrs +} + +func validateServiceEndpointServiceName(serviceName string, fldPath *field.Path) *field.Error { + if success := serviceEndpointServiceRegex.MatchString(serviceName); !success { + return field.Invalid(fldPath, serviceName, fmt.Sprintf("service name of endpoint service doesn't match regex %s", serviceEndpointServiceRegexPattern)) + } + return nil +} + +func validateServiceEndpointLocationName(location string, fldPath *field.Path) *field.Error { + if success := serviceEndpointLocationRegex.MatchString(location); !success { + return field.Invalid(fldPath, location, fmt.Sprintf("location doesn't match regex %s", serviceEndpointLocationRegexPattern)) + } + return nil +} + +func validatePrivateEndpoints(privateEndpointSpecs []PrivateEndpointSpec, subnetCIDRs []string, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + for i, pe := range privateEndpointSpecs { + if err := validatePrivateEndpointName(pe.Name, fldPath.Index(i).Child("name")); err != nil { + allErrs = append(allErrs, err) + } + + if len(pe.PrivateLinkServiceConnections) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Index(i), pe.PrivateLinkServiceConnections, "privateLinkServiceConnections cannot be empty")) + } + + for j, privateLinkServiceConnection := range pe.PrivateLinkServiceConnections { + if privateLinkServiceConnection.PrivateLinkServiceID == "" { + allErrs = append(allErrs, field.Required(fldPath.Index(i).Child("privateLinkServiceConnections").Index(j), "privateLinkServiceID is required for all privateLinkServiceConnections in private endpoints")) + } else { + if err := validatePrivateEndpointPrivateLinkServiceConnection(privateLinkServiceConnection, fldPath.Index(i).Child("privateLinkServiceConnections").Index(j)); err != nil { + allErrs = append(allErrs, err) + } + } + } + + for _, privateIP := range pe.PrivateIPAddresses { + if err := validatePrivateEndpointIPAddress(privateIP, subnetCIDRs, fldPath.Index(i).Child("privateIPAddresses")); err != nil { + allErrs = append(allErrs, err) + } + } + } + + return allErrs +} + +// validatePrivateEndpointName validates the Name of a Private Endpoint. +func validatePrivateEndpointName(name string, fldPath *field.Path) *field.Error { + if name == "" { + return field.Invalid(fldPath, name, "name of private endpoint cannot be empty") + } + + if success, _ := regexp.MatchString(privateEndpointRegex, name); !success { + return field.Invalid(fldPath, name, + fmt.Sprintf("name of private endpoint doesn't match regex %s", privateEndpointRegex)) + } + return nil +} + +// validatePrivateEndpointServiceID validates the service ID of a Private Endpoint. +func validatePrivateEndpointPrivateLinkServiceConnection(privateLinkServiceConnection PrivateLinkServiceConnection, fldPath *field.Path) *field.Error { + if success, _ := regexp.MatchString(resourceIDPattern, privateLinkServiceConnection.PrivateLinkServiceID); !success { + return field.Invalid(fldPath, privateLinkServiceConnection.PrivateLinkServiceID, + fmt.Sprintf("private endpoint privateLinkServiceConnection service ID doesn't match regex %s", resourceIDPattern)) + } + if privateLinkServiceConnection.Name != "" { + if success, _ := regexp.MatchString(privateEndpointRegex, privateLinkServiceConnection.Name); !success { + return field.Invalid(fldPath, privateLinkServiceConnection.Name, + fmt.Sprintf("private endpoint privateLinkServiceConnection name doesn't match regex %s", privateEndpointRegex)) + } + } + return nil +} + +// validatePrivateEndpointIPAddress validates a Private Endpoint IP Address. +func validatePrivateEndpointIPAddress(address string, cidrs []string, fldPath *field.Path) *field.Error { + ip := net.ParseIP(address) + if ip == nil { + return field.Invalid(fldPath, address, + "Private Endpoint IP address isn't a valid IPv4 or IPv6 address") + } + + for _, cidr := range cidrs { + _, subnet, _ := net.ParseCIDR(cidr) + if subnet != nil && subnet.Contains(ip) { + return nil + } + } + + return field.Invalid(fldPath, address, + fmt.Sprintf("Private Endpoint IP address needs to be in subnet range (%s)", cidrs)) +} diff --git a/pkg/capi/azure/api/v1beta1/azureclusteridentity_types.go b/pkg/capi/azure/api/v1beta1/azureclusteridentity_types.go new file mode 100644 index 000000000000..83559f407e24 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureclusteridentity_types.go @@ -0,0 +1,132 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// AllowedNamespaces defines the namespaces the clusters are allowed to use the identity from +// NamespaceList takes precedence over the Selector. +type AllowedNamespaces struct { + // A nil or empty list indicates that AzureCluster cannot use the identity from any namespace. + // + // +optional + // +nullable + NamespaceList []string `json:"list"` + // Selector is a selector of namespaces that AzureCluster can + // use this Identity from. This is a standard Kubernetes LabelSelector, + // a label query over a set of resources. The result of matchLabels and + // matchExpressions are ANDed. + // + // A nil or empty selector indicates that AzureCluster cannot use this + // AzureClusterIdentity from any namespace. + // +optional + Selector *metav1.LabelSelector `json:"selector"` +} + +// AzureClusterIdentitySpec defines the parameters that are used to create an AzureIdentity. +type AzureClusterIdentitySpec struct { + // Type is the type of Azure Identity used. + // ServicePrincipal, ServicePrincipalCertificate, UserAssignedMSI, ManualServicePrincipal, UserAssignedIdentityCredential, or WorkloadIdentity. + Type IdentityType `json:"type"` + // ResourceID is the Azure resource ID for the User Assigned MSI resource. + // Only applicable when type is UserAssignedMSI. + // + // Deprecated: This field no longer has any effect. + // + // +optional + ResourceID string `json:"resourceID,omitempty"` + // ClientID is the service principal client ID. + // Both User Assigned MSI and SP can use this field. + ClientID string `json:"clientID"` + // ClientSecret is a secret reference which should contain either a Service Principal password or certificate secret. + // +optional + ClientSecret corev1.SecretReference `json:"clientSecret,omitempty"` + // CertPath is the path where certificates exist. When set, it takes precedence over ClientSecret for types that use certs like ServicePrincipalCertificate. + // +optional + CertPath string `json:"certPath,omitempty"` + // UserAssignedIdentityCredentialsPath is the path where an existing JSON file exists containing the JSON format of + // a UserAssignedIdentityCredentials struct. + // See the msi-dataplane for more details on UserAssignedIdentityCredentials - https://github.com/Azure/msi-dataplane/blob/main/pkg/dataplane/internal/client/models.go#L125 + // +optional + UserAssignedIdentityCredentialsPath string `json:"userAssignedIdentityCredentialsPath,omitempty"` + // UserAssignedIdentityCredentialsCloudType is used with UserAssignedIdentityCredentialsPath to specify the Cloud + // type. Can only be one of the following values: public, china, or usgovernment + // If a value is not specified, defaults to public + // +optional + UserAssignedIdentityCredentialsCloudType string `json:"userAssignedIdentityCredentialsCloudType,omitempty"` + // TenantID is the service principal primary tenant id. + TenantID string `json:"tenantID"` + // AllowedNamespaces is used to identify the namespaces the clusters are allowed to use the identity from. + // Namespaces can be selected either using an array of namespaces or with label selector. + // An empty allowedNamespaces object indicates that AzureClusters can use this identity from any namespace. + // If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided) + // A namespace should be either in the NamespaceList or match with Selector to use the identity. + // + // +optional + // +nullable + AllowedNamespaces *AllowedNamespaces `json:"allowedNamespaces"` +} + +// AzureClusterIdentityStatus defines the observed state of AzureClusterIdentity. +type AzureClusterIdentityStatus struct { + // Conditions defines current service state of the AzureClusterIdentity. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type",description="Type of AzureClusterIdentity" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureClusterIdentity" +// +kubebuilder:resource:path=azureclusteridentities,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// AzureClusterIdentity is the Schema for the azureclustersidentities API. +type AzureClusterIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureClusterIdentitySpec `json:"spec,omitempty"` + Status AzureClusterIdentityStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureClusterIdentityList contains a list of AzureClusterIdentity. +type AzureClusterIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureClusterIdentity `json:"items"` +} + +// GetConditions returns the list of conditions for an AzureClusterIdentity API object. +func (c *AzureClusterIdentity) GetConditions() clusterv1beta1.Conditions { + return c.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureClusterIdentity object. +func (c *AzureClusterIdentity) SetConditions(conditions clusterv1beta1.Conditions) { + c.Status.Conditions = conditions +} + +func init() { + SchemeBuilder.Register(&AzureClusterIdentity{}, &AzureClusterIdentityList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azureclustertemplate_default.go b/pkg/capi/azure/api/v1beta1/azureclustertemplate_default.go new file mode 100644 index 000000000000..dda62db634d3 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureclustertemplate_default.go @@ -0,0 +1,64 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +func (c *AzureClusterTemplate) setBastionTemplateDefaults() { + if c.Spec.Template.Spec.BastionSpec.AzureBastion != nil { + // Ensure defaults for Subnet settings. + if len(c.Spec.Template.Spec.BastionSpec.AzureBastion.Subnet.CIDRBlocks) == 0 { + c.Spec.Template.Spec.BastionSpec.AzureBastion.Subnet.CIDRBlocks = []string{DefaultAzureBastionSubnetCIDR} + } + if c.Spec.Template.Spec.BastionSpec.AzureBastion.Subnet.Role == "" { + c.Spec.Template.Spec.BastionSpec.AzureBastion.Subnet.Role = DefaultAzureBastionSubnetRole + } + } +} + +func (c *AzureClusterTemplate) setNodeOutboundLBDefaults() { + if c.Spec.Template.Spec.NetworkSpec.NodeOutboundLB == nil { + if c.Spec.Template.Spec.NetworkSpec.APIServerLB.Type == Internal { + return + } + + var needsOutboundLB bool + for _, subnet := range c.Spec.Template.Spec.NetworkSpec.Subnets { + if (subnet.Role == SubnetNode || subnet.Role == SubnetCluster) && subnet.IsIPv6Enabled() { + needsOutboundLB = true + break + } + } + + // If we don't default the outbound LB when there are some subnets with NAT gateway, + // and some without, those without wouldn't have outbound traffic. So taking the + // safer route, we configure the outbound LB in that scenario. + if !needsOutboundLB { + return + } + + c.Spec.Template.Spec.NetworkSpec.NodeOutboundLB = &LoadBalancerClassSpec{} + } + + c.Spec.Template.Spec.NetworkSpec.NodeOutboundLB.setNodeOutboundLBDefaults() +} + +func (c *AzureClusterTemplate) setControlPlaneOutboundLBDefaults() { + lb := c.Spec.Template.Spec.NetworkSpec.ControlPlaneOutboundLB + if lb == nil { + return + } + lb.setControlPlaneOutboundLBDefaults() +} diff --git a/pkg/capi/azure/api/v1beta1/azureclustertemplate_types.go b/pkg/capi/azure/api/v1beta1/azureclustertemplate_types.go new file mode 100644 index 000000000000..487a18270bfb --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureclustertemplate_types.go @@ -0,0 +1,56 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AzureClusterTemplateSpec defines the desired state of AzureClusterTemplate. +type AzureClusterTemplateSpec struct { + Template AzureClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=azureclustertemplates,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion + +// AzureClusterTemplate is the Schema for the azureclustertemplates API. +type AzureClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureClusterTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureClusterTemplateList contains a list of AzureClusterTemplate. +type AzureClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureClusterTemplate{}, &AzureClusterTemplateList{}) +} + +// AzureClusterTemplateResource describes the data needed to create an AzureCluster from a template. +type AzureClusterTemplateResource struct { + Spec AzureClusterTemplateResourceSpec `json:"spec"` +} diff --git a/pkg/capi/azure/api/v1beta1/azureclustertemplate_validation.go b/pkg/capi/azure/api/v1beta1/azureclustertemplate_validation.go new file mode 100644 index 000000000000..d8ec35557814 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureclustertemplate_validation.go @@ -0,0 +1,127 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +func (c *AzureClusterTemplate) validateNetworkSpec() field.ErrorList { + var allErrs field.ErrorList + + var needOutboundLB bool + networkSpec := c.Spec.Template.Spec.NetworkSpec + for _, subnet := range networkSpec.Subnets { + if subnet.Role == SubnetNode && subnet.IsIPv6Enabled() { + needOutboundLB = true + break + } + } + if needOutboundLB { + allErrs = append(allErrs, c.validateNodeOutboundLB()...) + } + + return allErrs +} + +func validateSubnetTemplates(subnets SubnetTemplatesSpec, vnet VnetTemplateSpec, fld *field.Path) field.ErrorList { + var allErrs field.ErrorList + subnetNames := make(map[string]bool, len(subnets)) + requiredSubnetRoles := map[string]bool{ + "control-plane": false, + "node": false, + } + + for i, subnet := range subnets { + if err := validateSubnetName(subnet.Name, fld.Index(i).Child("name")); err != nil { + allErrs = append(allErrs, err) + } + if _, ok := subnetNames[subnet.Name]; ok { + allErrs = append(allErrs, field.Duplicate(fld, subnet.Name)) + } + subnetNames[subnet.Name] = true + for role := range requiredSubnetRoles { + if role == string(subnet.Role) { + requiredSubnetRoles[role] = true + } + } + for j, rule := range subnet.SecurityGroup.SecurityRules { + if err := validateSecurityRule( + rule, + fld.Index(i).Child("securityGroup").Child("securityGroup").Child("securityRules").Index(j), + ); err != nil { + allErrs = append(allErrs, err...) + } + } + allErrs = append(allErrs, validateSubnetCIDR(subnet.CIDRBlocks, vnet.CIDRBlocks, fld.Index(i).Child("cidrBlocks"))...) + } + for k, v := range requiredSubnetRoles { + if !v { + allErrs = append(allErrs, field.Required(fld, + fmt.Sprintf("required role %s not included in provided subnets", k))) + } + } + return allErrs +} + +func (c *AzureClusterTemplate) validateAPIServerLB(apiServerLBPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + lb := c.Spec.Template.Spec.NetworkSpec.APIServerLB + allErrs = append(allErrs, validateClassSpecForAPIServerLB(lb, nil, apiServerLBPath)...) + return allErrs +} + +func (c *AzureClusterTemplate) validateNodeOutboundLB() field.ErrorList { + var allErrs field.ErrorList + + fldPath := field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("nodeOutboundLB") + apiserverLB := c.Spec.Template.Spec.NetworkSpec.APIServerLB + lb := c.Spec.Template.Spec.NetworkSpec.NodeOutboundLB + + allErrs = append(allErrs, validateClassSpecForNodeOutboundLB(lb, nil, apiserverLB, fldPath)...) + + return allErrs +} + +func (c *AzureClusterTemplate) validateControlPlaneOutboundLB() field.ErrorList { + var allErrs field.ErrorList + + fldPath := field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("controlPlaneOutboundLB") + apiserverLB := c.Spec.Template.Spec.NetworkSpec.APIServerLB + lb := c.Spec.Template.Spec.NetworkSpec.ControlPlaneOutboundLB + + allErrs = append(allErrs, validateClassSpecForControlPlaneOutboundLB(lb, apiserverLB, fldPath)...) + + return allErrs +} + +func (c *AzureClusterTemplate) validatePrivateDNSZoneResourceGroup() field.ErrorList { + var allErrs field.ErrorList + + fldPath := field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("privateDNSZoneResourceGroup") + networkSpec := c.Spec.Template.Spec.NetworkSpec + + allErrs = append(allErrs, validatePrivateDNSZoneResourceGroup( + networkSpec.PrivateDNSZoneName, + networkSpec.PrivateDNSZoneResourceGroup, + fldPath, + )...) + + return allErrs +} diff --git a/pkg/capi/azure/api/v1beta1/azureimage_validation.go b/pkg/capi/azure/api/v1beta1/azureimage_validation.go new file mode 100644 index 000000000000..d9e14e932e07 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azureimage_validation.go @@ -0,0 +1,146 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// ValidateImage validates an image. +func ValidateImage(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if image == nil { + // allow empty image as it is defaulted in the AzureMachine controller + return allErrs + } + + allErrs = append(allErrs, validateSingleDetailsOnly(image, fldPath)...) + + if image.Marketplace != nil { + allErrs = append(allErrs, validateMarketplaceImage(image, fldPath)...) + } + if image.SharedGallery != nil { + allErrs = append(allErrs, validateSharedGalleryImage(image, fldPath)...) + } + if image.ID != nil { + allErrs = append(allErrs, validateSpecificImage(image, fldPath)...) + } + if image.ComputeGallery != nil { + allErrs = append(allErrs, validateComputeGalleryImage(image, fldPath)...) + } + + return allErrs +} + +func validateSingleDetailsOnly(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + imageDetailsFound := (image.ID != nil) + + if image.Marketplace != nil { + if imageDetailsFound { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("Marketplace"), "Marketplace cannot be used as an image ID has been specified")) + } else { + imageDetailsFound = true + } + } + + if image.SharedGallery != nil { + if imageDetailsFound { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("SharedGallery"), "SharedGallery cannot be used as an image ID. Marketplace or ComputeGallery images has been specified")) + } else { + imageDetailsFound = true + } + } + + if image.ComputeGallery != nil { + if imageDetailsFound { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("ComputeGallery"), "ComputeGallery cannot be used as an image ID. Marketplace or SharedGallery images has been specified")) + } else { + imageDetailsFound = true + } + } + + if !imageDetailsFound { + allErrs = append(allErrs, field.Required(fldPath, "You must supply an ID, Marketplace or ComputeGallery image details")) + } + + return allErrs +} + +func validateComputeGalleryImage(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if image.ComputeGallery.SubscriptionID != nil && image.ComputeGallery.ResourceGroup == nil { + allErrs = append(allErrs, field.Invalid(fldPath.Child("ResourceGroup"), "", "ResourceGroup cannot be empty when SubscriptionID is specified")) + } + if image.ComputeGallery.ResourceGroup != nil && image.ComputeGallery.SubscriptionID == nil { + allErrs = append(allErrs, field.Invalid(fldPath.Child("SubscriptionID"), "", "SubscriptionID cannot be empty when ResourceGroup is specified")) + } + + return allErrs +} + +func validateSharedGalleryImage(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if image.SharedGallery.SubscriptionID == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("SubscriptionID"), "", "SubscriptionID cannot be empty when specifying an AzureSharedGalleryImage")) + } + if image.SharedGallery.ResourceGroup == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("ResourceGroup"), "", "ResourceGroup cannot be empty when specifying an AzureSharedGalleryImage")) + } + if image.SharedGallery.Gallery == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Gallery"), "", "Gallery cannot be empty when specifying an AzureSharedGalleryImage")) + } + if image.SharedGallery.Name == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Name"), "", "Name cannot be empty when specifying an AzureSharedGalleryImage")) + } + if image.SharedGallery.Version == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Version"), "", "Version cannot be empty when specifying an AzureSharedGalleryImage")) + } + + return allErrs +} + +func validateMarketplaceImage(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if image.Marketplace.Publisher == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Publisher"), "", "Publisher cannot be empty when specifying an AzureMarketplaceImage")) + } + if image.Marketplace.Offer == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Offer"), "", "Offer cannot be empty when specifying an AzureMarketplaceImage")) + } + if image.Marketplace.SKU == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("SKU"), "", "SKU cannot be empty when specifying an AzureMarketplaceImage")) + } + if image.Marketplace.Version == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("Version"), "", "Version cannot be empty when specifying an AzureMarketplaceImage")) + } + return allErrs +} + +func validateSpecificImage(image *Image, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if *image.ID == "" { + allErrs = append(allErrs, field.Invalid(fldPath.Child("ID"), "", "ID cannot be empty when specifying an AzureImageByID")) + } + + return allErrs +} diff --git a/pkg/capi/azure/api/v1beta1/azuremachine_default.go b/pkg/capi/azure/api/v1beta1/azuremachine_default.go new file mode 100644 index 000000000000..cbc506ce6cdb --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremachine_default.go @@ -0,0 +1,129 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/uuid" +) + +// ContributorRoleID is the ID of the built-in "Contributor" role. +const ContributorRoleID = "b24988ac-6180-42a0-ab88-20f7382dd24c" + +// SetDefaultSSHPublicKey sets the default SSHPublicKey for an AzureMachine. + +// SetDataDisksDefaults sets the data disk defaults for an AzureMachine. + +// populate all the existing values in the set + +// Look for unique values for unassigned LUNs + +// SetIdentityDefaults sets the defaults for VM Identity. +func (s *AzureMachineSpec) SetIdentityDefaults(subscriptionID string) { + // Ensure the deprecated fields and new fields are not populated simultaneously + if s.RoleAssignmentName != "" && s.SystemAssignedIdentityRole != nil && s.SystemAssignedIdentityRole.Name != "" { + // Both the deprecated and the new fields are both set, return without changes + // and reject the request in the validating webhook which runs later. + return + } + if s.Identity == VMIdentitySystemAssigned { + if s.SystemAssignedIdentityRole == nil { + s.SystemAssignedIdentityRole = &SystemAssignedIdentityRole{} + } + if s.RoleAssignmentName != "" { + // Move the existing value from the deprecated RoleAssignmentName field. + s.SystemAssignedIdentityRole.Name = s.RoleAssignmentName + s.RoleAssignmentName = "" + } else if s.SystemAssignedIdentityRole.Name == "" { + // Default role name to a generated UUID. + s.SystemAssignedIdentityRole.Name = string(uuid.NewUUID()) + } + if s.SystemAssignedIdentityRole.Scope == "" && subscriptionID != "" { + // Default scope to the subscription. + s.SystemAssignedIdentityRole.Scope = fmt.Sprintf("/subscriptions/%s/", subscriptionID) + } + if s.SystemAssignedIdentityRole.DefinitionID == "" && subscriptionID != "" { + // Default role definition ID to Contributor role. + s.SystemAssignedIdentityRole.DefinitionID = fmt.Sprintf("/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/%s", subscriptionID, ContributorRoleID) + } + } +} + +// SetSpotEvictionPolicyDefaults sets the defaults for the spot VM eviction policy. +func (s *AzureMachineSpec) SetSpotEvictionPolicyDefaults() { + if s.SpotVMOptions != nil && s.SpotVMOptions.EvictionPolicy == nil { + defaultPolicy := SpotEvictionPolicyDeallocate + if s.OSDisk.DiffDiskSettings != nil && s.OSDisk.DiffDiskSettings.Option == "Local" { + defaultPolicy = SpotEvictionPolicyDelete + } + s.SpotVMOptions.EvictionPolicy = &defaultPolicy + } +} + +// SetDiagnosticsDefaults sets the defaults for Diagnostic settings for an AzureMachinePool. +func (s *AzureMachineSpec) SetDiagnosticsDefaults() { + bootDiagnosticsDefault := &BootDiagnostics{ + StorageAccountType: ManagedDiagnosticsStorage, + } + + diagnosticsDefault := &Diagnostics{Boot: bootDiagnosticsDefault} + + if s.Diagnostics == nil { + s.Diagnostics = diagnosticsDefault + } + + if s.Diagnostics.Boot == nil { + s.Diagnostics.Boot = bootDiagnosticsDefault + } +} + +// SetNetworkInterfacesDefaults sets the defaults for the network interfaces. +func (s *AzureMachineSpec) SetNetworkInterfacesDefaults() { + // Ensure the deprecated fields and new fields are not populated simultaneously + if (s.SubnetName != "" || s.AcceleratedNetworking != nil) && len(s.NetworkInterfaces) > 0 { + // Both the deprecated and the new fields are both set, return without changes + // and reject the request in the validating webhook which runs later. + return + } + + if len(s.NetworkInterfaces) == 0 { + s.NetworkInterfaces = []NetworkInterface{ + { + SubnetName: s.SubnetName, + AcceleratedNetworking: s.AcceleratedNetworking, + }, + } + s.SubnetName = "" + s.AcceleratedNetworking = nil + } + + // Ensure that PrivateIPConfigs defaults to 1 if not specified. + for i := 0; i < len(s.NetworkInterfaces); i++ { + if s.NetworkInterfaces[i].PrivateIPConfigs == 0 { + s.NetworkInterfaces[i].PrivateIPConfigs = 1 + } + } +} + +// GetOwnerAzureClusterNameAndNamespace returns the owner azure cluster's name and namespace for the given cluster name and namespace. + +// GetSubscriptionID returns the subscription ID for the AzureCluster given the cluster name and namespace. + +// SetDefaults sets to the defaults for the AzureMachineSpec. + +// Fetch the Cluster. diff --git a/pkg/capi/azure/api/v1beta1/azuremachine_types.go b/pkg/capi/azure/api/v1beta1/azuremachine_types.go new file mode 100644 index 000000000000..402888f180ff --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremachine_types.go @@ -0,0 +1,321 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // MachineFinalizer allows ReconcileAzureMachine to clean up Azure resources associated with AzureMachine before + // removing it from the apiserver. + MachineFinalizer = "azuremachine.infrastructure.cluster.x-k8s.io" +) + +// AzureMachineSpec defines the desired state of AzureMachine. +type AzureMachineSpec struct { + // ProviderID is the unique identifier as specified by the cloud provider. + // +optional + ProviderID *string `json:"providerID,omitempty"` + + VMSize string `json:"vmSize"` + + // FailureDomain is the failure domain unique identifier this Machine should be attached to, + // as defined in Cluster API. This relates to an Azure Availability Zone + // +optional + FailureDomain *string `json:"failureDomain,omitempty"` + + // Image is used to provide details of an image to use during VM creation. + // If image details are omitted, the default is to use an Azure Compute Gallery Image + // from CAPZ's community gallery. + // +kubebuilder:validation:nullable + // +optional + Image *Image `json:"image,omitempty"` + + // Identity is the type of identity used for the virtual machine. + // The type 'SystemAssigned' is an implicitly created identity. + // The generated identity will be assigned a Subscription contributor role. + // The type 'UserAssigned' is a standalone Azure resource provided by the user + // and assigned to the VM + // +kubebuilder:default=None + // +optional + Identity VMIdentity `json:"identity,omitempty"` + + // UserAssignedIdentities is a list of standalone Azure identities provided by the user + // The lifecycle of a user-assigned identity is managed separately from the lifecycle of + // the AzureMachine. + // See https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-cli + // +optional + UserAssignedIdentities []UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // SystemAssignedIdentityRole defines the role and scope to assign to the system-assigned identity. + // +optional + SystemAssignedIdentityRole *SystemAssignedIdentityRole `json:"systemAssignedIdentityRole,omitempty"` + + // Deprecated: RoleAssignmentName should be set in the systemAssignedIdentityRole field. + // +optional + RoleAssignmentName string `json:"roleAssignmentName,omitempty"` + + // OSDisk specifies the parameters for the operating system disk of the machine + OSDisk OSDisk `json:"osDisk"` + + // DataDisk specifies the parameters that are used to add one or more data disks to the machine + // +optional + DataDisks []DataDisk `json:"dataDisks,omitempty"` + + // SSHPublicKey is the SSH public key string, base64-encoded to add to a Virtual Machine. Linux only. + // Refer to documentation on how to set up SSH access on Windows instances. + // +optional + SSHPublicKey string `json:"sshPublicKey,omitempty"` + + // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the + // Azure provider. If both the AzureCluster and the AzureMachine specify the same tag name with different values, the + // AzureMachine's value takes precedence. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // AdditionalCapabilities specifies additional capabilities enabled or disabled on the virtual machine. + // +optional + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + + // AllocatePublicIP allows the ability to create dynamic public ips for machines where this value is true. + // +optional + AllocatePublicIP bool `json:"allocatePublicIP,omitempty"` + + // EnableIPForwarding enables IP Forwarding in Azure which is required for some CNI's to send traffic from a pods on one machine + // to another. This is required for IpV6 with Calico in combination with User Defined Routes (set by the Azure Cloud Controller + // manager). Default is false for disabled. + // +optional + EnableIPForwarding bool `json:"enableIPForwarding,omitempty"` + + // Deprecated: AcceleratedNetworking should be set in the networkInterfaces field. + // +kubebuilder:validation:nullable + // +optional + AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"` + + // Diagnostics specifies the diagnostics settings for a virtual machine. + // If not specified then Boot diagnostics (Managed) will be enabled. + // +optional + Diagnostics *Diagnostics `json:"diagnostics,omitempty"` + + // SpotVMOptions allows the ability to specify the Machine should use a Spot VM + // +optional + SpotVMOptions *SpotVMOptions `json:"spotVMOptions,omitempty"` + + // SecurityProfile specifies the Security profile settings for a virtual machine. + // +optional + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + + // Deprecated: SubnetName should be set in the networkInterfaces field. + // +optional + SubnetName string `json:"subnetName,omitempty"` + + // DNSServers adds a list of DNS Server IP addresses to the VM NICs. + // +optional + DNSServers []string `json:"dnsServers,omitempty"` + + // DisableExtensionOperations specifies whether extension operations should be disabled on the virtual machine. + // Use this setting only if VMExtensions are not supported by your image, as it disables CAPZ bootstrapping extension used for detecting Kubernetes bootstrap failure. + // This may only be set to True when no extensions are configured on the virtual machine. + // +optional + DisableExtensionOperations *bool `json:"disableExtensionOperations,omitempty"` + + // DisableVMBootstrapExtension specifies whether the VM bootstrap extension should be disabled on the virtual machine. + // Use this setting if you want to disable only the bootstrapping extension and not all extensions. + // +optional + DisableVMBootstrapExtension *bool `json:"disableVMBootstrapExtension,omitempty"` + + // VMExtensions specifies a list of extensions to be added to the virtual machine. + // +optional + VMExtensions []VMExtension `json:"vmExtensions,omitempty"` + + // NetworkInterfaces specifies a list of network interface configurations. + // If left unspecified, the VM will get a single network interface with a + // single IPConfig in the subnet specified in the cluster's node subnet field. + // The primary interface will be the first networkInterface specified (index 0) in the list. + // +optional + NetworkInterfaces []NetworkInterface `json:"networkInterfaces,omitempty"` + + // CapacityReservationGroupID specifies the capacity reservation group resource id that should be + // used for allocating the virtual machine. + // The field size should be greater than 0 and the field input must start with '/'. + // The input for capacityReservationGroupID must be similar to '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}'. + // The keys which are used should be among 'subscriptions', 'providers' and 'resourcegroups' followed by valid ID or names respectively. + // It is optional but may not be changed once set. + // +optional + CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` +} + +// SpotVMOptions defines the options relevant to running the Machine on Spot VMs. +type SpotVMOptions struct { + // MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + // +optional + MaxPrice *resource.Quantity `json:"maxPrice,omitempty"` + + // EvictionPolicy defines the behavior of the virtual machine when it is evicted. It can be either Delete or Deallocate. + // +optional + EvictionPolicy *SpotEvictionPolicy `json:"evictionPolicy,omitempty"` +} + +// SystemAssignedIdentityRole defines the role and scope to assign to the system assigned identity. +type SystemAssignedIdentityRole struct { + // Name is the name of the role assignment to create for a system assigned identity. It can be any valid UUID. + // If not specified, a random UUID will be generated. + // +optional + Name string `json:"name,omitempty"` + + // DefinitionID is the ID of the role definition to create for a system assigned identity. It can be an Azure built-in role or a custom role. + // Refer to built-in roles: https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles + // +optional + DefinitionID string `json:"definitionID,omitempty"` + + // Scope is the scope that the role assignment or definition applies to. The scope can be any REST resource instance. + // If not specified, the scope will be the subscription. + // +optional + Scope string `json:"scope,omitempty"` +} + +// AzureMachineStatus defines the observed state of AzureMachine. +type AzureMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Addresses contains the Azure instance associated addresses. + // +optional + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // VMState is the provisioning state of the Azure virtual machine. + // +optional + VMState *ProvisioningState `json:"vmState,omitempty"` + + // ErrorReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *string `json:"failureReason,omitempty"` + + // ErrorMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the AzureMachine. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the + // next reconciliation loop. + // +optional + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` +} + +// AdditionalCapabilities enables or disables a capability on the virtual machine. +type AdditionalCapabilities struct { + // UltraSSDEnabled enables or disables Azure UltraSSD capability for the virtual machine. + // Defaults to true if Ultra SSD data disks are specified, + // otherwise it doesn't set the capability on the VM. + // +optional + UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Cluster",type="string",priority=1,JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureMachine belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.vmState",description="Azure VM provisioning state" +// +kubebuilder:printcolumn:name="Machine",type="string",priority=1,JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object to which this AzureMachine belongs" +// +kubebuilder:printcolumn:name="VM ID",type="string",priority=1,JSONPath=".spec.providerID",description="Azure VM ID" +// +kubebuilder:printcolumn:name="VM Size",type="string",priority=1,JSONPath=".spec.vmSize",description="Azure VM Size" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureMachine" +// +kubebuilder:resource:path=azuremachines,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// AzureMachine is the Schema for the azuremachines API. +type AzureMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureMachineSpec `json:"spec,omitempty"` + Status AzureMachineStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureMachineList contains a list of AzureMachine. +type AzureMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureMachine `json:"items"` +} + +// GetConditions returns the list of conditions for an AzureMachine API object. +func (m *AzureMachine) GetConditions() clusterv1beta1.Conditions { + return m.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureMachine object. +func (m *AzureMachine) SetConditions(conditions clusterv1beta1.Conditions) { + m.Status.Conditions = conditions +} + +// GetFutures returns the list of long running operation states for an AzureMachine API object. +func (m *AzureMachine) GetFutures() Futures { + return m.Status.LongRunningOperationStates +} + +// SetFutures will set the given long running operation states on an AzureMachine object. +func (m *AzureMachine) SetFutures(futures Futures) { + m.Status.LongRunningOperationStates = futures +} + +func init() { + SchemeBuilder.Register(&AzureMachine{}, &AzureMachineList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azuremachine_validation.go b/pkg/capi/azure/api/v1beta1/azuremachine_validation.go new file mode 100644 index 000000000000..14958524a04a --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremachine_validation.go @@ -0,0 +1,251 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/utils/ptr" +) + +// ValidateAzureMachineSpec checks an AzureMachineSpec and returns any validation errors. + +// ValidateNetwork validates the network configuration. +func ValidateNetwork(subnetName string, acceleratedNetworking *bool, networkInterfaces []NetworkInterface, fldPath *field.Path) field.ErrorList { + if (networkInterfaces != nil) && len(networkInterfaces) > 0 && subnetName != "" { + return field.ErrorList{field.Invalid(fldPath, networkInterfaces, "cannot set both networkInterfaces and machine subnetName")} + } + + if (networkInterfaces != nil) && len(networkInterfaces) > 0 && acceleratedNetworking != nil { + return field.ErrorList{field.Invalid(fldPath, networkInterfaces, "cannot set both networkInterfaces and machine acceleratedNetworking")} + } + + for _, nic := range networkInterfaces { + if nic.PrivateIPConfigs < 1 { + return field.ErrorList{field.Invalid(fldPath, networkInterfaces, "number of privateIPConfigs per interface must be at least 1")} + } + } + + return field.ErrorList{} +} + +// ValidateSSHKey validates an SSHKey. + +// ValidateSystemAssignedIdentity validates the system-assigned identities list. + +// ValidateUserAssignedIdentity validates the user-assigned identities list. + +// ValidateSystemAssignedIdentityRole validates the system-assigned identity role. +func ValidateSystemAssignedIdentityRole(identityType VMIdentity, roleAssignmentName string, role *SystemAssignedIdentityRole, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if roleAssignmentName != "" && role != nil && role.Name != "" { + allErrs = append(allErrs, field.Invalid(fldPath, role.Name, "cannot set both roleAssignmentName and systemAssignedIdentityRole.name")) + } + if identityType == VMIdentitySystemAssigned && role != nil { + if role.DefinitionID == "" { + allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "systemAssignedIdentityRole", "definitionID"), role.DefinitionID, "the definitionID field cannot be empty")) + } + if role.Scope == "" { + allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "systemAssignedIdentityRole", "scope"), role.Scope, "the scope field cannot be empty")) + } + } + if identityType != VMIdentitySystemAssigned && role != nil { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "role"), "systemAssignedIdentityRole can only be set when identity is set to SystemAssigned")) + } + return allErrs +} + +// ValidateDataDisks validates a list of data disks. + +// validate that the disk size is between 4 and 32767. + +// validate that all names are unique + +// validate optional managed disk option + +// validate that all LUNs are unique and between 0 and 63. + +// validate cachingType + +// ValidateOSDisk validates the OSDisk spec. + +// validateManagedDisk validates updates to the ManagedDiskParameters field. + +// DiskEncryptionSet can only be set when SecurityEncryptionType is set to DiskWithVMGuestState +// https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#securityencryptiontypes + +// ValidateDataDisksUpdate validates updates to Data disks. +func ValidateDataDisksUpdate(oldDataDisks, newDataDisks []DataDisk, fieldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + diskErrMsg := "adding/removing data disks after machine creation is not allowed" + fieldErrMsg := "modifying data disk's fields after machine creation is not allowed" + + if len(oldDataDisks) != len(newDataDisks) { + allErrs = append(allErrs, field.Invalid(fieldPath, newDataDisks, diskErrMsg)) + return allErrs + } + + oldDisks := make(map[string]DataDisk) + + for _, disk := range oldDataDisks { + oldDisks[disk.NameSuffix] = disk + } + + for i, newDisk := range newDataDisks { + if oldDisk, ok := oldDisks[newDisk.NameSuffix]; ok { + if newDisk.DiskSizeGB != oldDisk.DiskSizeGB { + allErrs = append(allErrs, field.Invalid(fieldPath.Index(i).Child("diskSizeGB"), newDataDisks, fieldErrMsg)) + } + + allErrs = append(allErrs, validateManagedDisksUpdate(oldDisk.ManagedDisk, newDisk.ManagedDisk, fieldPath.Index(i).Child("managedDisk"))...) + + if (newDisk.Lun != nil && oldDisk.Lun != nil) && (*newDisk.Lun != *oldDisk.Lun) { + allErrs = append(allErrs, field.Invalid(fieldPath.Index(i).Child("lun"), newDataDisks, fieldErrMsg)) + } else if (newDisk.Lun != nil && oldDisk.Lun == nil) || (newDisk.Lun == nil && oldDisk.Lun != nil) { + allErrs = append(allErrs, field.Invalid(fieldPath.Index(i).Child("lun"), newDataDisks, fieldErrMsg)) + } + + if newDisk.CachingType != oldDisk.CachingType { + allErrs = append(allErrs, field.Invalid(fieldPath.Index(i).Child("cachingType"), newDataDisks, fieldErrMsg)) + } + } else { + allErrs = append(allErrs, field.Invalid(fieldPath.Index(i).Child("nameSuffix"), newDataDisks, diskErrMsg)) + } + } + + return allErrs +} + +func validateManagedDisksUpdate(oldDiskParams, newDiskParams *ManagedDiskParameters, fieldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + fieldErrMsg := "changing managed disk options after machine creation is not allowed" + + if newDiskParams != nil && oldDiskParams != nil { + if newDiskParams.StorageAccountType != oldDiskParams.StorageAccountType { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("storageAccountType"), newDiskParams, fieldErrMsg)) + } + if newDiskParams.DiskEncryptionSet != nil && oldDiskParams.DiskEncryptionSet != nil { + if newDiskParams.DiskEncryptionSet.ID != oldDiskParams.DiskEncryptionSet.ID { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("diskEncryptionSet").Child("ID"), newDiskParams, fieldErrMsg)) + } + } else if (newDiskParams.DiskEncryptionSet != nil && oldDiskParams.DiskEncryptionSet == nil) || (newDiskParams.DiskEncryptionSet == nil && oldDiskParams.DiskEncryptionSet != nil) { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("diskEncryptionSet"), newDiskParams, fieldErrMsg)) + } + } else if (newDiskParams != nil && oldDiskParams == nil) || (newDiskParams == nil && oldDiskParams != nil) { + allErrs = append(allErrs, field.Invalid(fieldPath, newDiskParams, fieldErrMsg)) + } + + return allErrs +} + +// ValidateDiagnostics validates the Diagnostic spec. +func ValidateDiagnostics(diagnostics *Diagnostics, fieldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + if diagnostics != nil && diagnostics.Boot != nil { + switch diagnostics.Boot.StorageAccountType { + case UserManagedDiagnosticsStorage: + if diagnostics.Boot.UserManaged == nil { + allErrs = append(allErrs, field.Required(fieldPath.Child("UserManaged"), + fmt.Sprintf("userManaged must be specified when storageAccountType is '%s'", UserManagedDiagnosticsStorage))) + } else if diagnostics.Boot.UserManaged.StorageAccountURI == "" { + allErrs = append(allErrs, field.Required(fieldPath.Child("StorageAccountURI"), + fmt.Sprintf("StorageAccountURI cannot be empty when storageAccountType is '%s'", UserManagedDiagnosticsStorage))) + } + case ManagedDiagnosticsStorage: + if diagnostics.Boot.UserManaged != nil && + diagnostics.Boot.UserManaged.StorageAccountURI != "" { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("StorageAccountURI"), diagnostics.Boot.UserManaged.StorageAccountURI, + fmt.Sprintf("StorageAccountURI cannot be set when storageAccountType is '%s'", + ManagedDiagnosticsStorage))) + } + case DisabledDiagnosticsStorage: + if diagnostics.Boot.UserManaged != nil && + diagnostics.Boot.UserManaged.StorageAccountURI != "" { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("StorageAccountURI"), diagnostics.Boot.UserManaged.StorageAccountURI, + fmt.Sprintf("StorageAccountURI cannot be set when storageAccountType is '%s'", + ManagedDiagnosticsStorage))) + } + } + } + + return allErrs +} + +// ValidateConfidentialCompute validates the configuration options when the machine is a Confidential VM. +// https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#vmdisksecurityprofile +// https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#securityencryptiontypes +// https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#uefisettings +func ValidateConfidentialCompute(managedDisk *ManagedDiskParameters, profile *SecurityProfile, fieldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + var securityEncryptionType SecurityEncryptionType + + if managedDisk != nil && managedDisk.SecurityProfile != nil { + securityEncryptionType = managedDisk.SecurityProfile.SecurityEncryptionType + } + + if profile != nil && securityEncryptionType != "" { + // SecurityEncryptionType can only be set for Confindential VMs + if profile.SecurityType != SecurityTypesConfidentialVM { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("SecurityType"), profile.SecurityType, + fmt.Sprintf("SecurityType should be set to '%s' when securityEncryptionType is defined", SecurityTypesConfidentialVM))) + } + + // Confidential VMs require vTPM to be enabled, irrespective of the SecurityEncryptionType used + if profile.UefiSettings == nil { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("UefiSettings"), profile.UefiSettings, + "UefiSettings should be set when securityEncryptionType is defined")) + } + + if profile.UefiSettings != nil && (profile.UefiSettings.VTpmEnabled == nil || !*profile.UefiSettings.VTpmEnabled) { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("VTpmEnabled"), profile.UefiSettings.VTpmEnabled, + "VTpmEnabled should be set to true when securityEncryptionType is defined")) + } + + if securityEncryptionType == SecurityEncryptionTypeDiskWithVMGuestState { + // DiskWithVMGuestState encryption type is not compatible with EncryptionAtHost + if profile.EncryptionAtHost != nil && *profile.EncryptionAtHost { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("EncryptionAtHost"), profile.EncryptionAtHost, + fmt.Sprintf("EncryptionAtHost cannot be set to 'true' when securityEncryptionType is set to '%s'", SecurityEncryptionTypeDiskWithVMGuestState))) + } + + // DiskWithVMGuestState encryption type requires SecureBoot to be enabled + if profile.UefiSettings != nil && (profile.UefiSettings.SecureBootEnabled == nil || !*profile.UefiSettings.SecureBootEnabled) { + allErrs = append(allErrs, field.Invalid(fieldPath.Child("SecureBootEnabled"), profile.UefiSettings.SecureBootEnabled, + fmt.Sprintf("SecureBootEnabled should be set to true when securityEncryptionType is set to '%s'", SecurityEncryptionTypeDiskWithVMGuestState))) + } + } + } + + return allErrs +} + +// ValidateCapacityReservationGroupID validates the capacity reservation group id. + +// ValidateVMExtensions validates the VMExtensions spec. +func ValidateVMExtensions(disableExtensionOperations *bool, vmExtensions []VMExtension, _ *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if ptr.Deref(disableExtensionOperations, false) && len(vmExtensions) > 0 { + allErrs = append(allErrs, field.Forbidden(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "vmExtensions"), "VMExtensions must be empty when DisableExtensionOperations is true")) + } + + return allErrs +} diff --git a/pkg/capi/azure/api/v1beta1/azuremachinetemplate_types.go b/pkg/capi/azure/api/v1beta1/azuremachinetemplate_types.go new file mode 100644 index 000000000000..e9332c91cda8 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremachinetemplate_types.go @@ -0,0 +1,116 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// Architecture represents the CPU architecture of the node. +// Its underlying type is a string and its value can be any of amd64, arm64. +type Architecture string + +// Architecture constants. +const ( + // ArchitectureAmd64 represents the amd64 CPU architecture. + ArchitectureAmd64 Architecture = "amd64" + // ArchitectureArm64 represents the arm64 CPU architecture. + ArchitectureArm64 Architecture = "arm64" +) + +// OperatingSystem represents the operating system of the node. +// Its underlying type is a string and its value can be any of linux, windows. +type OperatingSystem string + +// Operating system constants. +const ( + // OperatingSystemLinux represents the Linux operating system. + OperatingSystemLinux OperatingSystem = "linux" + // OperatingSystemWindows represents the Windows operating system. + OperatingSystemWindows OperatingSystem = "windows" +) + +// NodeInfo contains information about the node's architecture and operating system. +type NodeInfo struct { + // Architecture is the CPU architecture of the node. + // Its underlying type is a string and its value can be any of amd64, arm64. + // +kubebuilder:validation:Enum=amd64;arm64 + // +optional + Architecture Architecture `json:"architecture,omitempty"` + // OperatingSystem is the operating system of the node. + // Its underlying type is a string and its value can be any of linux, windows. + // +kubebuilder:validation:Enum=linux;windows + // +optional + OperatingSystem OperatingSystem `json:"operatingSystem,omitempty"` +} + +// AzureMachineTemplateStatus defines the observed state of AzureMachineTemplate. +type AzureMachineTemplateStatus struct { + // Capacity defines the resource capacity for this machine. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + Capacity corev1.ResourceList `json:"capacity,omitempty"` + + // NodeInfo contains information about the node's architecture and operating system. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + NodeInfo *NodeInfo `json:"nodeInfo,omitempty"` +} + +// AzureMachineTemplateSpec defines the desired state of AzureMachineTemplate. +type AzureMachineTemplateSpec struct { + Template AzureMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=azuremachinetemplates,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status + +// AzureMachineTemplate is the Schema for the azuremachinetemplates API. +type AzureMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureMachineTemplateSpec `json:"spec,omitempty"` + Status AzureMachineTemplateStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureMachineTemplateList contains a list of AzureMachineTemplates. +type AzureMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureMachineTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureMachineTemplate{}, &AzureMachineTemplateList{}) +} + +// AzureMachineTemplateResource describes the data needed to create an AzureMachine from a template. +type AzureMachineTemplateResource struct { + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + // Spec is the specification of the desired behavior of the machine. + Spec AzureMachineSpec `json:"spec"` +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedcluster_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedcluster_types.go new file mode 100644 index 000000000000..f3da4714fea2 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedcluster_types.go @@ -0,0 +1,70 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// AzureManagedClusterSpec defines the desired state of AzureManagedCluster. +type AzureManagedClusterSpec struct { + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // Immutable, populated by the AKS API at create. + // Because this field is programmatically set by CAPZ after resource creation, we define it as +optional + // in the API schema to permit resource admission. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` +} + +// AzureManagedClusterStatus defines the observed state of AzureManagedCluster. +type AzureManagedClusterStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedCluster" +// +kubebuilder:resource:path=azuremanagedclusters,scope=Namespaced,categories=cluster-api,shortName=amc +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion:warning="AzureManagedCluster and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedCluster and related AzureASOManaged resources instead." + +// AzureManagedCluster is the Schema for the azuremanagedclusters API. +type AzureManagedCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedClusterSpec `json:"spec,omitempty"` + Status AzureManagedClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedClusterList contains a list of AzureManagedClusters. +type AzureManagedClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureManagedCluster{}, &AzureManagedClusterList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.go new file mode 100644 index 000000000000..7aedf8b0e606 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AzureManagedClusterTemplateSpec defines the desired state of AzureManagedClusterTemplate. +type AzureManagedClusterTemplateSpec struct { + Template AzureManagedClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=azuremanagedclustertemplates,scope=Namespaced,categories=cluster-api,shortName=amct +// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion:warning="AzureManagedClusterTemplate and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedClusterTemplate and related AzureASOManaged resources instead." + +// AzureManagedClusterTemplate is the Schema for the AzureManagedClusterTemplates API. +type AzureManagedClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedClusterTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedClusterTemplateList contains a list of AzureManagedClusterTemplates. +type AzureManagedClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureManagedClusterTemplate{}, &AzureManagedClusterTemplateList{}) +} + +// AzureManagedClusterTemplateResource describes the data needed to create an AzureManagedCluster from a template. +type AzureManagedClusterTemplateResource struct { + Spec AzureManagedClusterTemplateResourceSpec `json:"spec"` +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.go b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.go new file mode 100644 index 000000000000..de83cc0221c5 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "strings" + + "k8s.io/utils/ptr" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +const ( + // defaultAKSVnetCIDR is the default Vnet CIDR. + defaultAKSVnetCIDR = "10.0.0.0/8" + // defaultAKSNodeSubnetCIDR is the default Node Subnet CIDR. + defaultAKSNodeSubnetCIDR = "10.240.0.0/16" + // defaultAKSVnetCIDRForOverlay is the default Vnet CIDR when Azure CNI overlay is enabled. + defaultAKSVnetCIDRForOverlay = "10.224.0.0/12" + // defaultAKSNodeSubnetCIDRForOverlay is the default Node Subnet CIDR when Azure CNI overlay is enabled. + defaultAKSNodeSubnetCIDRForOverlay = "10.224.0.0/16" +) + +// setDefaultResourceGroupName sets the default ResourceGroupName for an AzureManagedControlPlane. +func (m *AzureManagedControlPlane) setDefaultResourceGroupName() { + if m.Spec.ResourceGroupName == "" { + if clusterName, ok := m.Labels[clusterv1.ClusterNameLabel]; ok { + m.Spec.ResourceGroupName = clusterName + } + } +} + +// setDefaultSSHPublicKey sets the default SSHPublicKey for an AzureManagedControlPlane. + +// setDefaultNodeResourceGroupName sets the default NodeResourceGroup for an AzureManagedControlPlane. +func (m *AzureManagedControlPlane) setDefaultNodeResourceGroupName() { + if m.Spec.NodeResourceGroupName == "" { + m.Spec.NodeResourceGroupName = fmt.Sprintf("MC_%s_%s_%s", m.Spec.ResourceGroupName, m.Name, m.Spec.Location) + } +} + +// setDefaultVirtualNetwork sets the default VirtualNetwork for an AzureManagedControlPlane. +func (m *AzureManagedControlPlane) setDefaultVirtualNetwork() { + if m.Spec.VirtualNetwork.Name == "" { + m.Spec.VirtualNetwork.Name = m.Name + } + if m.Spec.VirtualNetwork.CIDRBlock == "" { + m.Spec.VirtualNetwork.CIDRBlock = defaultAKSVnetCIDR + if ptr.Deref(m.Spec.NetworkPluginMode, "") == NetworkPluginModeOverlay { + m.Spec.VirtualNetwork.CIDRBlock = defaultAKSVnetCIDRForOverlay + } + } + if m.Spec.VirtualNetwork.ResourceGroup == "" { + m.Spec.VirtualNetwork.ResourceGroup = m.Spec.ResourceGroupName + } +} + +// setDefaultSubnet sets the default Subnet for an AzureManagedControlPlane. +func (m *AzureManagedControlPlane) setDefaultSubnet() { + if m.Spec.VirtualNetwork.Subnet.Name == "" { + m.Spec.VirtualNetwork.Subnet.Name = m.Name + } + if m.Spec.VirtualNetwork.Subnet.CIDRBlock == "" { + m.Spec.VirtualNetwork.Subnet.CIDRBlock = defaultAKSNodeSubnetCIDR + if ptr.Deref(m.Spec.NetworkPluginMode, "") == NetworkPluginModeOverlay { + m.Spec.VirtualNetwork.Subnet.CIDRBlock = defaultAKSNodeSubnetCIDRForOverlay + } + } +} + +// setDefaultFleetsMember sets the default FleetsMember for an AzureManagedControlPlane. +func setDefaultFleetsMember(fleetsMember *FleetsMember, labels map[string]string) *FleetsMember { + result := fleetsMember.DeepCopy() + if fleetsMember != nil { + if clusterName, ok := labels[clusterv1.ClusterNameLabel]; ok && fleetsMember.Name == "" { + result.Name = clusterName + } + } + return result +} + +func setDefaultVersion(version string) string { + if version != "" && !strings.HasPrefix(version, "v") { + normalizedVersion := "v" + version + version = normalizedVersion + } + return version +} + +func (m *AzureManagedControlPlane) setDefaultOIDCIssuerProfile() { + if m.Spec.OIDCIssuerProfile == nil { + m.Spec.OIDCIssuerProfile = &OIDCIssuerProfile{} + } +} + +func (m *AzureManagedControlPlane) setDefaultDNSPrefix() { + if m.Spec.DNSPrefix == nil { + m.Spec.DNSPrefix = ptr.To(m.Name) + } +} + +func (m *AzureManagedControlPlane) setDefaultAKSExtensions() { + for _, extension := range m.Spec.Extensions { + if extension.Plan != nil && extension.Plan.Name == "" { + extension.Plan.Name = fmt.Sprintf("%s-%s", m.Name, extension.Plan.Product) + } + } +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.go new file mode 100644 index 000000000000..0f4055684fe6 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.go @@ -0,0 +1,713 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // ManagedClusterFinalizer allows Reconcile to clean up Azure resources associated with the AzureManagedControlPlane before + // removing it from the apiserver. + ManagedClusterFinalizer = "azuremanagedcontrolplane.infrastructure.cluster.x-k8s.io" +) + +// PrivateDNSZoneMode determines the creation of Private DNS Zones in a private cluster. +// When unset or set to the default value of PrivateDNSZoneModeSystem, Private DNS Zones are created. +// When set to PrivateDNSZoneModeNone, Private DNS Zones are not created in a private cluster. +type PrivateDNSZoneMode string + +const ( + // PrivateDNSZoneModeSystem represents mode System for Private DNS Zones. + PrivateDNSZoneModeSystem PrivateDNSZoneMode = "System" + + // PrivateDNSZoneModeNone represents mode None for Private DNS Zones. + PrivateDNSZoneModeNone PrivateDNSZoneMode = "None" +) + +// UpgradeChannel determines the type of upgrade channel for automatically upgrading the cluster. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/auto-upgrade-cluster +type UpgradeChannel string + +const ( + // UpgradeChannelNodeImage automatically upgrades the node image to the latest version available. + // Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from Kubernetes version patching. + UpgradeChannelNodeImage UpgradeChannel = "node-image" + + // UpgradeChannelNone disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + UpgradeChannelNone UpgradeChannel = "none" + + // UpgradeChannelPatch automatically upgrades the cluster to the latest supported patch version when it becomes available + // while keeping the minor version the same. For example, if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4, + // 1.18.6, and 1.19.1 are available, the cluster will be upgraded to 1.17.9. + UpgradeChannelPatch UpgradeChannel = "patch" + + // UpgradeChannelRapid automatically upgrades the cluster to the latest supported patch release on the latest supported minor + // version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest + // supported minor version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example, + // if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster + // will first be upgraded to 1.18.6 and then to 1.19.1. + UpgradeChannelRapid UpgradeChannel = "rapid" + + // UpgradeChannelStable automatically upgrade the cluster to the latest supported patch release on minor version N-1, where + // N is the latest supported minor version. For example, if a cluster is running version 1.17.7 while versions 1.17.9, 1.18.4, + // 1.18.6, and 1.19.1 are available, the cluster will be upgraded to 1.18.6. + UpgradeChannelStable UpgradeChannel = "stable" +) + +// ManagedControlPlaneOutboundType enumerates the values for the managed control plane OutboundType. +type ManagedControlPlaneOutboundType string + +const ( + // ManagedControlPlaneOutboundTypeLoadBalancer ... + ManagedControlPlaneOutboundTypeLoadBalancer ManagedControlPlaneOutboundType = "loadBalancer" + // ManagedControlPlaneOutboundTypeManagedNATGateway ... + ManagedControlPlaneOutboundTypeManagedNATGateway ManagedControlPlaneOutboundType = "managedNATGateway" + // ManagedControlPlaneOutboundTypeUserAssignedNATGateway ... + ManagedControlPlaneOutboundTypeUserAssignedNATGateway ManagedControlPlaneOutboundType = "userAssignedNATGateway" + // ManagedControlPlaneOutboundTypeUserDefinedRouting ... + ManagedControlPlaneOutboundTypeUserDefinedRouting ManagedControlPlaneOutboundType = "userDefinedRouting" +) + +// ManagedControlPlaneIdentityType enumerates the values for managed control plane identity type. +type ManagedControlPlaneIdentityType string + +const ( + // ManagedControlPlaneIdentityTypeSystemAssigned Use an implicitly created system-assigned managed identity to manage + // cluster resources. Components in the control plane such as kube-controller-manager will use the + // system-assigned managed identity to manipulate Azure resources. + ManagedControlPlaneIdentityTypeSystemAssigned ManagedControlPlaneIdentityType = ManagedControlPlaneIdentityType(VMIdentitySystemAssigned) + // ManagedControlPlaneIdentityTypeUserAssigned Use a user-assigned identity to manage cluster resources. + // Components in the control plane such as kube-controller-manager will use the specified user-assigned + // managed identity to manipulate Azure resources. + ManagedControlPlaneIdentityTypeUserAssigned ManagedControlPlaneIdentityType = ManagedControlPlaneIdentityType(VMIdentityUserAssigned) +) + +// NetworkPluginMode is the mode the network plugin should use. +type NetworkPluginMode string + +const ( + // NetworkPluginModeOverlay is used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure + // Routing Domains rather than Kubenet's method of route tables. + // See also [AKS doc]. + // + // [AKS doc]: https://aka.ms/aks/azure-cni-overlay + NetworkPluginModeOverlay NetworkPluginMode = "overlay" +) + +// NetworkDataplaneType is the type of network dataplane to use. +type NetworkDataplaneType string + +const ( + // NetworkDataplaneTypeAzure is the Azure network dataplane type. + NetworkDataplaneTypeAzure NetworkDataplaneType = "azure" + // NetworkDataplaneTypeCilium is the Cilium network dataplane type. + NetworkDataplaneTypeCilium NetworkDataplaneType = "cilium" +) + +const ( + // LoadBalancerSKUStandard is the Standard load balancer SKU. + LoadBalancerSKUStandard = "Standard" + // LoadBalancerSKUBasic is the Basic load balancer SKU. + LoadBalancerSKUBasic = "Basic" +) + +// KeyVaultNetworkAccessTypes defines the types of network access of key vault. +// The possible values are Public and Private. +// The default value is Public. +type KeyVaultNetworkAccessTypes string + +const ( + // KeyVaultNetworkAccessTypesPrivate means the key vault disables public access and enables private link. + KeyVaultNetworkAccessTypesPrivate KeyVaultNetworkAccessTypes = "Private" + + // KeyVaultNetworkAccessTypesPublic means the key vault allows public access from all networks. + KeyVaultNetworkAccessTypesPublic KeyVaultNetworkAccessTypes = "Public" +) + +// AzureManagedControlPlaneSpec defines the desired state of AzureManagedControlPlane. +type AzureManagedControlPlaneSpec struct { + AzureManagedControlPlaneClassSpec `json:",inline"` + + // NodeResourceGroupName is the name of the resource group + // containing cluster IaaS resources. Will be populated to default + // in webhook. + // Immutable. + // +optional + NodeResourceGroupName string `json:"nodeResourceGroupName,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // Immutable, populated by the AKS API at create. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"` + + // SSHPublicKey is a string literal containing an ssh public key base64 encoded. + // Use empty string to autogenerate new key. Use null value to not set key. + // Immutable. + // +optional + SSHPublicKey *string `json:"sshPublicKey,omitempty"` + + // DNSPrefix allows the user to customize dns prefix. + // Immutable. + // +optional + DNSPrefix *string `json:"dnsPrefix,omitempty"` + + // FleetsMember is the spec for the fleet this cluster is a member of. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/2023-03-15-preview/fleets/members + // +optional + FleetsMember *FleetsMember `json:"fleetsMember,omitempty"` +} + +// ManagedClusterSecurityProfile defines the security profile for the cluster. +type ManagedClusterSecurityProfile struct { + // AzureKeyVaultKms defines Azure Key Vault Management Services Profile for the security profile. + // +optional + AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` + + // Defender settings for the security profile. + // +optional + Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` + + // ImageCleaner settings for the security profile. + // +optional + ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` + + // Workloadidentity enables Kubernetes applications to access Azure cloud resources securely with Azure AD. Ensure to enable OIDC issuer while enabling Workload Identity + // +optional + WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` +} + +// ManagedClusterSecurityProfileDefender defines Microsoft Defender settings for the security profile. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable +type ManagedClusterSecurityProfileDefender struct { + // LogAnalyticsWorkspaceResourceID is the ID of the Log Analytics workspace that has to be associated with Microsoft Defender. + // When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. + // +kubebuilder:validation:Required + LogAnalyticsWorkspaceResourceID string `json:"logAnalyticsWorkspaceResourceID"` + + // SecurityMonitoring profile defines the Microsoft Defender threat detection for Cloud settings for the security profile. + // +kubebuilder:validation:Required + SecurityMonitoring ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring"` +} + +// ManagedClusterSecurityProfileDefenderSecurityMonitoring settings for the security profile threat detection. +type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { + // Enabled enables Defender threat detection + // +kubebuilder:validation:Required + Enabled bool `json:"enabled"` +} + +// ManagedClusterSecurityProfileImageCleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/image-cleaner +type ManagedClusterSecurityProfileImageCleaner struct { + // Enabled enables the Image Cleaner on AKS cluster. + // +kubebuilder:validation:Required + Enabled bool `json:"enabled"` + + // IntervalHours defines Image Cleaner scanning interval in hours. Default value is 24 hours. + // +optional + // +kubebuilder:validation:Minimum=24 + // +kubebuilder:validation:Maximum=2160 + IntervalHours *int `json:"intervalHours,omitempty"` +} + +// ManagedClusterSecurityProfileWorkloadIdentity settings for the security profile. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/defender-for-cloud/defender-for-containers-enable +type ManagedClusterSecurityProfileWorkloadIdentity struct { + // Enabled enables the workload identity. + // +kubebuilder:validation:Required + Enabled bool `json:"enabled"` +} + +// AzureKeyVaultKms service settings for the security profile. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/use-kms-etcd-encryption#update-key-vault-mode +type AzureKeyVaultKms struct { + // Enabled enables the Azure Key Vault key management service. The default is false. + // +kubebuilder:validation:Required + Enabled bool `json:"enabled"` + + // KeyID defines the Identifier of Azure Key Vault key. + // When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. + // +kubebuilder:validation:Required + KeyID string `json:"keyID"` + + // KeyVaultNetworkAccess defines the network access of key vault. + // The possible values are Public and Private. + // Public means the key vault allows public access from all networks. + // Private means the key vault disables public access and enables private link. The default value is Public. + // +optional + // +kubebuilder:default:=Public + KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"` + + // KeyVaultResourceID is the Resource ID of key vault. When keyVaultNetworkAccess is Private, this field is required and must be a valid resource ID. + // +optional + KeyVaultResourceID *string `json:"keyVaultResourceID,omitempty"` +} + +// HTTPProxyConfig is the HTTP proxy configuration for the cluster. +type HTTPProxyConfig struct { + // HTTPProxy is the HTTP proxy server endpoint to use. + // +optional + HTTPProxy *string `json:"httpProxy,omitempty"` + + // HTTPSProxy is the HTTPS proxy server endpoint to use. + // +optional + HTTPSProxy *string `json:"httpsProxy,omitempty"` + + // NoProxy indicates the endpoints that should not go through proxy. + // +optional + NoProxy []string `json:"noProxy,omitempty"` + + // TrustedCA is the alternative CA cert to use for connecting to proxy servers. + // +optional + TrustedCA *string `json:"trustedCa,omitempty"` +} + +// AADProfile - AAD integration managed by AKS. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/managed-aad +type AADProfile struct { + // Managed - Whether to enable managed AAD. + // +kubebuilder:validation:Required + Managed bool `json:"managed"` + + // AdminGroupObjectIDs - AAD group object IDs that will have admin role of the cluster. + // +kubebuilder:validation:Required + AdminGroupObjectIDs []string `json:"adminGroupObjectIDs"` +} + +// AddonProfile represents a managed cluster add-on. +type AddonProfile struct { + // Name - The name of the managed cluster add-on. + Name string `json:"name"` + + // Config - Key-value pairs for configuring the add-on. + // +optional + Config map[string]string `json:"config,omitempty"` + + // Enabled - Whether the add-on is enabled or not. + Enabled bool `json:"enabled"` +} + +// AzureManagedControlPlaneSkuTier - Tier of a managed cluster SKU. +// +kubebuilder:validation:Enum=Free;Paid;Standard +type AzureManagedControlPlaneSkuTier string + +const ( + // FreeManagedControlPlaneTier is the free tier of AKS without corresponding SLAs. + FreeManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Free" + // PaidManagedControlPlaneTier is the paid tier of AKS with corresponding SLAs. + // Deprecated. It has been replaced with StandardManagedControlPlaneTier. + PaidManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Paid" + // StandardManagedControlPlaneTier is the standard tier of AKS with corresponding SLAs. + StandardManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Standard" +) + +// AKSSku - AKS SKU. +type AKSSku struct { + // Tier - Tier of an AKS cluster. + // +kubebuilder:default:="Free" + Tier AzureManagedControlPlaneSkuTier `json:"tier"` +} + +// LoadBalancerProfile - Profile of the cluster load balancer. +// At most one of `managedOutboundIPs`, `outboundIPPrefixes`, or `outboundIPs` may be specified. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/load-balancer-standard +type LoadBalancerProfile struct { + // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. + // +optional + ManagedOutboundIPs *int `json:"managedOutboundIPs,omitempty"` + + // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. + // +optional + OutboundIPPrefixes []string `json:"outboundIPPrefixes,omitempty"` + + // OutboundIPs - Desired outbound IP resources for the cluster load balancer. + // +optional + OutboundIPs []string `json:"outboundIPs,omitempty"` + + // AllocatedOutboundPorts - Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + // +optional + AllocatedOutboundPorts *int `json:"allocatedOutboundPorts,omitempty"` + + // IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + // +optional + IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"` +} + +// APIServerAccessProfile tunes the accessibility of the cluster's control plane. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/api-server-authorized-ip-ranges +type APIServerAccessProfile struct { + // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. + // +optional + AuthorizedIPRanges []string `json:"authorizedIPRanges,omitempty"` + + APIServerAccessProfileClassSpec `json:",inline"` +} + +// ManagedControlPlaneVirtualNetwork describes a virtual network required to provision AKS clusters. +type ManagedControlPlaneVirtualNetwork struct { + // ResourceGroup is the name of the Azure resource group for the VNet and Subnet. + // +optional + ResourceGroup string `json:"resourceGroup,omitempty"` + + // Name is the name of the virtual network. + Name string `json:"name"` + + ManagedControlPlaneVirtualNetworkClassSpec `json:",inline"` +} + +// ManagedControlPlaneSubnet describes a subnet for an AKS cluster. +type ManagedControlPlaneSubnet struct { + Name string `json:"name"` + + // +kubebuilder:default:="10.240.0.0/16" + CIDRBlock string `json:"cidrBlock"` + + // ServiceEndpoints is a slice of Virtual Network service endpoints to enable for the subnets. + // +optional + ServiceEndpoints ServiceEndpoints `json:"serviceEndpoints,omitempty"` + + // PrivateEndpoints is a slice of Virtual Network private endpoints to create for the subnets. + // +optional + PrivateEndpoints PrivateEndpoints `json:"privateEndpoints,omitempty"` +} + +// AzureManagedControlPlaneStatus defines the observed state of AzureManagedControlPlane. +type AzureManagedControlPlaneStatus struct { + // AutoUpgradeVersion is the Kubernetes version populated after auto-upgrade based on the upgrade channel. + // +kubebuilder:validation:MinLength=2 + // +optional + AutoUpgradeVersion string `json:"autoUpgradeVersion,omitempty"` + + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready,omitempty"` + + // Initialized is true when the control plane is available for initial contact. + // This may occur before the control plane is fully ready. + // In the AzureManagedControlPlane implementation, these are identical. + // +optional + Initialized bool `json:"initialized,omitempty"` + + // Conditions defines current service state of the AzureManagedControlPlane. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the + // next reconciliation loop. + // +optional + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` + + // OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster. + // +optional + OIDCIssuerProfile *OIDCIssuerProfileStatus `json:"oidcIssuerProfile,omitempty"` + + // Version defines the Kubernetes version for the control plane instance. + // +optional + Version string `json:"version"` +} + +// OIDCIssuerProfileStatus is the OIDC issuer profile of the Managed Cluster. +type OIDCIssuerProfileStatus struct { + // IssuerURL is the OIDC issuer url of the Managed Cluster. + // +optional + IssuerURL *string `json:"issuerURL,omitempty"` +} + +// AutoScalerProfile parameters to be applied to the cluster-autoscaler. +// See also [AKS doc], [K8s doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/cluster-autoscaler#use-the-cluster-autoscaler-profile +// [K8s doc]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca +// Default values are from https://learn.microsoft.com/azure/aks/cluster-autoscaler#using-the-autoscaler-profile +type AutoScalerProfile struct { + // BalanceSimilarNodeGroups - Valid values are 'true' and 'false'. The default is false. + // +kubebuilder:validation:Enum="true";"false" + // +kubebuilder:default:="false" + // +optional + BalanceSimilarNodeGroups *BalanceSimilarNodeGroups `json:"balanceSimilarNodeGroups,omitempty"` + // Expander - If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. + // +kubebuilder:validation:Enum=least-waste;most-pods;priority;random + // +kubebuilder:default:="random" + // +optional + Expander *Expander `json:"expander,omitempty"` + // MaxEmptyBulkDelete - The default is 10. + // +kubebuilder:default:="10" + // +optional + MaxEmptyBulkDelete *string `json:"maxEmptyBulkDelete,omitempty"` + // MaxGracefulTerminationSec - The default is 600. + // +kubebuilder:validation:Pattern=`^(\d+)$` + // +kubebuilder:default:="600" + // +optional + MaxGracefulTerminationSec *string `json:"maxGracefulTerminationSec,omitempty"` + // MaxNodeProvisionTime - The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)m$` + // +kubebuilder:default:="15m" + // +optional + MaxNodeProvisionTime *string `json:"maxNodeProvisionTime,omitempty"` + // MaxTotalUnreadyPercentage - The default is 45. The maximum is 100 and the minimum is 0. + // +kubebuilder:validation:Pattern=`^(\d+)$` + // +kubebuilder:validation:MaxLength=3 + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:default:="45" + // +optional + MaxTotalUnreadyPercentage *string `json:"maxTotalUnreadyPercentage,omitempty"` + // NewPodScaleUpDelay - For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + // +optional + // +kubebuilder:default:="0s" + NewPodScaleUpDelay *string `json:"newPodScaleUpDelay,omitempty"` + // OkTotalUnreadyCount - This must be an integer. The default is 3. + // +kubebuilder:validation:Pattern=`^(\d+)$` + // +kubebuilder:default:="3" + // +optional + OkTotalUnreadyCount *string `json:"okTotalUnreadyCount,omitempty"` + // ScanInterval - How often cluster is reevaluated for scale up or down. The default is '10s'. + // +kubebuilder:validation:Pattern=`^(\d+)s$` + // +kubebuilder:default:="10s" + // +optional + ScanInterval *string `json:"scanInterval,omitempty"` + // ScaleDownDelayAfterAdd - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)m$` + // +kubebuilder:default:="10m" + // +optional + ScaleDownDelayAfterAdd *string `json:"scaleDownDelayAfterAdd,omitempty"` + // ScaleDownDelayAfterDelete - The default is the scan-interval. Values must be an integer followed by an 's'. No unit of time other than seconds (s) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)s$` + // +kubebuilder:default:="10s" + // +optional + ScaleDownDelayAfterDelete *string `json:"scaleDownDelayAfterDelete,omitempty"` + // ScaleDownDelayAfterFailure - The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)m$` + // +kubebuilder:default:="3m" + // +optional + ScaleDownDelayAfterFailure *string `json:"scaleDownDelayAfterFailure,omitempty"` + // ScaleDownUnneededTime - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)m$` + // +kubebuilder:default:="10m" + // +optional + ScaleDownUnneededTime *string `json:"scaleDownUnneededTime,omitempty"` + // ScaleDownUnreadyTime - The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + // +kubebuilder:validation:Pattern=`^(\d+)m$` + // +kubebuilder:default:="20m" + // +optional + ScaleDownUnreadyTime *string `json:"scaleDownUnreadyTime,omitempty"` + // ScaleDownUtilizationThreshold - The default is '0.5'. + // +kubebuilder:default:="0.5" + // +optional + ScaleDownUtilizationThreshold *string `json:"scaleDownUtilizationThreshold,omitempty"` + // SkipNodesWithLocalStorage - The default is false. + // +kubebuilder:validation:Enum="true";"false" + // +kubebuilder:default:="false" + // +optional + SkipNodesWithLocalStorage *SkipNodesWithLocalStorage `json:"skipNodesWithLocalStorage,omitempty"` + // SkipNodesWithSystemPods - The default is true. + // +kubebuilder:validation:Enum="true";"false" + // +kubebuilder:default:="true" + // +optional + SkipNodesWithSystemPods *SkipNodesWithSystemPods `json:"skipNodesWithSystemPods,omitempty"` +} + +// BalanceSimilarNodeGroups enumerates the values for BalanceSimilarNodeGroups. +type BalanceSimilarNodeGroups string + +const ( + // BalanceSimilarNodeGroupsTrue ... + BalanceSimilarNodeGroupsTrue BalanceSimilarNodeGroups = "true" + // BalanceSimilarNodeGroupsFalse ... + BalanceSimilarNodeGroupsFalse BalanceSimilarNodeGroups = "false" +) + +// SkipNodesWithLocalStorage enumerates the values for SkipNodesWithLocalStorage. +type SkipNodesWithLocalStorage string + +const ( + // SkipNodesWithLocalStorageTrue ... + SkipNodesWithLocalStorageTrue SkipNodesWithLocalStorage = "true" + // SkipNodesWithLocalStorageFalse ... + SkipNodesWithLocalStorageFalse SkipNodesWithLocalStorage = "false" +) + +// SkipNodesWithSystemPods enumerates the values for SkipNodesWithSystemPods. +type SkipNodesWithSystemPods string + +const ( + // SkipNodesWithSystemPodsTrue ... + SkipNodesWithSystemPodsTrue SkipNodesWithSystemPods = "true" + // SkipNodesWithSystemPodsFalse ... + SkipNodesWithSystemPodsFalse SkipNodesWithSystemPods = "false" +) + +// Expander enumerates the values for Expander. +type Expander string + +const ( + // ExpanderLeastWaste ... + ExpanderLeastWaste Expander = "least-waste" + // ExpanderMostPods ... + ExpanderMostPods Expander = "most-pods" + // ExpanderPriority ... + ExpanderPriority Expander = "priority" + // ExpanderRandom ... + ExpanderRandom Expander = "random" +) + +// Identity represents the Identity configuration for an AKS control plane. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-managed-identity +type Identity struct { + // Type - The Identity type to use. + // +kubebuilder:validation:Enum=SystemAssigned;UserAssigned + // +kubebuilder:default:=SystemAssigned + // +optional + Type ManagedControlPlaneIdentityType `json:"type,omitempty"` + + // UserAssignedIdentityResourceID - Identity ARM resource ID when using user-assigned identity. + // +optional + UserAssignedIdentityResourceID string `json:"userAssignedIdentityResourceID,omitempty"` +} + +// OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer +type OIDCIssuerProfile struct { + // Enabled is whether the OIDC issuer is enabled. + // +kubebuilder:default:=false + // +optional + Enabled *bool `json:"enabled,omitempty"` +} + +// AKSExtension represents the configuration for an AKS cluster extension. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/cluster-extensions +type AKSExtension struct { + // Name is the name of the extension. + Name string `json:"name"` + + // AKSAssignedIdentityType is the type of the AKS assigned identity. + // +optional + AKSAssignedIdentityType AKSAssignedIdentity `json:"aksAssignedIdentityType,omitempty"` + + // AutoUpgradeMinorVersion is a flag to note if this extension participates in auto upgrade of minor version, or not. + // +kubebuilder:default=true + // +optional + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + + // ConfigurationSettings are the name-value pairs for configuring this extension. + // +optional + ConfigurationSettings map[string]string `json:"configurationSettings,omitempty"` + + // ExtensionType is the type of the Extension of which this resource is an instance. + // It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + ExtensionType *string `json:"extensionType"` + + // Plan is the plan of the extension. + // +optional + Plan *ExtensionPlan `json:"plan,omitempty"` + + // ReleaseTrain is the release train this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) + // This is only used if autoUpgradeMinorVersion is ‘true’. + // +optional + ReleaseTrain *string `json:"releaseTrain,omitempty"` + + // Scope is the scope at which this extension is enabled. + // +optional + Scope *ExtensionScope `json:"scope,omitempty"` + + // Version is the version of the extension. + // +optional + Version *string `json:"version,omitempty"` + + // Identity is the identity type of the Extension resource in an AKS cluster. + // +optional + Identity ExtensionIdentity `json:"identity,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedControlPlane belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedControlPlane" +// +kubebuilder:resource:path=azuremanagedcontrolplanes,scope=Namespaced,categories=cluster-api,shortName=amcp +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion:warning="AzureManagedControlPlane and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedControlPlane and related AzureASOManaged resources instead." + +// AzureManagedControlPlane is the Schema for the azuremanagedcontrolplanes API. +type AzureManagedControlPlane struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedControlPlaneSpec `json:"spec,omitempty"` + Status AzureManagedControlPlaneStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedControlPlaneList contains a list of AzureManagedControlPlane. +type AzureManagedControlPlaneList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedControlPlane `json:"items"` +} + +// GetConditions returns the list of conditions for an AzureManagedControlPlane API object. +func (m *AzureManagedControlPlane) GetConditions() clusterv1beta1.Conditions { + return m.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureManagedControlPlane object. +func (m *AzureManagedControlPlane) SetConditions(conditions clusterv1beta1.Conditions) { + m.Status.Conditions = conditions +} + +// GetFutures returns the list of long running operation states for an AzureManagedControlPlane API object. +func (m *AzureManagedControlPlane) GetFutures() Futures { + return m.Status.LongRunningOperationStates +} + +// SetFutures will set the given long running operation states on an AzureManagedControlPlane object. +func (m *AzureManagedControlPlane) SetFutures(futures Futures) { + m.Status.LongRunningOperationStates = futures +} + +func init() { + SchemeBuilder.Register(&AzureManagedControlPlane{}, &AzureManagedControlPlaneList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go new file mode 100644 index 000000000000..8a1b8e5cdd45 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go @@ -0,0 +1,44 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// setDefaultVirtualNetwork sets the default VirtualNetwork for an AzureManagedControlPlaneTemplate. + +// Being able to set the vnet name in the template type is a bug, as vnet names cannot be reused across clusters. +// To avoid a breaking API change, a warning is logged. + +// setDefaultSubnet sets the default Subnet for an AzureManagedControlPlaneTemplate. +func (mcp *AzureManagedControlPlaneTemplate) setDefaultSubnet() { + if mcp.Spec.Template.Spec.VirtualNetwork.Subnet.Name == "" { + mcp.Spec.Template.Spec.VirtualNetwork.Subnet.Name = mcp.Name + } + if mcp.Spec.Template.Spec.VirtualNetwork.Subnet.CIDRBlock == "" { + mcp.Spec.Template.Spec.VirtualNetwork.Subnet.CIDRBlock = defaultAKSNodeSubnetCIDR + } +} + +// setDefault sets the default value for a pointer to a value for any comparable type. +func setDefault[T comparable](field *T, value T) { + if field == nil { + // shouldn't happen with proper use + return + } + var zero T + if *field == zero { + *field = value + } +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.go new file mode 100644 index 000000000000..b722493b0c95 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AzureManagedControlPlaneTemplateSpec defines the desired state of AzureManagedControlPlaneTemplate. +type AzureManagedControlPlaneTemplateSpec struct { + Template AzureManagedControlPlaneTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=azuremanagedcontrolplanetemplates,scope=Namespaced,categories=cluster-api,shortName=amcpt +// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion:warning="AzureManagedControlPlaneTemplate and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedControlPlaneTemplate and related AzureASOManaged resources instead." + +// AzureManagedControlPlaneTemplate is the Schema for the AzureManagedControlPlaneTemplates API. +type AzureManagedControlPlaneTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedControlPlaneTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedControlPlaneTemplateList contains a list of AzureManagedControlPlaneTemplates. +type AzureManagedControlPlaneTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedControlPlaneTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureManagedControlPlaneTemplate{}, &AzureManagedControlPlaneTemplateList{}) +} + +// AzureManagedControlPlaneTemplateResource describes the data needed to create an AzureManagedCluster from a template. +type AzureManagedControlPlaneTemplateResource struct { + Spec AzureManagedControlPlaneTemplateResourceSpec `json:"spec"` +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedmachinepool_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedmachinepool_types.go new file mode 100644 index 000000000000..de21f87f5d54 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedmachinepool_types.go @@ -0,0 +1,537 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // LabelAgentPoolMode represents mode of an agent pool. Possible values include: System, User. + LabelAgentPoolMode = "azuremanagedmachinepool.infrastructure.cluster.x-k8s.io/agentpoolmode" + + // NodePoolModeSystem represents mode system for azuremachinepool. + NodePoolModeSystem NodePoolMode = "System" + + // NodePoolModeUser represents mode user for azuremachinepool. + NodePoolModeUser NodePoolMode = "User" + + // DefaultOSType represents the default operating system for azmachinepool. + DefaultOSType string = LinuxOS +) + +// NodePoolMode enumerates the values for agent pool mode. +type NodePoolMode string + +// CPUManagerPolicy enumerates the values for KubeletConfig.CPUManagerPolicy. +type CPUManagerPolicy string + +const ( + // CPUManagerPolicyNone ... + CPUManagerPolicyNone CPUManagerPolicy = "none" + // CPUManagerPolicyStatic ... + CPUManagerPolicyStatic CPUManagerPolicy = "static" +) + +// TopologyManagerPolicy enumerates the values for KubeletConfig.TopologyManagerPolicy. +type TopologyManagerPolicy string + +// KubeletDiskType enumerates the values for the agent pool's KubeletDiskType. +type KubeletDiskType string + +const ( + // KubeletDiskTypeOS ... + KubeletDiskTypeOS KubeletDiskType = "OS" + // KubeletDiskTypeTemporary ... + KubeletDiskTypeTemporary KubeletDiskType = "Temporary" +) + +const ( + // TopologyManagerPolicyNone ... + TopologyManagerPolicyNone TopologyManagerPolicy = "none" + // TopologyManagerPolicyBestEffort ... + TopologyManagerPolicyBestEffort TopologyManagerPolicy = "best-effort" + // TopologyManagerPolicyRestricted ... + TopologyManagerPolicyRestricted TopologyManagerPolicy = "restricted" + // TopologyManagerPolicySingleNumaNode ... + TopologyManagerPolicySingleNumaNode TopologyManagerPolicy = "single-numa-node" +) + +// TransparentHugePageOption enumerates the values for various modes of Transparent Hugepages. +type TransparentHugePageOption string + +const ( + // TransparentHugePageOptionAlways ... + TransparentHugePageOptionAlways TransparentHugePageOption = "always" + + // TransparentHugePageOptionMadvise ... + TransparentHugePageOptionMadvise TransparentHugePageOption = "madvise" + + // TransparentHugePageOptionNever ... + TransparentHugePageOptionNever TransparentHugePageOption = "never" + + // TransparentHugePageOptionDefer ... + TransparentHugePageOptionDefer TransparentHugePageOption = "defer" + + // TransparentHugePageOptionDeferMadvise ... + TransparentHugePageOptionDeferMadvise TransparentHugePageOption = "defer+madvise" +) + +// KubeletConfig defines the supported subset of kubelet configurations for nodes in pools. +// See also [AKS doc], [K8s doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/custom-node-configuration +// [K8s doc]: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/ +type KubeletConfig struct { + // CPUManagerPolicy - CPU Manager policy to use. + // +kubebuilder:validation:Enum=none;static + // +optional + CPUManagerPolicy *CPUManagerPolicy `json:"cpuManagerPolicy,omitempty"` + // CPUCfsQuota - Enable CPU CFS quota enforcement for containers that specify CPU limits. + // +optional + CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"` + // CPUCfsQuotaPeriod - Sets CPU CFS quota period value. + // Must end in "ms", e.g. "100ms" + // +optional + CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` + // ImageGcHighThreshold - The percent of disk usage after which image garbage collection is always run. + // Valid values are 0-100 (inclusive). + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + // +optional + ImageGcHighThreshold *int `json:"imageGcHighThreshold,omitempty"` + // ImageGcLowThreshold - The percent of disk usage before which image garbage collection is never run. + // Valid values are 0-100 (inclusive) and must be less than `imageGcHighThreshold`. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + // +optional + ImageGcLowThreshold *int `json:"imageGcLowThreshold,omitempty"` + // TopologyManagerPolicy - Topology Manager policy to use. + // +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node + // +optional + TopologyManagerPolicy *TopologyManagerPolicy `json:"topologyManagerPolicy,omitempty"` + // AllowedUnsafeSysctls - Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + // Valid values match `kernel.shm*`, `kernel.msg*`, `kernel.sem`, `fs.mqueue.*`, or `net.*`. + // +optional + AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` + // FailSwapOn - If set to true it will make the Kubelet fail to start if swap is enabled on the node. + // +optional + FailSwapOn *bool `json:"failSwapOn,omitempty"` + // ContainerLogMaxSizeMB - The maximum size in MB of a container log file before it is rotated. + // +optional + ContainerLogMaxSizeMB *int `json:"containerLogMaxSizeMB,omitempty"` + // ContainerLogMaxFiles - The maximum number of container log files that can be present for a container. The number must be ≥ 2. + // +kubebuilder:validation:Minimum=2 + // +optional + ContainerLogMaxFiles *int `json:"containerLogMaxFiles,omitempty"` + // PodMaxPids - The maximum number of processes per pod. + // Must not exceed kernel PID limit. -1 disables the limit. + // +kubebuilder:validation:Minimum=-1 + // +optional + PodMaxPids *int `json:"podMaxPids,omitempty"` +} + +// SysctlConfig specifies the settings for Linux agent nodes. +type SysctlConfig struct { + // FsAioMaxNr specifies the maximum number of system-wide asynchronous io requests. + // Valid values are 65536-6553500 (inclusive). + // Maps to fs.aio-max-nr. + // +kubebuilder:validation:Minimum=65536 + // +kubebuilder:validation:Maximum=6553500 + // +optional + FsAioMaxNr *int `json:"fsAioMaxNr,omitempty"` + + // FsFileMax specifies the max number of file-handles that the Linux kernel will allocate, by increasing increases the maximum number of open files permitted. + // Valid values are 8192-12000500 (inclusive). + // Maps to fs.file-max. + // +kubebuilder:validation:Minimum=8192 + // +kubebuilder:validation:Maximum=12000500 + // +optional + FsFileMax *int `json:"fsFileMax,omitempty"` + + // FsInotifyMaxUserWatches specifies the number of file watches allowed by the system. Each watch is roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes on a 64-bit kernel. + // Valid values are 781250-2097152 (inclusive). + // Maps to fs.inotify.max_user_watches. + // +kubebuilder:validation:Minimum=781250 + // +kubebuilder:validation:Maximum=2097152 + // +optional + FsInotifyMaxUserWatches *int `json:"fsInotifyMaxUserWatches,omitempty"` + + // FsNrOpen specifies the maximum number of file-handles a process can allocate. + // Valid values are 8192-20000500 (inclusive). + // Maps to fs.nr_open. + // +kubebuilder:validation:Minimum=8192 + // +kubebuilder:validation:Maximum=20000500 + // +optional + FsNrOpen *int `json:"fsNrOpen,omitempty"` + + // KernelThreadsMax specifies the maximum number of all threads that can be created. + // Valid values are 20-513785 (inclusive). + // Maps to kernel.threads-max. + // +kubebuilder:validation:Minimum=20 + // +kubebuilder:validation:Maximum=513785 + // +optional + KernelThreadsMax *int `json:"kernelThreadsMax,omitempty"` + + // NetCoreNetdevMaxBacklog specifies maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them. + // Valid values are 1000-3240000 (inclusive). + // Maps to net.core.netdev_max_backlog. + // +kubebuilder:validation:Minimum=1000 + // +kubebuilder:validation:Maximum=3240000 + // +optional + NetCoreNetdevMaxBacklog *int `json:"netCoreNetdevMaxBacklog,omitempty"` + + // NetCoreOptmemMax specifies the maximum ancillary buffer size (option memory buffer) allowed per socket. + // Socket option memory is used in a few cases to store extra structures relating to usage of the socket. + // Valid values are 20480-4194304 (inclusive). + // Maps to net.core.optmem_max. + // +kubebuilder:validation:Minimum=20480 + // +kubebuilder:validation:Maximum=4194304 + // +optional + NetCoreOptmemMax *int `json:"netCoreOptmemMax,omitempty"` + + // NetCoreRmemDefault specifies the default receive socket buffer size in bytes. + // Valid values are 212992-134217728 (inclusive). + // Maps to net.core.rmem_default. + // +kubebuilder:validation:Minimum=212992 + // +kubebuilder:validation:Maximum=134217728 + // +optional + NetCoreRmemDefault *int `json:"netCoreRmemDefault,omitempty"` + + // NetCoreRmemMax specifies the maximum receive socket buffer size in bytes. + // Valid values are 212992-134217728 (inclusive). + // Maps to net.core.rmem_max. + // +kubebuilder:validation:Minimum=212992 + // +kubebuilder:validation:Maximum=134217728 + // +optional + NetCoreRmemMax *int `json:"netCoreRmemMax,omitempty"` + + // NetCoreSomaxconn specifies maximum number of connection requests that can be queued for any given listening socket. + // An upper limit for the value of the backlog parameter passed to the listen(2)(https://man7.org/linux/man-pages/man2/listen.2.html) function. + // If the backlog argument is greater than the somaxconn, then it's silently truncated to this limit. + // Valid values are 4096-3240000 (inclusive). + // Maps to net.core.somaxconn. + // +kubebuilder:validation:Minimum=4096 + // +kubebuilder:validation:Maximum=3240000 + // +optional + NetCoreSomaxconn *int `json:"netCoreSomaxconn,omitempty"` + + // NetCoreWmemDefault specifies the default send socket buffer size in bytes. + // Valid values are 212992-134217728 (inclusive). + // Maps to net.core.wmem_default. + // +kubebuilder:validation:Minimum=212992 + // +kubebuilder:validation:Maximum=134217728 + // +optional + NetCoreWmemDefault *int `json:"netCoreWmemDefault,omitempty"` + + // NetCoreWmemMax specifies the maximum send socket buffer size in bytes. + // Valid values are 212992-134217728 (inclusive). + // Maps to net.core.wmem_max. + // +kubebuilder:validation:Minimum=212992 + // +kubebuilder:validation:Maximum=134217728 + // +optional + NetCoreWmemMax *int `json:"netCoreWmemMax,omitempty"` + + // NetIpv4IPLocalPortRange is used by TCP and UDP traffic to choose the local port on the agent node. + // PortRange should be specified in the format "first last". + // First, being an integer, must be between [1024 - 60999]. + // Last, being an integer, must be between [32768 - 65000]. + // Maps to net.ipv4.ip_local_port_range. + // +optional + NetIpv4IPLocalPortRange *string `json:"netIpv4IPLocalPortRange,omitempty"` + + // NetIpv4NeighDefaultGcThresh1 specifies the minimum number of entries that may be in the ARP cache. + // Garbage collection won't be triggered if the number of entries is below this setting. + // Valid values are 128-80000 (inclusive). + // Maps to net.ipv4.neigh.default.gc_thresh1. + // +kubebuilder:validation:Minimum=128 + // +kubebuilder:validation:Maximum=80000 + // +optional + NetIpv4NeighDefaultGcThresh1 *int `json:"netIpv4NeighDefaultGcThresh1,omitempty"` + + // NetIpv4NeighDefaultGcThresh2 specifies soft maximum number of entries that may be in the ARP cache. + // ARP garbage collection will be triggered about 5 seconds after reaching this soft maximum. + // Valid values are 512-90000 (inclusive). + // Maps to net.ipv4.neigh.default.gc_thresh2. + // +kubebuilder:validation:Minimum=512 + // +kubebuilder:validation:Maximum=90000 + // +optional + NetIpv4NeighDefaultGcThresh2 *int `json:"netIpv4NeighDefaultGcThresh2,omitempty"` + + // NetIpv4NeighDefaultGcThresh3 specified hard maximum number of entries in the ARP cache. + // Valid values are 1024-100000 (inclusive). + // Maps to net.ipv4.neigh.default.gc_thresh3. + // +kubebuilder:validation:Minimum=1024 + // +kubebuilder:validation:Maximum=100000 + // +optional + NetIpv4NeighDefaultGcThresh3 *int `json:"netIpv4NeighDefaultGcThresh3,omitempty"` + + // NetIpv4TCPFinTimeout specifies the length of time an orphaned connection will remain in the FIN_WAIT_2 state before it's aborted at the local end. + // Valid values are 5-120 (inclusive). + // Maps to net.ipv4.tcp_fin_timeout. + // +kubebuilder:validation:Minimum=5 + // +kubebuilder:validation:Maximum=120 + // +optional + NetIpv4TCPFinTimeout *int `json:"netIpv4TCPFinTimeout,omitempty"` + + // NetIpv4TCPKeepaliveProbes specifies the number of keepalive probes TCP sends out, until it decides the connection is broken. + // Valid values are 1-15 (inclusive). + // Maps to net.ipv4.tcp_keepalive_probes. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=15 + // +optional + NetIpv4TCPKeepaliveProbes *int `json:"netIpv4TCPKeepaliveProbes,omitempty"` + + // NetIpv4TCPKeepaliveTime specifies the rate at which TCP sends out a keepalive message when keepalive is enabled. + // Valid values are 30-432000 (inclusive). + // Maps to net.ipv4.tcp_keepalive_time. + // +kubebuilder:validation:Minimum=30 + // +kubebuilder:validation:Maximum=432000 + // +optional + NetIpv4TCPKeepaliveTime *int `json:"netIpv4TCPKeepaliveTime,omitempty"` + + // NetIpv4TCPMaxSynBacklog specifies the maximum number of queued connection requests that have still not received an acknowledgment from the connecting client. + // If this number is exceeded, the kernel will begin dropping requests. + // Valid values are 128-3240000 (inclusive). + // Maps to net.ipv4.tcp_max_syn_backlog. + // +kubebuilder:validation:Minimum=128 + // +kubebuilder:validation:Maximum=3240000 + // +optional + NetIpv4TCPMaxSynBacklog *int `json:"netIpv4TCPMaxSynBacklog,omitempty"` + + // NetIpv4TCPMaxTwBuckets specifies maximal number of timewait sockets held by system simultaneously. + // If this number is exceeded, time-wait socket is immediately destroyed and warning is printed. + // Valid values are 8000-1440000 (inclusive). + // Maps to net.ipv4.tcp_max_tw_buckets. + // +kubebuilder:validation:Minimum=8000 + // +kubebuilder:validation:Maximum=1440000 + // +optional + NetIpv4TCPMaxTwBuckets *int `json:"netIpv4TCPMaxTwBuckets,omitempty"` + + // NetIpv4TCPTwReuse is used to allow to reuse TIME-WAIT sockets for new connections when it's safe from protocol viewpoint. + // Maps to net.ipv4.tcp_tw_reuse. + // +optional + NetIpv4TCPTwReuse *bool `json:"netIpv4TCPTwReuse,omitempty"` + + // NetIpv4TCPkeepaliveIntvl specifies the frequency of the probes sent out. + // Multiplied by tcpKeepaliveprobes, it makes up the time to kill a connection that isn't responding, after probes started. + // Valid values are 1-75 (inclusive). + // Maps to net.ipv4.tcp_keepalive_intvl. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=75 + // +optional + NetIpv4TCPkeepaliveIntvl *int `json:"netIpv4TCPkeepaliveIntvl,omitempty"` + + // NetNetfilterNfConntrackBuckets specifies the size of hash table used by nf_conntrack module to record the established connection record of the TCP protocol. + // Valid values are 65536-147456 (inclusive). + // Maps to net.netfilter.nf_conntrack_buckets. + // +kubebuilder:validation:Minimum=65536 + // +kubebuilder:validation:Maximum=147456 + // +optional + NetNetfilterNfConntrackBuckets *int `json:"netNetfilterNfConntrackBuckets,omitempty"` + + // NetNetfilterNfConntrackMax specifies the maximum number of connections supported by the nf_conntrack module or the size of connection tracking table. + // Valid values are 131072-1048576 (inclusive). + // Maps to net.netfilter.nf_conntrack_max. + // +kubebuilder:validation:Minimum=131072 + // +kubebuilder:validation:Maximum=1048576 + // +optional + NetNetfilterNfConntrackMax *int `json:"netNetfilterNfConntrackMax,omitempty"` + + // VMMaxMapCount specifies the maximum number of memory map areas a process may have. + // Maps to vm.max_map_count. + // Valid values are 65530-262144 (inclusive). + // +kubebuilder:validation:Minimum=65530 + // +kubebuilder:validation:Maximum=262144 + // +optional + VMMaxMapCount *int `json:"vmMaxMapCount,omitempty"` + + // VMSwappiness specifies aggressiveness of the kernel in swapping memory pages. + // Higher values will increase aggressiveness, lower values decrease the amount of swap. + // Valid values are 0-100 (inclusive). + // Maps to vm.swappiness. + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + // +optional + VMSwappiness *int `json:"vmSwappiness,omitempty"` + + // VMVfsCachePressure specifies the percentage value that controls tendency of the kernel to reclaim the memory, which is used for caching of directory and inode objects. + // Valid values are 1-500 (inclusive). + // Maps to vm.vfs_cache_pressure. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=500 + // +optional + VMVfsCachePressure *int `json:"vmVfsCachePressure,omitempty"` +} + +// LinuxOSConfig specifies the custom Linux OS settings and configurations. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/azure/aks/custom-node-configuration#linux-os-custom-configuration +type LinuxOSConfig struct { + // SwapFileSizeMB specifies size in MB of a swap file will be created on the agent nodes from this node pool. + // Max value of SwapFileSizeMB should be the size of temporary disk(/dev/sdb). + // Must be at least 1. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/azure/virtual-machines/managed-disks-overview#temporary-disk + // +kubebuilder:validation:Minimum=1 + // +optional + SwapFileSizeMB *int `json:"swapFileSizeMB,omitempty"` + + // Sysctl specifies the settings for Linux agent nodes. + // +optional + Sysctls *SysctlConfig `json:"sysctls,omitempty"` + + // TransparentHugePageDefrag specifies whether the kernel should make aggressive use of memory compaction to make more hugepages available. + // See also [Linux doc]. + // + // [Linux doc]: https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge for more details. + // +kubebuilder:validation:Enum=always;defer;defer+madvise;madvise;never + // +optional + TransparentHugePageDefrag *TransparentHugePageOption `json:"transparentHugePageDefrag,omitempty"` + + // TransparentHugePageEnabled specifies various modes of Transparent Hugepages. + // See also [Linux doc]. + // + // [Linux doc]: https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge for more details. + // +kubebuilder:validation:Enum=always;madvise;never + // +optional + TransparentHugePageEnabled *TransparentHugePageOption `json:"transparentHugePageEnabled,omitempty"` +} + +// AzureManagedMachinePoolSpec defines the desired state of AzureManagedMachinePool. +type AzureManagedMachinePoolSpec struct { + AzureManagedMachinePoolClassSpec `json:",inline"` + + // ProviderIDList is the unique identifier as specified by the cloud provider. + // +optional + ProviderIDList []string `json:"providerIDList,omitempty"` +} + +// ManagedMachinePoolScaling specifies scaling options. +type ManagedMachinePoolScaling struct { + // MinSize is the minimum number of nodes for auto-scaling. + MinSize *int `json:"minSize,omitempty"` + // MaxSize is the maximum number of nodes for auto-scaling. + MaxSize *int `json:"maxSize,omitempty"` +} + +// TaintEffect is the effect for a Kubernetes taint. +type TaintEffect string + +// Taint represents a Kubernetes taint. +type Taint struct { + // Effect specifies the effect for the taint + // +kubebuilder:validation:Enum=NoSchedule;NoExecute;PreferNoSchedule + Effect TaintEffect `json:"effect"` + // Key is the key of the taint + Key string `json:"key"` + // Value is the value of the taint + Value string `json:"value"` +} + +// Taints is an array of Taints. +type Taints []Taint + +// AzureManagedMachinePoolStatus defines the observed state of AzureManagedMachinePool. +type AzureManagedMachinePoolStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Replicas is the most recently observed number of replicas. + // +optional + Replicas int32 `json:"replicas"` + + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + ErrorReason *string `json:"errorReason,omitempty"` + + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + ErrorMessage *string `json:"errorMessage,omitempty"` + + // Conditions defines current service state of the AzureManagedControlPlane. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the + // next reconciliation loop. + // +optional + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AzureManagedMachinePool belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",priority=1,JSONPath=".status.conditions[?(@.type=='Ready')].message" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of this AzureManagedMachinePool" +// +kubebuilder:printcolumn:name="Mode",type="string",JSONPath=".spec.mode" +// +kubebuilder:resource:path=azuremanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=ammp +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion:warning="AzureManagedMachinePool and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedMachinePool and related AzureASOManaged resources instead." + +// AzureManagedMachinePool is the Schema for the azuremanagedmachinepools API. +type AzureManagedMachinePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedMachinePoolSpec `json:"spec,omitempty"` + Status AzureManagedMachinePoolStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedMachinePoolList contains a list of AzureManagedMachinePools. +type AzureManagedMachinePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedMachinePool `json:"items"` +} + +// GetConditions returns the list of conditions for an AzureManagedMachinePool API object. +func (m *AzureManagedMachinePool) GetConditions() clusterv1beta1.Conditions { + return m.Status.Conditions +} + +// SetConditions will set the given conditions on an AzureManagedMachinePool object. +func (m *AzureManagedMachinePool) SetConditions(conditions clusterv1beta1.Conditions) { + m.Status.Conditions = conditions +} + +// GetFutures returns the list of long running operation states for an AzureManagedMachinePool API object. +func (m *AzureManagedMachinePool) GetFutures() Futures { + return m.Status.LongRunningOperationStates +} + +// SetFutures will set the given long running operation states on an AzureManagedMachinePool object. +func (m *AzureManagedMachinePool) SetFutures(futures Futures) { + m.Status.LongRunningOperationStates = futures +} + +func init() { + SchemeBuilder.Register(&AzureManagedMachinePool{}, &AzureManagedMachinePoolList{}) +} diff --git a/pkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.go b/pkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.go new file mode 100644 index 000000000000..7a8bf4328777 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AzureManagedMachinePoolTemplateSpec defines the desired state of AzureManagedMachinePoolTemplate. +type AzureManagedMachinePoolTemplateSpec struct { + Template AzureManagedMachinePoolTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=azuremanagedmachinepooltemplates,scope=Namespaced,categories=cluster-api,shortName=ammpt +// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion:warning="AzureManagedMachinePoolTemplate and the AzureManaged API are deprecated. Please migrate to infrastructure.cluster.x-k8s.io/v1beta1 AzureASOManagedMachinePoolTemplate and related AzureASOManaged resources instead." + +// AzureManagedMachinePoolTemplate is the Schema for the AzureManagedMachinePoolTemplates API. +type AzureManagedMachinePoolTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureManagedMachinePoolTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AzureManagedMachinePoolTemplateList contains a list of AzureManagedMachinePoolTemplates. +type AzureManagedMachinePoolTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AzureManagedMachinePoolTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AzureManagedMachinePoolTemplate{}, &AzureManagedMachinePoolTemplateList{}) +} + +// AzureManagedMachinePoolTemplateResource describes the data needed to create an AzureManagedCluster from a template. +type AzureManagedMachinePoolTemplateResource struct { + Spec AzureManagedMachinePoolTemplateResourceSpec `json:"spec"` +} diff --git a/pkg/capi/azure/api/v1beta1/consts.go b/pkg/capi/azure/api/v1beta1/consts.go new file mode 100644 index 000000000000..c6fa7ca8654b --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/consts.go @@ -0,0 +1,196 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + +// AzureCluster Conditions and Reasons. +const ( + // NetworkInfrastructureReadyCondition reports of current status of cluster infrastructure. + NetworkInfrastructureReadyCondition clusterv1beta1.ConditionType = "NetworkInfrastructureReady" + // NamespaceNotAllowedByIdentity used to indicate cluster in a namespace not allowed by identity. + NamespaceNotAllowedByIdentity = "NamespaceNotAllowedByIdentity" +) + +// AzureMachine Conditions and Reasons. +const ( + // VMRunningCondition reports on current status of the Azure VM. + VMRunningCondition clusterv1beta1.ConditionType = "VMRunning" + // VMIdentitiesReadyCondition reports on the readiness of the Azure VM identities. + VMIdentitiesReadyCondition clusterv1beta1.ConditionType = "VMIdentitiesReady" + // VMCreatingReason used when the vm creation is in progress. + VMCreatingReason = "VMCreating" + // VMUpdatingReason used when the vm updating is in progress. + VMUpdatingReason = "VMUpdating" + // VMDeletingReason used when the vm is in a deleting state. + VMDeletingReason = "VMDeleting" + // VMProvisionFailedReason used for failures during vm provisioning. + VMProvisionFailedReason = "VMProvisionFailed" + // UserAssignedIdentityMissingReason used for failures when a user-assigned identity is missing. + UserAssignedIdentityMissingReason = "UserAssignedIdentityMissing" + // WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + // WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" + // BootstrapSucceededCondition reports the result of the execution of the bootstrap data on the machine. + BootstrapSucceededCondition clusterv1beta1.ConditionType = "BootstrapSucceeded" + // BootstrapInProgressReason is used to indicate the bootstrap data has not finished executing. + BootstrapInProgressReason = "BootstrapInProgress" + // BootstrapFailedReason is used to indicate the bootstrap process ran into an error. + BootstrapFailedReason = "BootstrapFailed" +) + +// AzureMachinePool Conditions and Reasons. +const ( + // ScaleSetRunningCondition reports on current status of the Azure Scale Set. + ScaleSetRunningCondition clusterv1beta1.ConditionType = "ScaleSetRunning" + // ScaleSetCreatingReason used when the scale set creation is in progress. + ScaleSetCreatingReason = "ScaleSetCreating" + // ScaleSetUpdatingReason used when the scale set updating is in progress. + ScaleSetUpdatingReason = "ScaleSetUpdating" + // ScaleSetDeletingReason used when the scale set is in a deleting state. + ScaleSetDeletingReason = "ScaleSetDeleting" + // ScaleSetProvisionFailedReason used for failures during scale set provisioning. + ScaleSetProvisionFailedReason = "ScaleSetProvisionFailed" + + // ScaleSetDesiredReplicasCondition reports on the scaling state of the machine pool. + ScaleSetDesiredReplicasCondition clusterv1beta1.ConditionType = "ScaleSetDesiredReplicas" + // ScaleSetScaleUpReason describes the machine pool scaling up. + ScaleSetScaleUpReason = "ScaleSetScalingUp" + // ScaleSetScaleDownReason describes the machine pool scaling down. + ScaleSetScaleDownReason = "ScaleSetScalingDown" + + // ScaleSetModelUpdatedCondition reports on the model state of the pool. + ScaleSetModelUpdatedCondition clusterv1beta1.ConditionType = "ScaleSetModelUpdated" + // ScaleSetModelOutOfDateReason describes the machine pool model being out of date. + ScaleSetModelOutOfDateReason = "ScaleSetModelOutOfDate" +) + +// AzureManagedCluster Conditions and Reasons. +const ( + // ManagedClusterRunningCondition means the AKS cluster exists and is in a running state. + ManagedClusterRunningCondition clusterv1beta1.ConditionType = "ManagedClusterRunning" + // AgentPoolsReadyCondition means the AKS agent pools exist and are ready to be used. + AgentPoolsReadyCondition clusterv1beta1.ConditionType = "AgentPoolsReady" + // AzureResourceAvailableCondition means the AKS cluster is healthy according to Azure's Resource Health API. + AzureResourceAvailableCondition clusterv1beta1.ConditionType = "AzureResourceAvailable" +) + +// Azure Services Conditions and Reasons. +const ( + // ResourceGroupReadyCondition means the resource group exists and is ready to be used. + ResourceGroupReadyCondition clusterv1beta1.ConditionType = "ResourceGroupReady" + // VNetReadyCondition means the virtual network exists and is ready to be used. + VNetReadyCondition clusterv1beta1.ConditionType = "VNetReady" + // VnetPeeringReadyCondition means the virtual network peerings exist and are ready to be used. + VnetPeeringReadyCondition clusterv1beta1.ConditionType = "VnetPeeringReady" + // SecurityGroupsReadyCondition means the security groups exist and are ready to be used. + SecurityGroupsReadyCondition clusterv1beta1.ConditionType = "SecurityGroupsReady" + // RouteTablesReadyCondition means the route tables exist and are ready to be used. + RouteTablesReadyCondition clusterv1beta1.ConditionType = "RouteTablesReady" + // PublicIPsReadyCondition means the public IPs exist and are ready to be used. + PublicIPsReadyCondition clusterv1beta1.ConditionType = "PublicIPsReady" + // NATGatewaysReadyCondition means the NAT gateways exist and are ready to be used. + NATGatewaysReadyCondition clusterv1beta1.ConditionType = "NATGatewaysReady" + // SubnetsReadyCondition means the subnets exist and are ready to be used. + SubnetsReadyCondition clusterv1beta1.ConditionType = "SubnetsReady" + // LoadBalancersReadyCondition means the load balancers exist and are ready to be used. + LoadBalancersReadyCondition clusterv1beta1.ConditionType = "LoadBalancersReady" + // PrivateDNSZoneReadyCondition means the private DNS zone exists and is ready to be used. + PrivateDNSZoneReadyCondition clusterv1beta1.ConditionType = "PrivateDNSZoneReady" + // PrivateDNSLinkReadyCondition means the private DNS links exist and are ready to be used. + PrivateDNSLinkReadyCondition clusterv1beta1.ConditionType = "PrivateDNSLinkReady" + // PrivateDNSRecordReadyCondition means the private DNS records exist and are ready to be used. + PrivateDNSRecordReadyCondition clusterv1beta1.ConditionType = "PrivateDNSRecordReady" + // BastionHostReadyCondition means the bastion host exists and is ready to be used. + BastionHostReadyCondition clusterv1beta1.ConditionType = "BastionHostReady" + // InboundNATRulesReadyCondition means the inbound NAT rules exist and are ready to be used. + InboundNATRulesReadyCondition clusterv1beta1.ConditionType = "InboundNATRulesReady" + // AvailabilitySetReadyCondition means the availability set exists and is ready to be used. + AvailabilitySetReadyCondition clusterv1beta1.ConditionType = "AvailabilitySetReady" + // RoleAssignmentReadyCondition means the role assignment exists and is ready to be used. + RoleAssignmentReadyCondition clusterv1beta1.ConditionType = "RoleAssignmentReady" + // DisksReadyCondition means the disks exist and are ready to be used. + DisksReadyCondition clusterv1beta1.ConditionType = "DisksReady" + // NetworkInterfaceReadyCondition means the network interfaces exist and are ready to be used. + NetworkInterfaceReadyCondition clusterv1beta1.ConditionType = "NetworkInterfacesReady" + // PrivateEndpointsReadyCondition means the private endpoints exist and are ready to be used. + PrivateEndpointsReadyCondition clusterv1beta1.ConditionType = "PrivateEndpointsReady" + // FleetReadyCondition means the Fleet exists and is ready to be used. + FleetReadyCondition clusterv1beta1.ConditionType = "FleetReady" + // AKSExtensionsReadyCondition means the AKS Extensions exist and are ready to be used. + AKSExtensionsReadyCondition clusterv1beta1.ConditionType = "AKSExtensionsReady" + + // CreatingReason means the resource is being created. + CreatingReason = "Creating" + // FailedReason means the resource failed to be created. + FailedReason = "Failed" + // DeletingReason means the resource is being deleted. + DeletingReason = "Deleting" + // DeletedReason means the resource was deleted. + DeletedReason = "Deleted" + // DeletionFailedReason means the resource failed to be deleted. + DeletionFailedReason = "DeletionFailed" + // UpdatingReason means the resource is being updated. + UpdatingReason = "Updating" +) + +const ( + // LinuxOS is Linux OS value for OSDisk.OSType. + LinuxOS = "Linux" + // WindowsOS is Windows OS value for OSDisk.OSType. + WindowsOS = "Windows" +) + +const ( + // OwnedByClusterLabelKey communicates CAPZ's ownership of an ASO resource + // independently of its ownership of the underlying Azure resource. The + // value for the label is the CAPI Cluster Name. + // + // Deprecated: OwnerReferences now determine ownership. + OwnedByClusterLabelKey = NameAzureProviderPrefix + string(ResourceLifecycleOwned) +) + +const ( + // AzureNetworkPluginName is the name of the Azure network plugin. + AzureNetworkPluginName = "azure" +) + +const ( + // AzureClusterKind indicates the kind of an AzureCluster. + AzureClusterKind = "AzureCluster" + // AzureClusterTemplateKind indicates the kind of an AzureClusterTemplate. + AzureClusterTemplateKind = "AzureClusterTemplate" + // AzureMachineKind indicates the kind of an AzureMachine. + AzureMachineKind = "AzureMachine" + // AzureMachineTemplateKind indicates the kind of an AzureMachineTemplate. + AzureMachineTemplateKind = "AzureMachineTemplate" + // AzureMachinePoolKind indicates the kind of an AzureMachinePool. + AzureMachinePoolKind = "AzureMachinePool" + // AzureManagedMachinePoolKind indicates the kind of an AzureManagedMachinePool. + AzureManagedMachinePoolKind = "AzureManagedMachinePool" + // AzureManagedClusterKind indicates the kind of an AzureManagedCluster. + AzureManagedClusterKind = "AzureManagedCluster" + // AzureManagedControlPlaneKind indicates the kind of an AzureManagedControlPlane. + AzureManagedControlPlaneKind = "AzureManagedControlPlane" + // AzureManagedControlPlaneTemplateKind indicates the kind of an AzureManagedControlPlaneTemplate. + AzureManagedControlPlaneTemplateKind = "AzureManagedControlPlaneTemplate" + // AzureManagedMachinePoolTemplateKind indicates the kind of an AzureManagedMachinePoolTemplate. + AzureManagedMachinePoolTemplateKind = "AzureManagedMachinePoolTemplate" + // AzureClusterIdentityKind indicates the kind of an AzureClusterIdentity. + AzureClusterIdentityKind = "AzureClusterIdentity" +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_conversion.go b/pkg/capi/azure/api/v1beta1/doc.go similarity index 79% rename from vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_conversion.go rename to pkg/capi/azure/api/v1beta1/doc.go index 0760fcceb1fd..90c54a8d6751 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_conversion.go +++ b/pkg/capi/azure/api/v1beta1/doc.go @@ -14,10 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +groupName=infrastructure.cluster.x-k8s.io package v1beta1 - -// Hub marks GCPCluster as a conversion hub. -func (*GCPCluster) Hub() {} - -// Hub marks GCPClusterList as a conversion hub. -func (*GCPClusterList) Hub() {} diff --git a/pkg/capi/azure/api/v1beta1/groupversion_info.go b/pkg/capi/azure/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..3d638832dc37 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/groupversion_info.go @@ -0,0 +1,35 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +// +kubebuilder:object:generate=true +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/capi/azure/api/v1beta1/tags.go b/pkg/capi/azure/api/v1beta1/tags.go new file mode 100644 index 000000000000..2b7a41aa9e96 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/tags.go @@ -0,0 +1,206 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "maps" + "reflect" +) + +// Tags defines a map of tags. +type Tags map[string]string + +// Equals returns true if the tags are equal. +func (t Tags) Equals(other Tags) bool { + return reflect.DeepEqual(t, other) +} + +// HasMatchingSpecVersionHash returns true if the resource has been tagged with a matching resource spec hash value. +func (t Tags) HasMatchingSpecVersionHash(hash string) bool { + value, ok := t[SpecVersionHashTagKey()] + return ok && value == hash +} + +// HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling. +func (t Tags) HasOwned(cluster string) bool { + value, ok := t[ClusterTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// HasAzureCloudProviderOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of the in-tree cloud provider. +func (t Tags) HasAzureCloudProviderOwned(cluster string) bool { + value, ok := t[ClusterAzureCloudProviderTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// GetRole returns the Cluster API role for the tagged resource. +func (t Tags) GetRole() string { + return t[NameAzureClusterAPIRole] +} + +// Difference returns the difference between this map of tags and the other map of tags. +// Items are considered equals if key and value are equals. +func (t Tags) Difference(other Tags) Tags { + res := make(Tags, len(t)) + + for key, value := range t { + if otherValue, ok := other[key]; ok && value == otherValue { + continue + } + res[key] = value + } + + return res +} + +// Merge merges in tags from other. If a tag already exists, it is replaced by the tag in other. +func (t Tags) Merge(other Tags) { + maps.Copy(t, other) +} + +// AddSpecVersionHashTag adds a spec version hash to the Azure resource tags to determine quickly if state has changed. +func (t Tags) AddSpecVersionHashTag(hash string) Tags { + t[SpecVersionHashTagKey()] = hash + return t +} + +// ResourceLifecycle configures the lifecycle of a resource. +type ResourceLifecycle string + +const ( + // ResourceLifecycleOwned is the value we use when tagging resources to indicate + // that the resource is considered owned and managed by the cluster, + // and in particular that the lifecycle is tied to the lifecycle of the cluster. + ResourceLifecycleOwned = ResourceLifecycle("owned") + + // ResourceLifecycleShared is the value we use when tagging resources to indicate + // that the resource is shared between multiple clusters, and should not be destroyed + // if the cluster is destroyed. + ResourceLifecycleShared = ResourceLifecycle("shared") + + // NameKubernetesAzureCloudProviderPrefix is the tag name used by the cloud provider to logically + // separate independent cluster resources. We use it to identify which resources we expect + // to be permissive about state changes. + // logically independent clusters running in the same AZ. + // The tag key = NameKubernetesAzureCloudProviderPrefix + clusterID. + // The tag value is an ownership value. + NameKubernetesAzureCloudProviderPrefix = "kubernetes.io_cluster_" + + // NameAzureProviderPrefix is the tag prefix we use to differentiate + // cluster-api-provider-azure owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAzureProviderPrefix = "sigs.k8s.io_cluster-api-provider-azure_" + + // NameAzureProviderOwned is the tag name we use to differentiate + // cluster-api-provider-azure owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAzureProviderOwned = NameAzureProviderPrefix + "cluster_" + + // NameAzureClusterAPIRole is the tag name we use to mark roles for resources + // dedicated to this cluster api provider implementation. + NameAzureClusterAPIRole = NameAzureProviderPrefix + "role" + + // APIServerRole describes the value for the apiserver role. + APIServerRole = "apiserver" + + // APIServerRoleInternal describes the value for the apiserver-internal role, + // an identifier for an internal load balancer serving apiserver traffic for cluster nodes. + APIServerRoleInternal = "apiserver-internal" + + // NodeOutboundRole describes the value for the node outbound LB role. + NodeOutboundRole = "nodeOutbound" + + // ControlPlaneOutboundRole describes the value for the control plane outbound LB role. + ControlPlaneOutboundRole = "controlPlaneOutbound" + + // BastionRole describes the value for the bastion role. + BastionRole = Bastion + + // CommonRole describes the value for the common role. + CommonRole = "common" + + // VMTagsLastAppliedAnnotation is the key for the machine object annotation + // which tracks the AdditionalTags in the Machine Provider Config. + // See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + // for annotation formatting rules. + // Deprecated: use azure.VMTagsLastAppliedAnnotation instead. This constant will be removed in v1beta2. + VMTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-vm" + + // RGTagsLastAppliedAnnotation is the key for the Azure Cluster object annotation + // which tracks the AdditionalTags for Resource Group which is part in the Azure Cluster. + // See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + // for annotation formatting rules. + // Deprecated: use azure.RGTagsLastAppliedAnnotation instead. This constant will be removed in v1beta2. + RGTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-rg" +) + +// SpecVersionHashTagKey is the key for the spec version hash used to enable quick spec difference comparison. +func SpecVersionHashTagKey() string { + return fmt.Sprintf("%s%s", NameAzureProviderPrefix, "spec-version-hash") +} + +// ClusterTagKey generates the key for resources associated with a cluster. +func ClusterTagKey(name string) string { + return fmt.Sprintf("%s%s", NameAzureProviderOwned, name) +} + +// ClusterAzureCloudProviderTagKey generates the key for resources associated a cluster's Azure cloud provider. +func ClusterAzureCloudProviderTagKey(name string) string { + return fmt.Sprintf("%s%s", NameKubernetesAzureCloudProviderPrefix, name) +} + +// BuildParams is used to build tags around an azure resource. +type BuildParams struct { + // Lifecycle determines the resource lifecycle. + Lifecycle ResourceLifecycle + + // ClusterName is the cluster associated with the resource. + ClusterName string + + // ResourceID is the unique identifier of the resource to be tagged. + ResourceID string + + // Name is the name of the resource, it's applied as the tag "Name" on Azure. + // +optional + Name *string + + // Role is the role associated to the resource. + // +optional + Role *string + + // Any additional tags to be added to the resource. + // +optional + Additional Tags +} + +// Build builds tags including the cluster tag and returns them in map form. +func Build(params BuildParams) Tags { + tags := make(Tags) + maps.Copy(tags, params.Additional) + + tags[ClusterTagKey(params.ClusterName)] = string(params.Lifecycle) + if params.Role != nil { + tags[NameAzureClusterAPIRole] = *params.Role + } + + if params.Name != nil { + tags["Name"] = *params.Name + } + + return tags +} diff --git a/pkg/capi/azure/api/v1beta1/types.go b/pkg/capi/azure/api/v1beta1/types.go new file mode 100644 index 000000000000..5572aac33e95 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/types.go @@ -0,0 +1,1255 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "slices" + + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/utils/net" +) + +const ( + // ControlPlane machine label. + ControlPlane string = "control-plane" + // Node machine label. + Node string = "node" + // Bastion subnet label. + Bastion string = "bastion" + // Cluster subnet label. + Cluster string = "cluster" +) + +// SecurityEncryptionType represents the Encryption Type when the virtual machine is a +// Confidential VM. +type SecurityEncryptionType string + +const ( + // SecurityEncryptionTypeVMGuestStateOnly disables OS disk confidential encryption. + SecurityEncryptionTypeVMGuestStateOnly SecurityEncryptionType = "VMGuestStateOnly" + // SecurityEncryptionTypeDiskWithVMGuestState OS disk confidential encryption with a + // platform-managed key (PMK) or a customer-managed key (CMK). + SecurityEncryptionTypeDiskWithVMGuestState SecurityEncryptionType = "DiskWithVMGuestState" +) + +// SecurityTypes represents the SecurityType of the virtual machine. +type SecurityTypes string + +const ( + // SecurityTypesConfidentialVM defines the SecurityType of the virtual machine as a Confidential VM. + SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" + // SecurityTypesTrustedLaunch defines the SecurityType of the virtual machine as a Trusted Launch VM. + SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" +) + +// Futures is a slice of Future. +type Futures []Future + +const ( + // PatchFuture is a future that was derived from a PATCH request. + PatchFuture string = "PATCH" + // PutFuture is a future that was derived from a PUT request. + PutFuture string = "PUT" + // DeleteFuture is a future that was derived from a DELETE request. + DeleteFuture string = "DELETE" +) + +// Future contains the data needed for an Azure long-running operation to continue across reconcile loops. +type Future struct { + // Type describes the type of future, such as update, create, delete, etc. + Type string `json:"type"` + + // ResourceGroup is the Azure resource group for the resource. + // +optional + ResourceGroup string `json:"resourceGroup,omitempty"` + + // ServiceName is the name of the Azure service. + // Together with the name of the resource, this forms the unique identifier for the future. + ServiceName string `json:"serviceName"` + + // Name is the name of the Azure resource. + // Together with the service name, this forms the unique identifier for the future. + Name string `json:"name"` + + // Data is the base64 url encoded json Azure AutoRest Future. + Data string `json:"data"` +} + +// NetworkSpec specifies what the Azure networking resources should look like. +type NetworkSpec struct { + // Vnet is the configuration for the Azure virtual network. + // +optional + Vnet VnetSpec `json:"vnet,omitempty"` + + // Subnets is the configuration for the control-plane subnet and the node subnet. + // +optional + Subnets Subnets `json:"subnets,omitempty"` + + // APIServerLB is the configuration for the control-plane load balancer. + // +optional + APIServerLB *LoadBalancerSpec `json:"apiServerLB,omitempty"` + + // NodeOutboundLB is the configuration for the node outbound load balancer. + // +optional + NodeOutboundLB *LoadBalancerSpec `json:"nodeOutboundLB,omitempty"` + + // ControlPlaneOutboundLB is the configuration for the control-plane outbound load balancer. + // This is different from APIServerLB, and is used only in private clusters (optionally) for enabling outbound traffic. + // +optional + ControlPlaneOutboundLB *LoadBalancerSpec `json:"controlPlaneOutboundLB,omitempty"` + + // AdditionalAPIServerLBPorts specifies extra inbound ports for the APIServer load balancer. + // Each port specified (e.g., 9345) creates an inbound rule where the frontend port and the backend port are the same. + // +optional + AdditionalAPIServerLBPorts []LoadBalancerPort `json:"additionalAPIServerLBPorts,omitempty"` + + // PrivateDNSZone enables private dns zone creation modes for a private cluster. + // When unspecified, it defaults to PrivateDNSZoneModeSystem which creates a private DNS zone. + // +kubebuilder:validation:Enum=System;None + // +optional + PrivateDNSZone *PrivateDNSZoneMode `json:"privateDNSZone,omitempty"` + + NetworkClassSpec `json:",inline"` +} + +// LoadBalancerPort specifies additional port for the API server load balancer. +type LoadBalancerPort struct { + // Name for the additional port within LB definition + Name string `json:"name"` + + // Port for the LB definition + Port int32 `json:"port"` +} + +// VnetSpec configures an Azure virtual network. +type VnetSpec struct { + // ResourceGroup is the name of the resource group of the existing virtual network + // or the resource group where a managed virtual network should be created. + // +optional + ResourceGroup string `json:"resourceGroup,omitempty"` + + // ID is the Azure resource ID of the virtual network. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + + // Name defines a name for the virtual network resource. + Name string `json:"name"` + + // Peerings defines a list of peerings of the newly created virtual network with existing virtual networks. + // +optional + Peerings VnetPeerings `json:"peerings,omitempty"` + + VnetClassSpec `json:",inline"` +} + +// VnetPeeringSpec specifies an existing remote virtual network to peer with the AzureCluster's virtual network. +type VnetPeeringSpec struct { + VnetPeeringClassSpec `json:",inline"` +} + +// VnetPeeringClassSpec specifies a virtual network peering class. +type VnetPeeringClassSpec struct { + // ResourceGroup is the resource group name of the remote virtual network. + // +optional + ResourceGroup string `json:"resourceGroup,omitempty"` + + // RemoteVnetName defines name of the remote virtual network. + RemoteVnetName string `json:"remoteVnetName"` + + // ForwardPeeringProperties specifies VnetPeeringProperties for peering from the cluster's virtual network to the + // remote virtual network. + // +optional + ForwardPeeringProperties VnetPeeringProperties `json:"forwardPeeringProperties,omitempty"` + + // ReversePeeringProperties specifies VnetPeeringProperties for peering from the remote virtual network to the + // cluster's virtual network. + // +optional + ReversePeeringProperties VnetPeeringProperties `json:"reversePeeringProperties,omitempty"` +} + +// VnetPeeringProperties specifies virtual network peering properties. +type VnetPeeringProperties struct { + // AllowForwardedTraffic specifies whether the forwarded traffic from the VMs in the local virtual network will be + // allowed/disallowed in remote virtual network. + // +optional + AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` + + // AllowGatewayTransit specifies if gateway links can be used in remote virtual networking to link to this virtual + // network. + // +optional + AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` + + // AllowVirtualNetworkAccess specifies whether the VMs in the local virtual network space would be able to access + // the VMs in remote virtual network space. + // +optional + AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` + + // UseRemoteGateways specifies if remote gateways can be used on this virtual network. + // If the flag is set to true, and allowGatewayTransit on remote peering is also set to true, the virtual network + // will use the gateways of the remote virtual network for transit. Only one peering can have this flag set to true. + // This flag cannot be set if virtual network already has a gateway. + // +optional + UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` +} + +// VnetPeerings is a slice of VnetPeering. +type VnetPeerings []VnetPeeringSpec + +// IsManaged returns true if the vnet is managed. +func (v *VnetSpec) IsManaged(clusterName string) bool { + return v.ID == "" || v.Tags.HasOwned(clusterName) +} + +// Subnets is a slice of Subnet. +// +listType=map +// +listMapKey=name +type Subnets []SubnetSpec + +// ServiceEndpoints is a slice of string. +// +listType=map +// +listMapKey=service +type ServiceEndpoints []ServiceEndpointSpec + +// PrivateEndpoints is a slice of PrivateEndpointSpec. +// +listType=map +// +listMapKey=name +type PrivateEndpoints []PrivateEndpointSpec + +// SecurityGroup defines an Azure security group. +type SecurityGroup struct { + // ID is the Azure resource ID of the security group. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + Name string `json:"name"` + + SecurityGroupClass `json:",inline"` +} + +// RouteTable defines an Azure route table. +type RouteTable struct { + // ID is the Azure resource ID of the route table. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + Name string `json:"name"` +} + +// NatGateway defines an Azure NAT gateway. +// NAT gateway resources are part of Vnet NAT and provide outbound Internet connectivity for subnets of a virtual network. +type NatGateway struct { + // ID is the Azure resource ID of the NAT gateway. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + // +optional + NatGatewayIP PublicIPSpec `json:"ip,omitempty"` + + // Zones mentions the list of zones the NAT gateway should be a part of. + // +optional + Zones []string `json:"zones,omitempty"` + + NatGatewayClassSpec `json:",inline"` +} + +// NatGatewayClassSpec defines a NAT gateway class specification. +type NatGatewayClassSpec struct { + Name string `json:"name"` +} + +// SecurityGroupProtocol defines the protocol type for a security group rule. +type SecurityGroupProtocol string + +const ( + // SecurityGroupProtocolAll is a wildcard for all IP protocols. + SecurityGroupProtocolAll = SecurityGroupProtocol("*") + // SecurityGroupProtocolTCP represents the TCP protocol. + SecurityGroupProtocolTCP = SecurityGroupProtocol("Tcp") + // SecurityGroupProtocolUDP represents the UDP protocol. + SecurityGroupProtocolUDP = SecurityGroupProtocol("Udp") + // SecurityGroupProtocolICMP represents the ICMP protocol. + SecurityGroupProtocolICMP = SecurityGroupProtocol("Icmp") +) + +// SecurityRuleDirection defines the direction type for a security group rule. +type SecurityRuleDirection string + +const ( + // SecurityRuleDirectionInbound defines an ingress security rule. + SecurityRuleDirectionInbound = SecurityRuleDirection("Inbound") + + // SecurityRuleDirectionOutbound defines an egress security rule. + SecurityRuleDirectionOutbound = SecurityRuleDirection("Outbound") +) + +// SecurityRuleAccess defines the action type for a security group rule. +type SecurityRuleAccess string + +const ( + // SecurityRuleActionAllow allows traffic defined in the rule. + SecurityRuleActionAllow SecurityRuleAccess = "Allow" + + // SecurityRuleActionDeny denies traffic defined in the rule. + SecurityRuleActionDeny SecurityRuleAccess = "Deny" +) + +// SecurityRule defines an Azure security rule for security groups. +type SecurityRule struct { + // Name is a unique name within the network security group. + Name string `json:"name"` + // A description for this rule. Restricted to 140 chars. + Description string `json:"description"` + // Protocol specifies the protocol type. "Tcp", "Udp", "Icmp", or "*". + // +kubebuilder:validation:Enum=Tcp;Udp;Icmp;* + Protocol SecurityGroupProtocol `json:"protocol"` + // Direction indicates whether the rule applies to inbound, or outbound traffic. "Inbound" or "Outbound". + // +kubebuilder:validation:Enum=Inbound;Outbound + Direction SecurityRuleDirection `json:"direction"` + // Priority is a number between 100 and 4096. Each rule should have a unique value for priority. Rules are processed in priority order, with lower numbers processed before higher numbers. Once traffic matches a rule, processing stops. + // +optional + Priority int32 `json:"priority,omitempty"` + // SourcePorts specifies source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + // +optional + SourcePorts *string `json:"sourcePorts,omitempty"` + // DestinationPorts specifies the destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. + // +optional + DestinationPorts *string `json:"destinationPorts,omitempty"` + // Source specifies the CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. + // +optional + Source *string `json:"source,omitempty"` + // Sources specifies The CIDR or source IP ranges. + Sources []*string `json:"sources,omitempty"` + // Destination is the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. + // +optional + Destination *string `json:"destination,omitempty"` + // Action specifies whether network traffic is allowed or denied. Can either be "Allow" or "Deny". Defaults to "Allow". + // +kubebuilder:default=Allow + // +kubebuilder:validation:Enum=Allow;Deny + //+optional + Action SecurityRuleAccess `json:"action"` +} + +// SecurityRules is a slice of Azure security rules for security groups. +// +listType=map +// +listMapKey=name +type SecurityRules []SecurityRule + +// LoadBalancerSpec defines an Azure load balancer. +type LoadBalancerSpec struct { + // ID is the Azure resource ID of the load balancer. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + // +optional + Name string `json:"name,omitempty"` + // +optional + FrontendIPs []FrontendIP `json:"frontendIPs,omitempty"` + // FrontendIPsCount specifies the number of frontend IP addresses for the load balancer. + // +optional + FrontendIPsCount *int32 `json:"frontendIPsCount,omitempty"` + // BackendPool describes the backend pool of the load balancer. + // +optional + BackendPool BackendPool `json:"backendPool,omitempty"` + + LoadBalancerClassSpec `json:",inline"` +} + +// SKU defines an Azure load balancer SKU. +type SKU string + +const ( + // SKUStandard is the value for the Azure load balancer Standard SKU. + SKUStandard = SKU("Standard") +) + +// LBType defines an Azure load balancer Type. +type LBType string + +const ( + // Internal is the value for the Azure load balancer internal type. + Internal = LBType("Internal") + // Public is the value for the Azure load balancer public type. + Public = LBType("Public") +) + +// FrontendIP defines a load balancer frontend IP configuration. +type FrontendIP struct { + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + // +optional + PublicIP *PublicIPSpec `json:"publicIP,omitempty"` + + FrontendIPClass `json:",inline"` +} + +// PublicIPSpec defines the inputs to create an Azure public IP address. +type PublicIPSpec struct { + Name string `json:"name"` + // +optional + DNSName string `json:"dnsName,omitempty"` + // +optional + IPTags []IPTag `json:"ipTags,omitempty"` +} + +// IPTag contains the IpTag associated with the object. +type IPTag struct { + // Type specifies the IP tag type. Example: FirstPartyUsage. + Type string `json:"type"` + // Tag specifies the value of the IP tag associated with the public IP. Example: SQL. + Tag string `json:"tag"` +} + +// VMState describes the state of an Azure virtual machine. +// Deprecated: use ProvisioningState. +type VMState string + +// ProvisioningState describes the provisioning state of an Azure resource. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Migrating ... + Migrating ProvisioningState = "Migrating" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" + // Canceled represents an action which was initiated but terminated by the user before completion. + Canceled ProvisioningState = "Canceled" + // Deleted represents a deleted VM + // NOTE: This state is specific to capz, and does not have corresponding mapping in Azure API (https://learn.microsoft.com/azure/virtual-machines/states-billing#provisioning-states) + Deleted ProvisioningState = "Deleted" +) + +// Image defines information about the image to use for VM creation. +// There are three ways to specify an image: by ID, Marketplace Image or SharedImageGallery +// One of ID, SharedImage or Marketplace should be set. +type Image struct { + // ID specifies an image to use by ID + // +optional + ID *string `json:"id,omitempty"` + + // SharedGallery specifies an image to use from an Azure Shared Image Gallery + // Deprecated: use ComputeGallery instead. + // +optional + SharedGallery *AzureSharedGalleryImage `json:"sharedGallery,omitempty"` + + // Marketplace specifies an image to use from the Azure Marketplace + // +optional + Marketplace *AzureMarketplaceImage `json:"marketplace,omitempty"` + + // ComputeGallery specifies an image to use from the Azure Compute Gallery + // +optional + ComputeGallery *AzureComputeGalleryImage `json:"computeGallery,omitempty"` +} + +// AzureComputeGalleryImage defines an image in the Azure Compute Gallery to use for VM creation. +type AzureComputeGalleryImage struct { + // Gallery specifies the name of the compute image gallery that contains the image + // +kubebuilder:validation:MinLength=1 + Gallery string `json:"gallery"` + // Name is the name of the image + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + // Version specifies the version of the marketplace image. 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. + // +kubebuilder:validation:MinLength=1 + Version string `json:"version"` + // SubscriptionID is the identifier of the subscription that contains the private compute gallery. + // +optional + SubscriptionID *string `json:"subscriptionID,omitempty"` + // ResourceGroup specifies the resource group containing the private compute gallery. + // +optional + ResourceGroup *string `json:"resourceGroup,omitempty"` + // Plan contains plan information. + // +optional + Plan *ImagePlan `json:"plan,omitempty"` +} + +// ImagePlan contains plan information for marketplace images. +type ImagePlan struct { + // Publisher is the name of the organization that created the image + // +kubebuilder:validation:MinLength=1 + Publisher string `json:"publisher"` + // Offer specifies the name of a group of related images created by the publisher. + // For example, UbuntuServer, WindowsServer + // +kubebuilder:validation:MinLength=1 + Offer string `json:"offer"` + // SKU specifies an instance of an offer, such as a major release of a distribution. + // For example, 18.04-LTS, 2019-Datacenter + // +kubebuilder:validation:MinLength=1 + SKU string `json:"sku"` +} + +// AzureMarketplaceImage defines an image in the Azure Marketplace to use for VM creation. +type AzureMarketplaceImage struct { + ImagePlan `json:",inline"` + + // Version specifies the version of an image sku. 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. + // +kubebuilder:validation:MinLength=1 + Version string `json:"version"` + // ThirdPartyImage indicates the image is published by a third party publisher and a Plan + // will be generated for it. + // +kubebuilder:default=false + // +optional + ThirdPartyImage bool `json:"thirdPartyImage"` +} + +// AzureSharedGalleryImage defines an image in a Shared Image Gallery to use for VM creation. +type AzureSharedGalleryImage struct { + // SubscriptionID is the identifier of the subscription that contains the shared image gallery + // +kubebuilder:validation:MinLength=1 + SubscriptionID string `json:"subscriptionID"` + // ResourceGroup specifies the resource group containing the shared image gallery + // +kubebuilder:validation:MinLength=1 + ResourceGroup string `json:"resourceGroup"` + // Gallery specifies the name of the shared image gallery that contains the image + // +kubebuilder:validation:MinLength=1 + Gallery string `json:"gallery"` + // Name is the name of the image + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + // Version specifies the version of the marketplace image. 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. + // +kubebuilder:validation:MinLength=1 + Version string `json:"version"` + // Publisher is the name of the organization that created the image. + // This value will be used to add a `Plan` in the API request when creating the VM/VMSS resource. + // This is needed when the source image from which this SIG image was built requires the `Plan` to be used. + // +optional + Publisher *string `json:"publisher,omitempty"` + // Offer specifies the name of a group of related images created by the publisher. + // For example, UbuntuServer, WindowsServer + // This value will be used to add a `Plan` in the API request when creating the VM/VMSS resource. + // This is needed when the source image from which this SIG image was built requires the `Plan` to be used. + // +optional + Offer *string `json:"offer,omitempty"` + // SKU specifies an instance of an offer, such as a major release of a distribution. + // For example, 18.04-LTS, 2019-Datacenter + // This value will be used to add a `Plan` in the API request when creating the VM/VMSS resource. + // This is needed when the source image from which this SIG image was built requires the `Plan` to be used. + // +optional + SKU *string `json:"sku,omitempty"` +} + +// VMIdentity defines the identity of the virtual machine, if configured. +// +kubebuilder:validation:Enum=None;SystemAssigned;UserAssigned +type VMIdentity string + +const ( + // VMIdentityNone ... + VMIdentityNone VMIdentity = "None" + // VMIdentitySystemAssigned ... + VMIdentitySystemAssigned VMIdentity = "SystemAssigned" + // VMIdentityUserAssigned ... + VMIdentityUserAssigned VMIdentity = "UserAssigned" +) + +// SpotEvictionPolicy defines the eviction policy for spot VMs, if configured. +// +kubebuilder:validation:Enum=Deallocate;Delete +type SpotEvictionPolicy string + +const ( + // SpotEvictionPolicyDeallocate is the default eviction policy and will deallocate the VM when the node is marked for eviction. + SpotEvictionPolicyDeallocate SpotEvictionPolicy = "Deallocate" + // SpotEvictionPolicyDelete will delete the VM when the node is marked for eviction. + SpotEvictionPolicyDelete SpotEvictionPolicy = "Delete" +) + +// UserAssignedIdentity defines the user-assigned identities provided +// by the user to be assigned to Azure resources. +type UserAssignedIdentity struct { + // ProviderID is the identification ID of the user-assigned Identity, the format of an identity is: + // 'azure:///subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}' + ProviderID string `json:"providerID"` +} + +// IdentityType represents different types of identities. +// +kubebuilder:validation:Enum=ServicePrincipal;UserAssignedMSI;ManualServicePrincipal;ServicePrincipalCertificate;WorkloadIdentity;UserAssignedIdentityCredential +type IdentityType string + +const ( + // UserAssignedMSI represents a user-assigned managed identity. + UserAssignedMSI IdentityType = "UserAssignedMSI" + + // ServicePrincipal represents a service principal using a client password as secret. + ServicePrincipal IdentityType = "ServicePrincipal" + + // ManualServicePrincipal represents a manual service principal. + ManualServicePrincipal IdentityType = "ManualServicePrincipal" + + // ServicePrincipalCertificate represents a service principal using a certificate as secret. + ServicePrincipalCertificate IdentityType = "ServicePrincipalCertificate" + + // WorkloadIdentity represents a WorkloadIdentity. + WorkloadIdentity IdentityType = "WorkloadIdentity" + + // UserAssignedIdentityCredential represents a UserAssignedIdentityCredential. + UserAssignedIdentityCredential IdentityType = "UserAssignedIdentityCredential" +) + +// OSDisk defines the operating system disk for a VM. +// +// WARNING: this requires any updates to ManagedDisk to be manually converted. This is due to the odd issue with +// conversion-gen where the warning message generated uses a relative directory import rather than the fully +// qualified import when generating outside of the GOPATH. +type OSDisk struct { + // +kubebuilder:default:=Linux + OSType string `json:"osType"` + // DiskSizeGB is the size in GB to assign to the OS disk. + // Will have a default of 30GB if not provided + // +optional + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk specifies the Managed Disk parameters for the OS disk. + // +optional + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + // +optional + DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` + // CachingType specifies the caching requirements. + // +optional + // +kubebuilder:validation:Enum=None;ReadOnly;ReadWrite + // +kubebuilder:default:=None + CachingType string `json:"cachingType,omitempty"` +} + +// DataDisk specifies the parameters that are used to add one or more data disks to the machine. +type DataDisk struct { + // NameSuffix is the suffix to be appended to the machine name to generate the disk name. + // Each disk name will be in format _. + NameSuffix string `json:"nameSuffix"` + // DiskSizeGB is the size in GB to assign to the data disk. + DiskSizeGB int32 `json:"diskSizeGB"` + // ManagedDisk specifies the Managed Disk parameters for the data disk. + // +optional + ManagedDisk *ManagedDiskParameters `json:"managedDisk,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. + // The value must be between 0 and 63. + // +optional + Lun *int32 `json:"lun,omitempty"` + // CachingType specifies the caching requirements. + // +optional + // +kubebuilder:validation:Enum=None;ReadOnly;ReadWrite + CachingType string `json:"cachingType,omitempty"` +} + +// VMExtension specifies the parameters for a custom VM extension. +type VMExtension struct { + // Name is the name of the extension. + Name string `json:"name"` + // Publisher is the name of the extension handler publisher. + Publisher string `json:"publisher"` + // Version specifies the version of the script handler. + Version string `json:"version"` + // Settings is a JSON formatted public settings for the extension. + // +optional + Settings Tags `json:"settings,omitempty"` + // ProtectedSettings is a JSON formatted protected settings for the extension. + // +optional + ProtectedSettings Tags `json:"protectedSettings,omitempty"` +} + +// ManagedDiskParameters defines the parameters of a managed disk. +type ManagedDiskParameters struct { + // +optional + StorageAccountType string `json:"storageAccountType,omitempty"` + // DiskEncryptionSet specifies the customer-managed disk encryption set resource id for the managed disk. + // +optional + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` + // SecurityProfile specifies the security profile for the managed disk. + // +optional + SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` +} + +// VMDiskSecurityProfile specifies the security profile settings for the managed disk. +// It can be set only for Confidential VMs. +type VMDiskSecurityProfile struct { + // DiskEncryptionSet specifies the customer-managed disk encryption set resource id for the + // managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + // VMGuest blob. + // +optional + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` + // SecurityEncryptionType specifies the encryption type of the managed disk. + // It is set to DiskWithVMGuestState to encrypt the managed disk along with the VMGuestState + // blob, and to VMGuestStateOnly to encrypt the VMGuestState blob only. + // When set to VMGuestStateOnly, VirtualizedTrustedPlatformModule should be set to Enabled. + // When set to DiskWithVMGuestState, EncryptionAtHost should be disabled, SecureBoot and + // VirtualizedTrustedPlatformModule should be set to Enabled. + // It can be set only for Confidential VMs. + // +kubebuilder:validation:Enum=VMGuestStateOnly;DiskWithVMGuestState + // +optional + SecurityEncryptionType SecurityEncryptionType `json:"securityEncryptionType,omitempty"` +} + +// DiskEncryptionSetParameters defines disk encryption options. +type DiskEncryptionSetParameters struct { + // ID defines resourceID for diskEncryptionSet resource. It must be in the same subscription + // +optional + ID string `json:"id,omitempty"` +} + +// DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user +// in the request to choose the location i.e, cache disk, resource disk or nvme disk space for +// Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS +// disk size requirements for Windows VM at +// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at +// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. +type DiffDiskPlacement string + +const ( + // DiffDiskPlacementCacheDisk places the OsDisk on cache disk. + DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" + + // DiffDiskPlacementNvmeDisk places the OsDisk on NVMe disk. + DiffDiskPlacementNvmeDisk DiffDiskPlacement = "NvmeDisk" + + // DiffDiskPlacementResourceDisk places the OsDisk on temp disk. + DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type. +func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { + return []DiffDiskPlacement{ + DiffDiskPlacementCacheDisk, + DiffDiskPlacementNvmeDisk, + DiffDiskPlacementResourceDisk, + } +} + +// DiffDiskSettings describe ephemeral disk settings for the os disk. +type DiffDiskSettings struct { + // Option enables ephemeral OS when set to "Local" + // See https://learn.microsoft.com/azure/virtual-machines/ephemeral-os-disks for full details + // +kubebuilder:validation:Enum=Local + Option string `json:"option"` + + // Placement specifies the ephemeral disk placement for operating system disk. If placement is specified, Option must be set to "Local". + // +kubebuilder:validation:Enum=CacheDisk;NvmeDisk;ResourceDisk + // +optional + Placement *DiffDiskPlacement `json:"placement,omitempty"` +} + +// SubnetRole defines the unique role of a subnet. +type SubnetRole string + +const ( + // SubnetNode defines a Kubernetes workload node role. + SubnetNode = SubnetRole(Node) + + // SubnetControlPlane defines a Kubernetes control plane node role. + SubnetControlPlane = SubnetRole(ControlPlane) + + // SubnetBastion defines a Bastion subnet role. + SubnetBastion = SubnetRole(Bastion) + + // SubnetCluster defines a role that can be used for both Kubernetes control plane node and Kubernetes workload node. + SubnetCluster = SubnetRole(Cluster) +) + +// SubnetSpec configures an Azure subnet. +type SubnetSpec struct { + // ID is the Azure resource ID of the subnet. + // READ-ONLY + // +optional + ID string `json:"id,omitempty"` + + // SecurityGroup defines the NSG (network security group) that should be attached to this subnet. + // +optional + SecurityGroup SecurityGroup `json:"securityGroup,omitempty"` + + // RouteTable defines the route table that should be attached to this subnet. + // +optional + RouteTable RouteTable `json:"routeTable,omitempty"` + + // NatGateway associated with this subnet. + // +optional + NatGateway NatGateway `json:"natGateway,omitempty"` + + SubnetClassSpec `json:",inline"` +} + +// ServiceEndpointSpec configures an Azure Service Endpoint. +type ServiceEndpointSpec struct { + Service string `json:"service"` + + Locations []string `json:"locations"` +} + +// PrivateLinkServiceConnection defines the specification for a private link service connection associated with a private endpoint. +type PrivateLinkServiceConnection struct { + // Name specifies the name of the private link service. + // +optional + Name string `json:"name,omitempty"` + // PrivateLinkServiceID specifies the resource ID of the private link service. + PrivateLinkServiceID string `json:"privateLinkServiceID,omitempty"` + // GroupIDs specifies the ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. + // +optional + GroupIDs []string `json:"groupIDs,omitempty"` + // RequestMessage specifies a message passed to the owner of the remote resource with the private endpoint connection request. + // +kubebuilder:validation:MaxLength=140 + // +optional + RequestMessage string `json:"requestMessage,omitempty"` +} + +// PrivateEndpointSpec configures an Azure Private Endpoint. +type PrivateEndpointSpec struct { + // Name specifies the name of the private endpoint. + Name string `json:"name"` + // Location specifies the region to create the private endpoint. + // +optional + Location string `json:"location,omitempty"` + // PrivateLinkServiceConnections specifies Private Link Service Connections of the private endpoint. + PrivateLinkServiceConnections []PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` + // CustomNetworkInterfaceName specifies the network interface name associated with the private endpoint. + // +optional + CustomNetworkInterfaceName string `json:"customNetworkInterfaceName,omitempty"` + // PrivateIPAddresses specifies the IP addresses for the network interface associated with the private endpoint. + // They have to be part of the subnet where the private endpoint is linked. + // +optional + PrivateIPAddresses []string `json:"privateIPAddresses,omitempty"` + // ApplicationSecurityGroups specifies the Application security group in which the private endpoint IP configuration is included. + // +optional + ApplicationSecurityGroups []string `json:"applicationSecurityGroups,omitempty"` + // ManualApproval specifies if the connection approval needs to be done manually or not. + // Set it true when the network admin does not have access to approve connections to the remote resource. + // Defaults to false. + // +optional + ManualApproval bool `json:"manualApproval,omitempty"` +} + +// NetworkInterface defines a network interface. +type NetworkInterface struct { + // SubnetName specifies the subnet in which the new network interface will be placed. + SubnetName string `json:"subnetName,omitempty"` + + // PrivateIPConfigs specifies the number of private IP addresses to attach to the interface. + // Defaults to 1 if not specified. + // +optional + PrivateIPConfigs int `json:"privateIPConfigs,omitempty"` + + // AcceleratedNetworking enables or disables Azure accelerated networking. If omitted, it will be set based on + // whether the requested VMSize supports accelerated networking. + // If AcceleratedNetworking is set to true with a VMSize that does not support it, Azure will return an error. + // +kubebuilder:validation:nullable + // +optional + AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"` +} + +// GetControlPlaneSubnet returns a subnet that has a role assigned to controlplane or all. Subnets with role controlplane are given higher priority. + +// Priority is given for subnet that have role assigned as controlplane + +// GetSubnet returns a subnet based on the subnet role. + +// UpdateControlPlaneSubnet updates the cluster control plane subnets. +func (n *NetworkSpec) UpdateControlPlaneSubnet(subnet SubnetSpec) { + n.UpdateSubnet(subnet, SubnetControlPlane) + n.UpdateSubnet(subnet, SubnetCluster) +} + +// UpdateSubnet updates the subnet based on the subnet role. +func (n *NetworkSpec) UpdateSubnet(subnet SubnetSpec, role SubnetRole) { + for i, sn := range n.Subnets { + if sn.Role == role { + n.Subnets[i] = subnet + } + } +} + +// IsNatGatewayEnabled returns whether or not a NAT gateway is enabled on the subnet. +func (s SubnetSpec) IsNatGatewayEnabled() bool { + return s.NatGateway.Name != "" +} + +// IsIPv6Enabled returns whether or not IPv6 is enabled on the subnet. +func (s SubnetSpec) IsIPv6Enabled() bool { + return slices.ContainsFunc(s.CIDRBlocks, net.IsIPv6CIDRString) +} + +// GetSecurityRuleByDestination returns security group rule, which matches provided destination ports. +func (s SubnetSpec) GetSecurityRuleByDestination(port string) *SecurityRule { + for _, rule := range s.SecurityGroup.SecurityRules { + if rule.DestinationPorts != nil && *rule.DestinationPorts == port { + return &rule + } + } + + return nil +} + +// SecurityProfile specifies the Security profile settings for a +// virtual machine or virtual machine scale set. +type SecurityProfile struct { + // This field indicates whether Host Encryption should be enabled + // or disabled for a virtual machine or virtual machine scale set. + // This should be disabled when SecurityEncryptionType is set to DiskWithVMGuestState. + // Default is disabled. + // +optional + EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` + // SecurityType specifies the SecurityType of the virtual machine. It has to be set to any specified value to + // enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. + // +kubebuilder:validation:Enum=ConfidentialVM;TrustedLaunch + // +optional + SecurityType SecurityTypes `json:"securityType,omitempty"` + // UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual machine. + // +optional + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` +} + +// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual +// machine. +// +optional +type UefiSettings struct { + // SecureBootEnabled specifies whether secure boot should be enabled on the virtual machine. + // Secure Boot verifies the digital signature of all boot components and halts the boot process if signature verification fails. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is false. + //+optional + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` + // VTpmEnabled specifies whether vTPM should be enabled on the virtual machine. + // When true it enables the virtualized trusted platform module measurements to create a known good boot integrity policy baseline. + // The integrity policy baseline is used for comparison with measurements from subsequent VM boots to determine if anything has changed. + // This is required to be set to Enabled if SecurityEncryptionType is defined. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is false. + // +optional + VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` +} + +// AddressRecord specifies a DNS record mapping a hostname to an IPV4 or IPv6 address. +type AddressRecord struct { + Hostname string + IP string +} + +// CloudProviderConfigOverrides represents the fields that can be overridden in azure cloud provider config. +type CloudProviderConfigOverrides struct { + // +optional + RateLimits []RateLimitSpec `json:"rateLimits,omitempty"` + // +optional + BackOffs BackOffConfig `json:"backOffs,omitempty"` +} + +// BackOffConfig indicates the back-off config options. +type BackOffConfig struct { + // +optional + CloudProviderBackoff bool `json:"cloudProviderBackoff,omitempty"` + // +optional + CloudProviderBackoffRetries int `json:"cloudProviderBackoffRetries,omitempty"` + // +optional + CloudProviderBackoffExponent *resource.Quantity `json:"cloudProviderBackoffExponent,omitempty"` + // +optional + CloudProviderBackoffDuration int `json:"cloudProviderBackoffDuration,omitempty"` + // +optional + CloudProviderBackoffJitter *resource.Quantity `json:"cloudProviderBackoffJitter,omitempty"` +} + +// RateLimitSpec represents the rate limit configuration for a particular kind of resource. +// Eg. loadBalancerRateLimit is used to configure rate limits for load balancers. +// This eventually gets converted to CloudProviderRateLimitConfig that cloud-provider-azure expects. +// See: https://github.com/kubernetes-sigs/cloud-provider-azure/blob/d585c2031925b39c925624302f22f8856e29e352/pkg/provider/azure_ratelimit.go#L25 +// We cannot use CloudProviderRateLimitConfig directly because floating point values are not supported in controller-tools. +// See: https://github.com/kubernetes-sigs/controller-tools/issues/245 +type RateLimitSpec struct { + // Name is the name of the rate limit spec. + // +kubebuilder:validation:Enum=defaultRateLimit;routeRateLimit;subnetsRateLimit;interfaceRateLimit;routeTableRateLimit;loadBalancerRateLimit;publicIPAddressRateLimit;securityGroupRateLimit;virtualMachineRateLimit;storageAccountRateLimit;diskRateLimit;snapshotRateLimit;virtualMachineScaleSetRateLimit;virtualMachineSizesRateLimit;availabilitySetRateLimit + Name string `json:"name"` + // +optional + Config RateLimitConfig `json:"config,omitempty"` +} + +// RateLimitConfig indicates the rate limit config options. +type RateLimitConfig struct { + // +optional + CloudProviderRateLimit bool `json:"cloudProviderRateLimit,omitempty"` + // +optional + CloudProviderRateLimitQPS *resource.Quantity `json:"cloudProviderRateLimitQPS,omitempty"` + // +optional + CloudProviderRateLimitBucket int `json:"cloudProviderRateLimitBucket,omitempty"` + // +optional + CloudProviderRateLimitQPSWrite *resource.Quantity `json:"cloudProviderRateLimitQPSWrite,omitempty"` + // +optional + CloudProviderRateLimitBucketWrite int `json:"cloudProviderRateLimitBucketWrite,omitempty"` +} + +const ( + // DefaultRateLimit ... + DefaultRateLimit = "defaultRateLimit" + // RouteRateLimit ... + RouteRateLimit = "routeRateLimit" + // SubnetsRateLimit ... + SubnetsRateLimit = "subnetsRateLimit" + // InterfaceRateLimit ... + InterfaceRateLimit = "interfaceRateLimit" + // RouteTableRateLimit ... + RouteTableRateLimit = "routeTableRateLimit" + // LoadBalancerRateLimit ... + LoadBalancerRateLimit = "loadBalancerRateLimit" + // PublicIPAddressRateLimit ... + PublicIPAddressRateLimit = "publicIPAddressRateLimit" + // SecurityGroupRateLimit ... + SecurityGroupRateLimit = "securityGroupRateLimit" + // VirtualMachineRateLimit ... + VirtualMachineRateLimit = "virtualMachineRateLimit" + // StorageAccountRateLimit ... + StorageAccountRateLimit = "storageAccountRateLimit" + // DiskRateLimit ... + DiskRateLimit = "diskRateLimit" + // SnapshotRateLimit ... + SnapshotRateLimit = "snapshotRateLimit" + // VirtualMachineScaleSetRateLimit ... + VirtualMachineScaleSetRateLimit = "virtualMachineScaleSetRateLimit" + // VirtualMachineSizesRateLimit ... + VirtualMachineSizesRateLimit = "virtualMachineSizesRateLimit" + // AvailabilitySetRateLimit ... + AvailabilitySetRateLimit = "availabilitySetRateLimit" +) + +// BastionHostSkuName is the name of the SKU used to specify the tier of Azure Bastion Host. +type BastionHostSkuName string + +const ( + // BasicBastionHostSku SKU for the Azure Bastion Host. + BasicBastionHostSku BastionHostSkuName = "Basic" + // StandardBastionHostSku SKU for the Azure Bastion Host. + StandardBastionHostSku BastionHostSkuName = "Standard" +) + +// BastionSpec specifies how the Bastion feature should be set up for the cluster. +type BastionSpec struct { + // +optional + AzureBastion *AzureBastion `json:"azureBastion,omitempty"` +} + +// AzureBastion specifies how the Azure Bastion cloud component should be configured. +type AzureBastion struct { + // +optional + Name string `json:"name,omitempty"` + // +optional + Subnet SubnetSpec `json:"subnet,omitempty"` + // +optional + PublicIP PublicIPSpec `json:"publicIP,omitempty"` + // BastionHostSkuName configures the tier of the Azure Bastion Host. Can be either Basic or Standard. Defaults to Basic. + // +kubebuilder:default=Basic + // +kubebuilder:validation:Enum=Basic;Standard + // +optional + Sku BastionHostSkuName `json:"sku,omitempty"` + // EnableTunneling enables the native client support feature for the Azure Bastion Host. Defaults to false. + // +kubebuilder:default=false + // +optional + EnableTunneling bool `json:"enableTunneling,omitempty"` +} + +// FleetsMember defines the fleets member configuration. +// See also [AKS doc]. +// +// [AKS doc]: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/2023-03-15-preview/fleets/members +type FleetsMember struct { + // Name is the name of the member. + // +optional + Name string `json:"name,omitempty"` + + FleetsMemberClassSpec `json:",inline"` +} + +// BackendPool describes the backend pool of the load balancer. +type BackendPool struct { + // Name specifies the name of backend pool for the load balancer. If not specified, the default name will + // be set, depending on the load balancer role. + // +optional + Name string `json:"name,omitempty"` +} + +// IsTerminalProvisioningState returns true if the ProvisioningState is a terminal state for an Azure resource. +func IsTerminalProvisioningState(state ProvisioningState) bool { + return state == Failed || state == Succeeded +} + +// Diagnostics is used to configure the diagnostic settings of the virtual machine. +type Diagnostics struct { + // Boot configures the boot diagnostics settings for the virtual machine. + // This allows to configure capturing serial output from the virtual machine on boot. + // This is useful for debugging software based launch issues. + // If not specified then Boot diagnostics (Managed) will be enabled. + // +optional + Boot *BootDiagnostics `json:"boot,omitempty"` +} + +// BootDiagnostics configures the boot diagnostics settings for the virtual machine. +// This allows you to configure capturing serial output from the virtual machine on boot. +// This is useful for debugging software based launch issues. +// +union +type BootDiagnostics struct { + // StorageAccountType determines if the storage account for storing the diagnostics data + // should be disabled (Disabled), provisioned by Azure (Managed) or by the user (UserManaged). + // +kubebuilder:validation:Required + // +unionDiscriminator + StorageAccountType BootDiagnosticsStorageAccountType `json:"storageAccountType"` + + // UserManaged provides a reference to the user-managed storage account. + // +optional + UserManaged *UserManagedBootDiagnostics `json:"userManaged,omitempty"` +} + +// BootDiagnosticsStorageAccountType defines the list of valid storage account types +// for the boot diagnostics. +// +kubebuilder:validation:Enum:="Managed";"UserManaged";"Disabled" +type BootDiagnosticsStorageAccountType string + +const ( + // DisabledDiagnosticsStorage is used to determine that the diagnostics storage account + // should be disabled. + DisabledDiagnosticsStorage BootDiagnosticsStorageAccountType = "Disabled" + + // ManagedDiagnosticsStorage is used to determine that the diagnostics storage account + // should be provisioned by Azure. + ManagedDiagnosticsStorage BootDiagnosticsStorageAccountType = "Managed" + + // UserManagedDiagnosticsStorage is used to determine that the diagnostics storage account + // should be provisioned by the User. + UserManagedDiagnosticsStorage BootDiagnosticsStorageAccountType = "UserManaged" +) + +// UserManagedBootDiagnostics provides a reference to a user-managed +// storage account. +type UserManagedBootDiagnostics struct { + // StorageAccountURI is the URI of the user-managed storage account. + // The URI typically will be `https://.blob.core.windows.net/` + // but may differ if you are using Azure DNS zone endpoints. + // You can find the correct endpoint by looking for the Blob Primary Endpoint in the + // endpoints tab in the Azure console or with the CLI by issuing + // `az storage account list --query='[].{name: name, "resource group": resourceGroup, "blob endpoint": primaryEndpoints.blob}'`. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=`^https://` + // +kubebuilder:validation:MaxLength=1024 + StorageAccountURI string `json:"storageAccountURI"` +} + +// OrchestrationModeType represents the orchestration mode for a Virtual Machine Scale Set backing an AzureMachinePool. +// +kubebuilder:validation:Enum=Flexible;Uniform +type OrchestrationModeType string + +const ( + // FlexibleOrchestrationMode treats VMs as individual resources accessible by standard VM APIs. + FlexibleOrchestrationMode OrchestrationModeType = "Flexible" + // UniformOrchestrationMode treats VMs as identical instances accessible by the VMSS VM API. + UniformOrchestrationMode OrchestrationModeType = "Uniform" +) + +// ExtensionPlan represents the plan for an AKS marketplace extension. +type ExtensionPlan struct { + // Name is the user-defined name of the 3rd Party Artifact that is being procured. + // +optional + Name string `json:"name,omitempty"` + + // Product is the name of the 3rd Party artifact that is being procured. + // +optional + Product string `json:"product,omitempty"` + + // PromotionCode is a publisher-provided promotion code as provisioned in Data Market for the said product/artifact. + // +optional + PromotionCode string `json:"promotionCode,omitempty"` + + // Publisher is the name of the publisher of the 3rd Party Artifact that is being bought. + // +optional + Publisher string `json:"publisher,omitempty"` + + // Version is the version of the plan. + // +optional + Version string `json:"version,omitempty"` +} + +// ExtensionScope defines the scope of the AKS marketplace extension, if configured. +type ExtensionScope struct { + // ScopeType is the scope of the extension. It can be either Cluster or Namespace, but not both. + ScopeType ExtensionScopeType `json:"scopeType"` + + // ReleaseNamespace is the namespace where the extension Release must be placed, for a Cluster-scoped extension. + // Required for Cluster-scoped extensions. + // +optional + ReleaseNamespace string `json:"releaseNamespace,omitempty"` + + // TargetNamespace is the namespace where the extension will be created for a Namespace-scoped extension. + // Required for Namespace-scoped extensions. + // +optional + TargetNamespace string `json:"targetNamespace,omitempty"` +} + +// ExtensionScopeType defines the scope type of the AKS marketplace extension, if configured. +// +kubebuilder:validation:Enum=Cluster;Namespace +type ExtensionScopeType string + +const ( + // ExtensionScopeCluster ... + ExtensionScopeCluster ExtensionScopeType = "Cluster" + // ExtensionScopeNamespace ... + ExtensionScopeNamespace ExtensionScopeType = "Namespace" +) + +// ExtensionIdentity defines the identity of the AKS marketplace extension, if configured. +// +kubebuilder:validation:Enum=SystemAssigned +type ExtensionIdentity string + +const ( + // ExtensionIdentitySystemAssigned ... + ExtensionIdentitySystemAssigned ExtensionIdentity = "SystemAssigned" +) + +// AKSAssignedIdentity defines the AKS assigned-identity of the aks marketplace extension, if configured. +// +kubebuilder:validation:Enum=SystemAssigned;UserAssigned +type AKSAssignedIdentity string + +const ( + // AKSAssignedIdentitySystemAssigned ... + AKSAssignedIdentitySystemAssigned AKSAssignedIdentity = "SystemAssigned" + + // AKSAssignedIdentityUserAssigned ... + AKSAssignedIdentityUserAssigned AKSAssignedIdentity = "UserAssigned" +) + +// DisableComponent defines a component to be disabled in CAPZ such as a controller or webhook. +// +kubebuilder:validation:Enum=DisableASOSecretController;DisableAzureJSONMachineController +type DisableComponent string + +// NOTE: when adding a new DisableComponent, please also add it to the ValidDisableableComponents map. +const ( + // DisableASOSecretController disables the ASOSecretController from being deployed. + DisableASOSecretController DisableComponent = "DisableASOSecretController" + + // DisableAzureJSONMachineController disables the AzureJSONMachineController from being deployed. + DisableAzureJSONMachineController DisableComponent = "DisableAzureJSONMachineController" +) + +// ValidDisableableComponents is a map of valid disableable components used to quickly validate whether a component is +// valid or not. +var ValidDisableableComponents = map[DisableComponent]struct{}{ + DisableASOSecretController: {}, + DisableAzureJSONMachineController: {}, +} diff --git a/pkg/capi/azure/api/v1beta1/types_class.go b/pkg/capi/azure/api/v1beta1/types_class.go new file mode 100644 index 000000000000..358cb1e60824 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/types_class.go @@ -0,0 +1,568 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// AzureClusterClassSpec defines the AzureCluster properties that may be shared across several Azure clusters. +type AzureClusterClassSpec struct { + // +optional + SubscriptionID string `json:"subscriptionID,omitempty"` + + Location string `json:"location"` + + // ExtendedLocation is an optional set of ExtendedLocation properties for clusters on Azure public MEC. + // +optional + ExtendedLocation *ExtendedLocationSpec `json:"extendedLocation,omitempty"` + + // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the + // ones added by default. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // IdentityRef is a reference to an AzureIdentity to be used when reconciling this cluster + // +optional + IdentityRef *corev1.ObjectReference `json:"identityRef,omitempty"` + + // AzureEnvironment is the name of the AzureCloud to be used. + // The default value that would be used by most users is "AzurePublicCloud", other values are: + // - ChinaCloud: "AzureChinaCloud" + // - GermanCloud: "AzureGermanCloud" + // - PublicCloud: "AzurePublicCloud" + // - USGovernmentCloud: "AzureUSGovernmentCloud" + // + // Note that values other than the default must also be accompanied by corresponding changes to the + // aso-controller-settings Secret to configure ASO to refer to the non-Public cloud. ASO currently does + // not support referring to multiple different clouds in a single installation. The following fields must + // be defined in the Secret: + // - AZURE_AUTHORITY_HOST + // - AZURE_RESOURCE_MANAGER_ENDPOINT + // - AZURE_RESOURCE_MANAGER_AUDIENCE + // + // See the [ASO docs] for more details. + // + // [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/ + // +optional + AzureEnvironment string `json:"azureEnvironment,omitempty"` + + // CloudProviderConfigOverrides is an optional set of configuration values that can be overridden in azure cloud provider config. + // This is only a subset of options that are available in azure cloud provider config. + // Some values for the cloud provider config are inferred from other parts of cluster api provider azure spec, and may not be available for overrides. + // See: https://cloud-provider-azure.sigs.k8s.io/install/configs + // Note: All cloud provider config values can be customized by creating the secret beforehand. CloudProviderConfigOverrides is only used when the secret is managed by the Azure Provider. + // +optional + CloudProviderConfigOverrides *CloudProviderConfigOverrides `json:"cloudProviderConfigOverrides,omitempty"` + + // FailureDomains is a list of failure domains in the cluster's region, used to restrict + // eligibility to host the control plane. A FailureDomain maps to an availability zone, + // which is a separated group of datacenters within a region. + // See: https://learn.microsoft.com/azure/reliability/availability-zones-overview + // +optional + FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` +} + +// AzureManagedControlPlaneClassSpec defines the AzureManagedControlPlane properties that may be shared across several azure managed control planes. +type AzureManagedControlPlaneClassSpec struct { + // MachineTemplate contains information about how machines + // should be shaped when creating or updating a control plane. + // For the AzureManagedControlPlaneTemplate, this field is used + // only to fulfill the CAPI contract. + // +optional + MachineTemplate *AzureManagedControlPlaneTemplateMachineTemplate `json:"machineTemplate,omitempty"` + + // ResourceGroupName is the name of the Azure resource group for this AKS Cluster. + // Immutable. + ResourceGroupName string `json:"resourceGroupName"` + + // Version defines the desired Kubernetes version. + // +kubebuilder:validation:MinLength:=2 + Version string `json:"version"` + + // VirtualNetwork describes the virtual network for the AKS cluster. It will be created if it does not already exist. + // +optional + VirtualNetwork ManagedControlPlaneVirtualNetwork `json:"virtualNetwork,omitempty"` + + // SubscriptionID is the GUID of the Azure subscription that owns this cluster. + // +optional + SubscriptionID string `json:"subscriptionID,omitempty"` + + // Location is a string matching one of the canonical Azure region names. Examples: "westus2", "eastus". + Location string `json:"location"` + + // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the + // ones added by default. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // NetworkPlugin used for building Kubernetes network. + // +kubebuilder:validation:Enum=azure;kubenet;none + // +kubebuilder:default:=azure + // +optional + NetworkPlugin *string `json:"networkPlugin,omitempty"` + + // NetworkPluginMode is the mode the network plugin should use. + // Allowed value is "overlay". + // +kubebuilder:validation:Enum=overlay + // +optional + NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` + + // NetworkPolicy used for building Kubernetes network. + // +kubebuilder:validation:Enum=azure;calico;cilium + // +optional + NetworkPolicy *string `json:"networkPolicy,omitempty"` + + // NetworkDataplane is the dataplane used for building the Kubernetes network. + // +kubebuilder:validation:Enum=azure;cilium + // +optional + NetworkDataplane *NetworkDataplaneType `json:"networkDataplane,omitempty"` + + // Outbound configuration used by Nodes. + // +kubebuilder:validation:Enum=loadBalancer;managedNATGateway;userAssignedNATGateway;userDefinedRouting + // +optional + OutboundType *ManagedControlPlaneOutboundType `json:"outboundType,omitempty"` + + // DNSServiceIP is an IP address assigned to the Kubernetes DNS service. + // It must be within the Kubernetes service address range specified in serviceCidr. + // Immutable. + // +optional + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + + // LoadBalancerSKU is the SKU of the loadBalancer to be provisioned. + // Immutable. + // +kubebuilder:validation:Enum=Basic;Standard + // +kubebuilder:default:=Standard + // +optional + LoadBalancerSKU *string `json:"loadBalancerSKU,omitempty"` + + // IdentityRef is a reference to a AzureClusterIdentity to be used when reconciling this cluster + IdentityRef *corev1.ObjectReference `json:"identityRef"` + + // AadProfile is Azure Active Directory configuration to integrate with AKS for aad authentication. + // +optional + AADProfile *AADProfile `json:"aadProfile,omitempty"` + + // AddonProfiles are the profiles of managed cluster add-on. + // +optional + AddonProfiles []AddonProfile `json:"addonProfiles,omitempty"` + + // SKU is the SKU of the AKS to be provisioned. + // +optional + SKU *AKSSku `json:"sku,omitempty"` + + // LoadBalancerProfile is the profile of the cluster load balancer. + // +optional + LoadBalancerProfile *LoadBalancerProfile `json:"loadBalancerProfile,omitempty"` + + // APIServerAccessProfile is the access profile for AKS API server. + // Immutable except for `authorizedIPRanges`. + // +optional + APIServerAccessProfile *APIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + + // AutoscalerProfile is the parameters to be applied to the cluster-autoscaler when enabled + // +optional + AutoScalerProfile *AutoScalerProfile `json:"autoscalerProfile,omitempty"` + + // AzureEnvironment is the name of the AzureCloud to be used. + // The default value that would be used by most users is "AzurePublicCloud", other values are: + // - ChinaCloud: "AzureChinaCloud" + // - PublicCloud: "AzurePublicCloud" + // - USGovernmentCloud: "AzureUSGovernmentCloud" + // + // Note that values other than the default must also be accompanied by corresponding changes to the + // aso-controller-settings Secret to configure ASO to refer to the non-Public cloud. ASO currently does + // not support referring to multiple different clouds in a single installation. The following fields must + // be defined in the Secret: + // - AZURE_AUTHORITY_HOST + // - AZURE_RESOURCE_MANAGER_ENDPOINT + // - AZURE_RESOURCE_MANAGER_AUDIENCE + // + // See the [ASO docs] for more details. + // + // [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/ + // +optional + AzureEnvironment string `json:"azureEnvironment,omitempty"` + + // Identity configuration used by the AKS control plane. + // +optional + Identity *Identity `json:"identity,omitempty"` + + // KubeletUserAssignedIdentity is the user-assigned identity for kubelet. + // For authentication with Azure Container Registry. + // +optional + KubeletUserAssignedIdentity string `json:"kubeletUserAssignedIdentity,omitempty"` + + // HTTPProxyConfig is the HTTP proxy configuration for the cluster. + // Immutable. + // +optional + HTTPProxyConfig *HTTPProxyConfig `json:"httpProxyConfig,omitempty"` + + // OIDCIssuerProfile is the OIDC issuer profile of the Managed Cluster. + // +optional + OIDCIssuerProfile *OIDCIssuerProfile `json:"oidcIssuerProfile,omitempty"` + + // DisableLocalAccounts disables getting static credentials for this cluster when set. Expected to only be used for AAD clusters. + // +optional + DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` + + // FleetsMember is the spec for the fleet this cluster is a member of. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/2023-03-15-preview/fleets/members + // +optional + FleetsMember *FleetsMemberClassSpec `json:"fleetsMember,omitempty"` + + // Extensions is a list of AKS extensions to be installed on the cluster. + // +optional + Extensions []AKSExtension `json:"extensions,omitempty"` + + // AutoUpgradeProfile defines the auto upgrade configuration. + // +optional + AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + + // SecurityProfile defines the security profile for cluster. + // +optional + SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` + + // ASOManagedClusterPatches defines JSON merge patches to be applied to the generated ASO ManagedCluster resource. + // WARNING: This is meant to be used sparingly to enable features for development and testing that are not + // otherwise represented in the CAPZ API. Misconfiguration that conflicts with CAPZ's normal mode of + // operation is possible. + // +optional + ASOManagedClusterPatches []string `json:"asoManagedClusterPatches,omitempty"` + + // EnablePreviewFeatures enables preview features for the cluster. + // +kubebuilder:default:=false + // +optional + EnablePreviewFeatures *bool `json:"enablePreviewFeatures,omitempty"` +} + +// ManagedClusterAutoUpgradeProfile defines the auto upgrade profile for a managed cluster. +type ManagedClusterAutoUpgradeProfile struct { + // UpgradeChannel determines the type of upgrade channel for automatically upgrading the cluster. + // +kubebuilder:validation:Enum=node-image;none;patch;rapid;stable + // +optional + UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` +} + +// AzureManagedMachinePoolClassSpec defines the AzureManagedMachinePool properties that may be shared across several Azure managed machinepools. +type AzureManagedMachinePoolClassSpec struct { + // AdditionalTags is an optional set of tags to add to Azure resources managed by the + // Azure provider, in addition to the ones added by default. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // Name is the name of the agent pool. If not specified, CAPZ uses the name of the CR as the agent pool name. + // Immutable. + // +optional + Name *string `json:"name,omitempty"` + + // Mode represents the mode of an agent pool. Possible values include: System, User. + // +kubebuilder:validation:Enum=System;User + Mode string `json:"mode"` + + // SKU is the size of the VMs in the node pool. + // Immutable. + SKU string `json:"sku"` + + // OSDiskSizeGB is the disk size for every machine in this agent pool. + // If you specify 0, it will apply the default osDisk size according to the vmSize specified. + // Immutable. + // +optional + OSDiskSizeGB *int `json:"osDiskSizeGB,omitempty"` + + // AvailabilityZones - Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + // Immutable. + // +optional + AvailabilityZones []string `json:"availabilityZones,omitempty"` + + // Node labels represent the labels for all of the nodes present in node pool. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/azure/aks/use-labels + // +optional + NodeLabels map[string]string `json:"nodeLabels,omitempty"` + + // Taints specifies the taints for nodes present in this agent pool. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/azure/aks/use-multiple-node-pools#setting-node-pool-taints + // +optional + Taints Taints `json:"taints,omitempty"` + + // Scaling specifies the autoscaling parameters for the node pool. + // +optional + Scaling *ManagedMachinePoolScaling `json:"scaling,omitempty"` + + // MaxPods specifies the kubelet `--max-pods` configuration for the node pool. + // Immutable. + // See also [AKS doc], [K8s doc]. + // + // [AKS doc]: https://learn.microsoft.com/azure/aks/configure-azure-cni#configure-maximum---new-clusters + // [K8s doc]: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ + // +optional + MaxPods *int `json:"maxPods,omitempty"` + + // OsDiskType specifies the OS disk type for each node in the pool. Allowed values are 'Ephemeral' and 'Managed' (default). + // Immutable. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/azure/aks/cluster-configuration#ephemeral-os + // +kubebuilder:validation:Enum=Ephemeral;Managed + // +kubebuilder:default=Managed + // +optional + OsDiskType *string `json:"osDiskType,omitempty"` + + // EnableUltraSSD enables the storage type UltraSSD_LRS for the agent pool. + // Immutable. + // +optional + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + + // OSType specifies the virtual machine operating system. Default to Linux. Possible values include: 'Linux', 'Windows'. + // 'Windows' requires the AzureManagedControlPlane's `spec.networkPlugin` to be `azure`. + // Immutable. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/rest/api/aks/agent-pools/create-or-update?tabs=HTTP#ostype + // +kubebuilder:validation:Enum=Linux;Windows + // +kubebuilder:default:=Linux + // +optional + OSType *string `json:"osType,omitempty"` + + // EnableNodePublicIP controls whether or not nodes in the pool each have a public IP address. + // Immutable. + // +optional + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + + // NodePublicIPPrefixID specifies the public IP prefix resource ID which VM nodes should use IPs from. + // Immutable. + // +optional + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + + // ScaleSetPriority specifies the ScaleSetPriority value. Default to Regular. Possible values include: 'Regular', 'Spot' + // Immutable. + // +kubebuilder:validation:Enum=Regular;Spot + // +optional + ScaleSetPriority *string `json:"scaleSetPriority,omitempty"` + + // ScaleDownMode affects the cluster autoscaler behavior. Default to Delete. Possible values include: 'Deallocate', 'Delete' + // +kubebuilder:validation:Enum=Deallocate;Delete + // +kubebuilder:default=Delete + // +optional + ScaleDownMode *string `json:"scaleDownMode,omitempty"` + + // SpotMaxPrice defines max price to pay for spot instance. Possible values are any decimal value greater than zero or -1. + // If you set the max price to be -1, the VM won't be evicted based on price. The price for the VM will be the current price + // for spot or the price for a standard VM, which ever is less, as long as there's capacity and quota available. + // +optional + SpotMaxPrice *resource.Quantity `json:"spotMaxPrice,omitempty"` + + // KubeletConfig specifies the kubelet configurations for nodes. + // Immutable. + // +optional + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + + // KubeletDiskType specifies the kubelet disk type. Default to OS. Possible values include: 'OS', 'Temporary'. + // Requires Microsoft.ContainerService/KubeletDisk preview feature to be set. + // Immutable. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/rest/api/aks/agent-pools/create-or-update?tabs=HTTP#kubeletdisktype + // +kubebuilder:validation:Enum=OS;Temporary + // +optional + KubeletDiskType *KubeletDiskType `json:"kubeletDiskType,omitempty"` + + // LinuxOSConfig specifies the custom Linux OS settings and configurations. + // Immutable. + // +optional + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + + // SubnetName specifies the Subnet where the MachinePool will be placed + // Immutable. + // +optional + SubnetName *string `json:"subnetName,omitempty"` + + // EnableFIPS indicates whether FIPS is enabled on the node pool. + // Immutable. + // +optional + EnableFIPS *bool `json:"enableFIPS,omitempty"` + + // EnableEncryptionAtHost indicates whether host encryption is enabled on the node pool. + // Immutable. + // See also [AKS doc]. + // + // [AKS doc]: https://learn.microsoft.com/en-us/azure/aks/enable-host-encryption + // +optional + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + + // ASOManagedClustersAgentPoolPatches defines JSON merge patches to be applied to the generated ASO ManagedClustersAgentPool resource. + // WARNING: This is meant to be used sparingly to enable features for development and testing that are not + // otherwise represented in the CAPZ API. Misconfiguration that conflicts with CAPZ's normal mode of + // operation is possible. + // +optional + ASOManagedClustersAgentPoolPatches []string `json:"asoManagedClustersAgentPoolPatches,omitempty"` +} + +// ManagedControlPlaneVirtualNetworkClassSpec defines the ManagedControlPlaneVirtualNetwork properties that may be shared across several managed control plane vnets. +type ManagedControlPlaneVirtualNetworkClassSpec struct { + // +kubebuilder:default:="10.0.0.0/8" + CIDRBlock string `json:"cidrBlock"` + // +optional + Subnet ManagedControlPlaneSubnet `json:"subnet,omitempty"` +} + +// APIServerAccessProfileClassSpec defines the APIServerAccessProfile properties that may be shared across several API server access profiles. +type APIServerAccessProfileClassSpec struct { + // EnablePrivateCluster indicates whether to create the cluster as a private cluster or not. + // +optional + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` + + // PrivateDNSZone enables private dns zone mode for private cluster. + // +optional + PrivateDNSZone *string `json:"privateDNSZone,omitempty"` + + // EnablePrivateClusterPublicFQDN indicates whether to create additional public FQDN for private cluster or not. + // +optional + EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` +} + +// ExtendedLocationSpec defines the ExtendedLocation properties to enable CAPZ for Azure public MEC. +type ExtendedLocationSpec struct { + // Name defines the name for the extended location. + Name string `json:"name"` + + // Type defines the type for the extended location. + // +kubebuilder:validation:Enum=EdgeZone + Type string `json:"type"` +} + +// NetworkClassSpec defines the NetworkSpec properties that may be shared across several Azure clusters. +type NetworkClassSpec struct { + // PrivateDNSZoneName defines the zone name for the Azure Private DNS. + // +optional + PrivateDNSZoneName string `json:"privateDNSZoneName,omitempty"` + + // PrivateDNSZoneResourceGroup defines the resource group to be used for Azure Private DNS Zone. + // If not specified, the resource group of the cluster will be used to create the Azure Private DNS Zone. + // +optional + PrivateDNSZoneResourceGroup string `json:"privateDNSZoneResourceGroup,omitempty"` +} + +// VnetClassSpec defines the VnetSpec properties that may be shared across several Azure clusters. +type VnetClassSpec struct { + // CIDRBlocks defines the virtual network's address space, specified as one or more address prefixes in CIDR notation. + // +optional + CIDRBlocks []string `json:"cidrBlocks,omitempty"` + + // Tags is a collection of tags describing the resource. + // +optional + Tags Tags `json:"tags,omitempty"` +} + +// SubnetClassSpec defines the SubnetSpec properties that may be shared across several Azure clusters. +type SubnetClassSpec struct { + // Name defines a name for the subnet resource. + Name string `json:"name"` + + // Role defines the subnet role (eg. Node, ControlPlane) + // +kubebuilder:validation:Enum=node;control-plane;bastion;cluster + Role SubnetRole `json:"role"` + + // CIDRBlocks defines the subnet's address space, specified as one or more address prefixes in CIDR notation. + // +optional + CIDRBlocks []string `json:"cidrBlocks,omitempty"` + + // ServiceEndpoints is a slice of Virtual Network service endpoints to enable for the subnets. + // +optional + ServiceEndpoints ServiceEndpoints `json:"serviceEndpoints,omitempty"` + + // PrivateEndpoints defines a list of private endpoints that should be attached to this subnet. + // +optional + PrivateEndpoints PrivateEndpoints `json:"privateEndpoints,omitempty"` +} + +// LoadBalancerClassSpec defines the LoadBalancerSpec properties that may be shared across several Azure clusters. +type LoadBalancerClassSpec struct { + // +optional + SKU SKU `json:"sku,omitempty"` + // +optional + Type LBType `json:"type,omitempty"` + // IdleTimeoutInMinutes specifies the timeout for the TCP idle connection. + // +optional + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` +} + +// FleetsMemberClassSpec defines the FleetsMemberSpec properties that may be shared across several Azure clusters. +type FleetsMemberClassSpec struct { + // Group is the group this member belongs to for multi-cluster update management. + // +kubebuilder:default:=default + // +optional + Group string `json:"group,omitempty"` + + // ManagerName is the name of the fleet manager. + ManagerName string `json:"managerName"` + + // ManagerResourceGroup is the resource group of the fleet manager. + ManagerResourceGroup string `json:"managerResourceGroup"` +} + +// SecurityGroupClass defines the SecurityGroup properties that may be shared across several Azure clusters. +type SecurityGroupClass struct { + // +optional + SecurityRules SecurityRules `json:"securityRules,omitempty"` + // +optional + Tags Tags `json:"tags,omitempty"` +} + +// FrontendIPClass defines the FrontendIP properties that may be shared across several Azure clusters. +type FrontendIPClass struct { + // +optional + PrivateIPAddress string `json:"privateIP,omitempty"` +} + +// setDefaults sets default values for AzureClusterClassSpec. +func (acc *AzureClusterClassSpec) setDefaults() { + if acc.AzureEnvironment == "" { + acc.AzureEnvironment = DefaultAzureCloud + } +} + +// setDefaults sets default values for VnetClassSpec. +func (vc *VnetClassSpec) setDefaults() { + if len(vc.CIDRBlocks) == 0 { + vc.CIDRBlocks = []string{DefaultVnetCIDR} + } +} + +// setDefaults sets default values for SubnetClassSpec. +func (sc *SubnetClassSpec) setDefaults(cidr string) { + if len(sc.CIDRBlocks) == 0 { + sc.CIDRBlocks = []string{cidr} + } +} + +// setDefaults sets default values for SecurityGroupClass. +func (sgc *SecurityGroupClass) setDefaults() { + for i := range sgc.SecurityRules { + if sgc.SecurityRules[i].Direction == "" { + sgc.SecurityRules[i].Direction = SecurityRuleDirectionInbound + } + } +} diff --git a/pkg/capi/azure/api/v1beta1/types_template.go b/pkg/capi/azure/api/v1beta1/types_template.go new file mode 100644 index 000000000000..b8fd8d67da29 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/types_template.go @@ -0,0 +1,147 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "slices" + + "k8s.io/utils/net" +) + +// AzureManagedControlPlaneTemplateResourceSpec specifies an Azure managed control plane template resource. +type AzureManagedControlPlaneTemplateResourceSpec struct { + AzureManagedControlPlaneClassSpec `json:",inline"` +} + +// AzureManagedControlPlaneTemplateMachineTemplate is only used to fulfill the CAPI contract which expects a +// MachineTemplate field for any controlplane ref in a topology. +type AzureManagedControlPlaneTemplateMachineTemplate struct{} + +// AzureManagedMachinePoolTemplateResourceSpec specifies an Azure managed control plane template resource. +type AzureManagedMachinePoolTemplateResourceSpec struct { + AzureManagedMachinePoolClassSpec `json:",inline"` +} + +// AzureManagedClusterTemplateResourceSpec specifies an Azure managed cluster template resource. +type AzureManagedClusterTemplateResourceSpec struct{} + +// AzureClusterTemplateResourceSpec specifies an Azure cluster template resource. +type AzureClusterTemplateResourceSpec struct { + AzureClusterClassSpec `json:",inline"` + + // NetworkSpec encapsulates all things related to Azure network. + // +optional + NetworkSpec NetworkTemplateSpec `json:"networkSpec,omitempty"` + + // BastionSpec encapsulates all things related to the Bastions in the cluster. + // +optional + BastionSpec BastionTemplateSpec `json:"bastionSpec,omitempty"` +} + +// NetworkTemplateSpec specifies a network template. +type NetworkTemplateSpec struct { + NetworkClassSpec `json:",inline"` + + // Vnet is the configuration for the Azure virtual network. + // +optional + Vnet VnetTemplateSpec `json:"vnet,omitempty"` + + // Subnets is the configuration for the control-plane subnet and the node subnet. + // +optional + Subnets SubnetTemplatesSpec `json:"subnets,omitempty"` + + // APIServerLB is the configuration for the control-plane load balancer. + // +optional + APIServerLB LoadBalancerClassSpec `json:"apiServerLB,omitempty"` + + // NodeOutboundLB is the configuration for the node outbound load balancer. + // +optional + NodeOutboundLB *LoadBalancerClassSpec `json:"nodeOutboundLB,omitempty"` + + // ControlPlaneOutboundLB is the configuration for the control-plane outbound load balancer. + // This is different from APIServerLB, and is used only in private clusters (optionally) for enabling outbound traffic. + // +optional + ControlPlaneOutboundLB *LoadBalancerClassSpec `json:"controlPlaneOutboundLB,omitempty"` + + // AdditionalAPIServerLBPorts is the configuration for the additional inbound control-plane load balancer ports + // Each port specified (e.g., 9345) creates an inbound rule where the frontend port and the backend port are the same. + // +optional + AdditionalAPIServerLBPorts []LoadBalancerPort `json:"additionalAPIServerLBPorts,omitempty"` +} + +// GetSubnetTemplate returns the subnet template based on the subnet role. + +// UpdateSubnetTemplate updates the subnet template based on subnet role. +func (n *NetworkTemplateSpec) UpdateSubnetTemplate(subnet SubnetTemplateSpec, role SubnetRole) { + for i, sn := range n.Subnets { + if sn.Role == role { + n.Subnets[i] = subnet + } + } +} + +// VnetTemplateSpec defines the desired state of a virtual network. +type VnetTemplateSpec struct { + VnetClassSpec `json:",inline"` + + // Peerings defines a list of peerings of the newly created virtual network with existing virtual networks. + // +optional + Peerings VnetPeeringsTemplateSpec `json:"peerings,omitempty"` +} + +// VnetPeeringsTemplateSpec defines a list of peerings of the newly created virtual network with existing virtual networks. +type VnetPeeringsTemplateSpec []VnetPeeringClassSpec + +// SubnetTemplateSpec specifies a template for a subnet. +type SubnetTemplateSpec struct { + SubnetClassSpec `json:",inline"` + + // SecurityGroup defines the NSG (network security group) that should be attached to this subnet. + // +optional + SecurityGroup SecurityGroupClass `json:"securityGroup,omitempty"` + + // NatGateway associated with this subnet. + // +optional + NatGateway NatGatewayClassSpec `json:"natGateway,omitempty"` +} + +// IsNatGatewayEnabled returns true if the NAT gateway is enabled. +func (s SubnetTemplateSpec) IsNatGatewayEnabled() bool { + return s.NatGateway.Name != "" +} + +// IsIPv6Enabled returns whether or not IPv6 is enabled on the subnet. +func (s SubnetTemplateSpec) IsIPv6Enabled() bool { + return slices.ContainsFunc(s.CIDRBlocks, net.IsIPv6CIDRString) +} + +// SubnetTemplatesSpec specifies a list of subnet templates. +// +listType=map +// +listMapKey=name +type SubnetTemplatesSpec []SubnetTemplateSpec + +// BastionTemplateSpec specifies a template for a bastion host. +type BastionTemplateSpec struct { + // +optional + AzureBastion *AzureBastionTemplateSpec `json:"azureBastion,omitempty"` +} + +// AzureBastionTemplateSpec specifies a template for an Azure Bastion host. +type AzureBastionTemplateSpec struct { + // +optional + Subnet SubnetTemplateSpec `json:"subnet,omitempty"` +} diff --git a/pkg/capi/azure/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/azure/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..128be24f4170 --- /dev/null +++ b/pkg/capi/azure/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,4954 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AADProfile) DeepCopyInto(out *AADProfile) { + *out = *in + if in.AdminGroupObjectIDs != nil { + in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. +func (in *AADProfile) DeepCopy() *AADProfile { + if in == nil { + return nil + } + out := new(AADProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AKSExtension) DeepCopyInto(out *AKSExtension) { + *out = *in + if in.AutoUpgradeMinorVersion != nil { + in, out := &in.AutoUpgradeMinorVersion, &out.AutoUpgradeMinorVersion + *out = new(bool) + **out = **in + } + if in.ConfigurationSettings != nil { + in, out := &in.ConfigurationSettings, &out.ConfigurationSettings + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ExtensionType != nil { + in, out := &in.ExtensionType, &out.ExtensionType + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(ExtensionPlan) + **out = **in + } + if in.ReleaseTrain != nil { + in, out := &in.ReleaseTrain, &out.ReleaseTrain + *out = new(string) + **out = **in + } + if in.Scope != nil { + in, out := &in.Scope, &out.Scope + *out = new(ExtensionScope) + **out = **in + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AKSExtension. +func (in *AKSExtension) DeepCopy() *AKSExtension { + if in == nil { + return nil + } + out := new(AKSExtension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AKSSku) DeepCopyInto(out *AKSSku) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AKSSku. +func (in *AKSSku) DeepCopy() *AKSSku { + if in == nil { + return nil + } + out := new(AKSSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerAccessProfile) DeepCopyInto(out *APIServerAccessProfile) { + *out = *in + if in.AuthorizedIPRanges != nil { + in, out := &in.AuthorizedIPRanges, &out.AuthorizedIPRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.APIServerAccessProfileClassSpec.DeepCopyInto(&out.APIServerAccessProfileClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfile. +func (in *APIServerAccessProfile) DeepCopy() *APIServerAccessProfile { + if in == nil { + return nil + } + out := new(APIServerAccessProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerAccessProfileClassSpec) DeepCopyInto(out *APIServerAccessProfileClassSpec) { + *out = *in + if in.EnablePrivateCluster != nil { + in, out := &in.EnablePrivateCluster, &out.EnablePrivateCluster + *out = new(bool) + **out = **in + } + if in.PrivateDNSZone != nil { + in, out := &in.PrivateDNSZone, &out.PrivateDNSZone + *out = new(string) + **out = **in + } + if in.EnablePrivateClusterPublicFQDN != nil { + in, out := &in.EnablePrivateClusterPublicFQDN, &out.EnablePrivateClusterPublicFQDN + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfileClassSpec. +func (in *APIServerAccessProfileClassSpec) DeepCopy() *APIServerAccessProfileClassSpec { + if in == nil { + return nil + } + out := new(APIServerAccessProfileClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalCapabilities) DeepCopyInto(out *AdditionalCapabilities) { + *out = *in + if in.UltraSSDEnabled != nil { + in, out := &in.UltraSSDEnabled, &out.UltraSSDEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalCapabilities. +func (in *AdditionalCapabilities) DeepCopy() *AdditionalCapabilities { + if in == nil { + return nil + } + out := new(AdditionalCapabilities) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddonProfile) DeepCopyInto(out *AddonProfile) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonProfile. +func (in *AddonProfile) DeepCopy() *AddonProfile { + if in == nil { + return nil + } + out := new(AddonProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddressRecord) DeepCopyInto(out *AddressRecord) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressRecord. +func (in *AddressRecord) DeepCopy() *AddressRecord { + if in == nil { + return nil + } + out := new(AddressRecord) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { + *out = *in + if in.NamespaceList != nil { + in, out := &in.NamespaceList, &out.NamespaceList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedNamespaces. +func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces { + if in == nil { + return nil + } + out := new(AllowedNamespaces) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalerProfile) DeepCopyInto(out *AutoScalerProfile) { + *out = *in + if in.BalanceSimilarNodeGroups != nil { + in, out := &in.BalanceSimilarNodeGroups, &out.BalanceSimilarNodeGroups + *out = new(BalanceSimilarNodeGroups) + **out = **in + } + if in.Expander != nil { + in, out := &in.Expander, &out.Expander + *out = new(Expander) + **out = **in + } + if in.MaxEmptyBulkDelete != nil { + in, out := &in.MaxEmptyBulkDelete, &out.MaxEmptyBulkDelete + *out = new(string) + **out = **in + } + if in.MaxGracefulTerminationSec != nil { + in, out := &in.MaxGracefulTerminationSec, &out.MaxGracefulTerminationSec + *out = new(string) + **out = **in + } + if in.MaxNodeProvisionTime != nil { + in, out := &in.MaxNodeProvisionTime, &out.MaxNodeProvisionTime + *out = new(string) + **out = **in + } + if in.MaxTotalUnreadyPercentage != nil { + in, out := &in.MaxTotalUnreadyPercentage, &out.MaxTotalUnreadyPercentage + *out = new(string) + **out = **in + } + if in.NewPodScaleUpDelay != nil { + in, out := &in.NewPodScaleUpDelay, &out.NewPodScaleUpDelay + *out = new(string) + **out = **in + } + if in.OkTotalUnreadyCount != nil { + in, out := &in.OkTotalUnreadyCount, &out.OkTotalUnreadyCount + *out = new(string) + **out = **in + } + if in.ScanInterval != nil { + in, out := &in.ScanInterval, &out.ScanInterval + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterAdd != nil { + in, out := &in.ScaleDownDelayAfterAdd, &out.ScaleDownDelayAfterAdd + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterDelete != nil { + in, out := &in.ScaleDownDelayAfterDelete, &out.ScaleDownDelayAfterDelete + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterFailure != nil { + in, out := &in.ScaleDownDelayAfterFailure, &out.ScaleDownDelayAfterFailure + *out = new(string) + **out = **in + } + if in.ScaleDownUnneededTime != nil { + in, out := &in.ScaleDownUnneededTime, &out.ScaleDownUnneededTime + *out = new(string) + **out = **in + } + if in.ScaleDownUnreadyTime != nil { + in, out := &in.ScaleDownUnreadyTime, &out.ScaleDownUnreadyTime + *out = new(string) + **out = **in + } + if in.ScaleDownUtilizationThreshold != nil { + in, out := &in.ScaleDownUtilizationThreshold, &out.ScaleDownUtilizationThreshold + *out = new(string) + **out = **in + } + if in.SkipNodesWithLocalStorage != nil { + in, out := &in.SkipNodesWithLocalStorage, &out.SkipNodesWithLocalStorage + *out = new(SkipNodesWithLocalStorage) + **out = **in + } + if in.SkipNodesWithSystemPods != nil { + in, out := &in.SkipNodesWithSystemPods, &out.SkipNodesWithSystemPods + *out = new(SkipNodesWithSystemPods) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalerProfile. +func (in *AutoScalerProfile) DeepCopy() *AutoScalerProfile { + if in == nil { + return nil + } + out := new(AutoScalerProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedCluster) DeepCopyInto(out *AzureASOManagedCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedCluster. +func (in *AzureASOManagedCluster) DeepCopy() *AzureASOManagedCluster { + if in == nil { + return nil + } + out := new(AzureASOManagedCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterList) DeepCopyInto(out *AzureASOManagedClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterList. +func (in *AzureASOManagedClusterList) DeepCopy() *AzureASOManagedClusterList { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterSpec) DeepCopyInto(out *AzureASOManagedClusterSpec) { + *out = *in + in.AzureASOManagedClusterTemplateResourceSpec.DeepCopyInto(&out.AzureASOManagedClusterTemplateResourceSpec) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterSpec. +func (in *AzureASOManagedClusterSpec) DeepCopy() *AzureASOManagedClusterSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterStatus) DeepCopyInto(out *AzureASOManagedClusterStatus) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterStatus. +func (in *AzureASOManagedClusterStatus) DeepCopy() *AzureASOManagedClusterStatus { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterTemplate) DeepCopyInto(out *AzureASOManagedClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterTemplate. +func (in *AzureASOManagedClusterTemplate) DeepCopy() *AzureASOManagedClusterTemplate { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterTemplateList) DeepCopyInto(out *AzureASOManagedClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterTemplateList. +func (in *AzureASOManagedClusterTemplateList) DeepCopy() *AzureASOManagedClusterTemplateList { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterTemplateResource) DeepCopyInto(out *AzureASOManagedClusterTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterTemplateResource. +func (in *AzureASOManagedClusterTemplateResource) DeepCopy() *AzureASOManagedClusterTemplateResource { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterTemplateResourceSpec) DeepCopyInto(out *AzureASOManagedClusterTemplateResourceSpec) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterTemplateResourceSpec. +func (in *AzureASOManagedClusterTemplateResourceSpec) DeepCopy() *AzureASOManagedClusterTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedClusterTemplateSpec) DeepCopyInto(out *AzureASOManagedClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedClusterTemplateSpec. +func (in *AzureASOManagedClusterTemplateSpec) DeepCopy() *AzureASOManagedClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlane) DeepCopyInto(out *AzureASOManagedControlPlane) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlane. +func (in *AzureASOManagedControlPlane) DeepCopy() *AzureASOManagedControlPlane { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedControlPlane) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneList) DeepCopyInto(out *AzureASOManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneList. +func (in *AzureASOManagedControlPlaneList) DeepCopy() *AzureASOManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedControlPlaneList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneResource) DeepCopyInto(out *AzureASOManagedControlPlaneResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneResource. +func (in *AzureASOManagedControlPlaneResource) DeepCopy() *AzureASOManagedControlPlaneResource { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneSpec) DeepCopyInto(out *AzureASOManagedControlPlaneSpec) { + *out = *in + in.AzureASOManagedControlPlaneTemplateResourceSpec.DeepCopyInto(&out.AzureASOManagedControlPlaneTemplateResourceSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneSpec. +func (in *AzureASOManagedControlPlaneSpec) DeepCopy() *AzureASOManagedControlPlaneSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneStatus) DeepCopyInto(out *AzureASOManagedControlPlaneStatus) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceStatus, len(*in)) + copy(*out, *in) + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneStatus. +func (in *AzureASOManagedControlPlaneStatus) DeepCopy() *AzureASOManagedControlPlaneStatus { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneTemplate) DeepCopyInto(out *AzureASOManagedControlPlaneTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneTemplate. +func (in *AzureASOManagedControlPlaneTemplate) DeepCopy() *AzureASOManagedControlPlaneTemplate { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedControlPlaneTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneTemplateList) DeepCopyInto(out *AzureASOManagedControlPlaneTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedControlPlaneTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneTemplateList. +func (in *AzureASOManagedControlPlaneTemplateList) DeepCopy() *AzureASOManagedControlPlaneTemplateList { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedControlPlaneTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneTemplateResourceSpec) DeepCopyInto(out *AzureASOManagedControlPlaneTemplateResourceSpec) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneTemplateResourceSpec. +func (in *AzureASOManagedControlPlaneTemplateResourceSpec) DeepCopy() *AzureASOManagedControlPlaneTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedControlPlaneTemplateSpec) DeepCopyInto(out *AzureASOManagedControlPlaneTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedControlPlaneTemplateSpec. +func (in *AzureASOManagedControlPlaneTemplateSpec) DeepCopy() *AzureASOManagedControlPlaneTemplateSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedControlPlaneTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePool) DeepCopyInto(out *AzureASOManagedMachinePool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePool. +func (in *AzureASOManagedMachinePool) DeepCopy() *AzureASOManagedMachinePool { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedMachinePool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolList) DeepCopyInto(out *AzureASOManagedMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolList. +func (in *AzureASOManagedMachinePoolList) DeepCopy() *AzureASOManagedMachinePoolList { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedMachinePoolList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolResource) DeepCopyInto(out *AzureASOManagedMachinePoolResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolResource. +func (in *AzureASOManagedMachinePoolResource) DeepCopy() *AzureASOManagedMachinePoolResource { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolSpec) DeepCopyInto(out *AzureASOManagedMachinePoolSpec) { + *out = *in + in.AzureASOManagedMachinePoolTemplateResourceSpec.DeepCopyInto(&out.AzureASOManagedMachinePoolTemplateResourceSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolSpec. +func (in *AzureASOManagedMachinePoolSpec) DeepCopy() *AzureASOManagedMachinePoolSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolStatus) DeepCopyInto(out *AzureASOManagedMachinePoolStatus) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolStatus. +func (in *AzureASOManagedMachinePoolStatus) DeepCopy() *AzureASOManagedMachinePoolStatus { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolTemplate) DeepCopyInto(out *AzureASOManagedMachinePoolTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolTemplate. +func (in *AzureASOManagedMachinePoolTemplate) DeepCopy() *AzureASOManagedMachinePoolTemplate { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedMachinePoolTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolTemplateList) DeepCopyInto(out *AzureASOManagedMachinePoolTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureASOManagedMachinePoolTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolTemplateList. +func (in *AzureASOManagedMachinePoolTemplateList) DeepCopy() *AzureASOManagedMachinePoolTemplateList { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureASOManagedMachinePoolTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolTemplateResourceSpec) DeepCopyInto(out *AzureASOManagedMachinePoolTemplateResourceSpec) { + *out = *in + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]runtime.RawExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolTemplateResourceSpec. +func (in *AzureASOManagedMachinePoolTemplateResourceSpec) DeepCopy() *AzureASOManagedMachinePoolTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureASOManagedMachinePoolTemplateSpec) DeepCopyInto(out *AzureASOManagedMachinePoolTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureASOManagedMachinePoolTemplateSpec. +func (in *AzureASOManagedMachinePoolTemplateSpec) DeepCopy() *AzureASOManagedMachinePoolTemplateSpec { + if in == nil { + return nil + } + out := new(AzureASOManagedMachinePoolTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureBastion) DeepCopyInto(out *AzureBastion) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) + in.PublicIP.DeepCopyInto(&out.PublicIP) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureBastion. +func (in *AzureBastion) DeepCopy() *AzureBastion { + if in == nil { + return nil + } + out := new(AzureBastion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureBastionTemplateSpec) DeepCopyInto(out *AzureBastionTemplateSpec) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureBastionTemplateSpec. +func (in *AzureBastionTemplateSpec) DeepCopy() *AzureBastionTemplateSpec { + if in == nil { + return nil + } + out := new(AzureBastionTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureCluster) DeepCopyInto(out *AzureCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureCluster. +func (in *AzureCluster) DeepCopy() *AzureCluster { + if in == nil { + return nil + } + out := new(AzureCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterClassSpec) DeepCopyInto(out *AzureClusterClassSpec) { + *out = *in + if in.ExtendedLocation != nil { + in, out := &in.ExtendedLocation, &out.ExtendedLocation + *out = new(ExtendedLocationSpec) + **out = **in + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.CloudProviderConfigOverrides != nil { + in, out := &in.CloudProviderConfigOverrides, &out.CloudProviderConfigOverrides + *out = new(CloudProviderConfigOverrides) + (*in).DeepCopyInto(*out) + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(corev1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterClassSpec. +func (in *AzureClusterClassSpec) DeepCopy() *AzureClusterClassSpec { + if in == nil { + return nil + } + out := new(AzureClusterClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterIdentity) DeepCopyInto(out *AzureClusterIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterIdentity. +func (in *AzureClusterIdentity) DeepCopy() *AzureClusterIdentity { + if in == nil { + return nil + } + out := new(AzureClusterIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureClusterIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterIdentityList) DeepCopyInto(out *AzureClusterIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureClusterIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterIdentityList. +func (in *AzureClusterIdentityList) DeepCopy() *AzureClusterIdentityList { + if in == nil { + return nil + } + out := new(AzureClusterIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureClusterIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterIdentitySpec) DeepCopyInto(out *AzureClusterIdentitySpec) { + *out = *in + out.ClientSecret = in.ClientSecret + if in.AllowedNamespaces != nil { + in, out := &in.AllowedNamespaces, &out.AllowedNamespaces + *out = new(AllowedNamespaces) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterIdentitySpec. +func (in *AzureClusterIdentitySpec) DeepCopy() *AzureClusterIdentitySpec { + if in == nil { + return nil + } + out := new(AzureClusterIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterIdentityStatus) DeepCopyInto(out *AzureClusterIdentityStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterIdentityStatus. +func (in *AzureClusterIdentityStatus) DeepCopy() *AzureClusterIdentityStatus { + if in == nil { + return nil + } + out := new(AzureClusterIdentityStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterList) DeepCopyInto(out *AzureClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterList. +func (in *AzureClusterList) DeepCopy() *AzureClusterList { + if in == nil { + return nil + } + out := new(AzureClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterSpec) DeepCopyInto(out *AzureClusterSpec) { + *out = *in + in.AzureClusterClassSpec.DeepCopyInto(&out.AzureClusterClassSpec) + in.NetworkSpec.DeepCopyInto(&out.NetworkSpec) + in.BastionSpec.DeepCopyInto(&out.BastionSpec) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterSpec. +func (in *AzureClusterSpec) DeepCopy() *AzureClusterSpec { + if in == nil { + return nil + } + out := new(AzureClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterStatus) DeepCopyInto(out *AzureClusterStatus) { + *out = *in + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(corev1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterStatus. +func (in *AzureClusterStatus) DeepCopy() *AzureClusterStatus { + if in == nil { + return nil + } + out := new(AzureClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterTemplate) DeepCopyInto(out *AzureClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterTemplate. +func (in *AzureClusterTemplate) DeepCopy() *AzureClusterTemplate { + if in == nil { + return nil + } + out := new(AzureClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterTemplateList) DeepCopyInto(out *AzureClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterTemplateList. +func (in *AzureClusterTemplateList) DeepCopy() *AzureClusterTemplateList { + if in == nil { + return nil + } + out := new(AzureClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterTemplateResource) DeepCopyInto(out *AzureClusterTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterTemplateResource. +func (in *AzureClusterTemplateResource) DeepCopy() *AzureClusterTemplateResource { + if in == nil { + return nil + } + out := new(AzureClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterTemplateResourceSpec) DeepCopyInto(out *AzureClusterTemplateResourceSpec) { + *out = *in + in.AzureClusterClassSpec.DeepCopyInto(&out.AzureClusterClassSpec) + in.NetworkSpec.DeepCopyInto(&out.NetworkSpec) + in.BastionSpec.DeepCopyInto(&out.BastionSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterTemplateResourceSpec. +func (in *AzureClusterTemplateResourceSpec) DeepCopy() *AzureClusterTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureClusterTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureClusterTemplateSpec) DeepCopyInto(out *AzureClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterTemplateSpec. +func (in *AzureClusterTemplateSpec) DeepCopy() *AzureClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AzureClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureComputeGalleryImage) DeepCopyInto(out *AzureComputeGalleryImage) { + *out = *in + if in.SubscriptionID != nil { + in, out := &in.SubscriptionID, &out.SubscriptionID + *out = new(string) + **out = **in + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(ImagePlan) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureComputeGalleryImage. +func (in *AzureComputeGalleryImage) DeepCopy() *AzureComputeGalleryImage { + if in == nil { + return nil + } + out := new(AzureComputeGalleryImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureKeyVaultKms) DeepCopyInto(out *AzureKeyVaultKms) { + *out = *in + if in.KeyVaultNetworkAccess != nil { + in, out := &in.KeyVaultNetworkAccess, &out.KeyVaultNetworkAccess + *out = new(KeyVaultNetworkAccessTypes) + **out = **in + } + if in.KeyVaultResourceID != nil { + in, out := &in.KeyVaultResourceID, &out.KeyVaultResourceID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureKeyVaultKms. +func (in *AzureKeyVaultKms) DeepCopy() *AzureKeyVaultKms { + if in == nil { + return nil + } + out := new(AzureKeyVaultKms) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachine) DeepCopyInto(out *AzureMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachine. +func (in *AzureMachine) DeepCopy() *AzureMachine { + if in == nil { + return nil + } + out := new(AzureMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineList) DeepCopyInto(out *AzureMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineList. +func (in *AzureMachineList) DeepCopy() *AzureMachineList { + if in == nil { + return nil + } + out := new(AzureMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineSpec) DeepCopyInto(out *AzureMachineSpec) { + *out = *in + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.FailureDomain != nil { + in, out := &in.FailureDomain, &out.FailureDomain + *out = new(string) + **out = **in + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(Image) + (*in).DeepCopyInto(*out) + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentity, len(*in)) + copy(*out, *in) + } + if in.SystemAssignedIdentityRole != nil { + in, out := &in.SystemAssignedIdentityRole, &out.SystemAssignedIdentityRole + *out = new(SystemAssignedIdentityRole) + **out = **in + } + in.OSDisk.DeepCopyInto(&out.OSDisk) + if in.DataDisks != nil { + in, out := &in.DataDisks, &out.DataDisks + *out = make([]DataDisk, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AdditionalCapabilities != nil { + in, out := &in.AdditionalCapabilities, &out.AdditionalCapabilities + *out = new(AdditionalCapabilities) + (*in).DeepCopyInto(*out) + } + if in.AcceleratedNetworking != nil { + in, out := &in.AcceleratedNetworking, &out.AcceleratedNetworking + *out = new(bool) + **out = **in + } + if in.Diagnostics != nil { + in, out := &in.Diagnostics, &out.Diagnostics + *out = new(Diagnostics) + (*in).DeepCopyInto(*out) + } + if in.SpotVMOptions != nil { + in, out := &in.SpotVMOptions, &out.SpotVMOptions + *out = new(SpotVMOptions) + (*in).DeepCopyInto(*out) + } + if in.SecurityProfile != nil { + in, out := &in.SecurityProfile, &out.SecurityProfile + *out = new(SecurityProfile) + (*in).DeepCopyInto(*out) + } + if in.DNSServers != nil { + in, out := &in.DNSServers, &out.DNSServers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DisableExtensionOperations != nil { + in, out := &in.DisableExtensionOperations, &out.DisableExtensionOperations + *out = new(bool) + **out = **in + } + if in.DisableVMBootstrapExtension != nil { + in, out := &in.DisableVMBootstrapExtension, &out.DisableVMBootstrapExtension + *out = new(bool) + **out = **in + } + if in.VMExtensions != nil { + in, out := &in.VMExtensions, &out.VMExtensions + *out = make([]VMExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]NetworkInterface, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CapacityReservationGroupID != nil { + in, out := &in.CapacityReservationGroupID, &out.CapacityReservationGroupID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineSpec. +func (in *AzureMachineSpec) DeepCopy() *AzureMachineSpec { + if in == nil { + return nil + } + out := new(AzureMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineStatus) DeepCopyInto(out *AzureMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]corev1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.VMState != nil { + in, out := &in.VMState, &out.VMState + *out = new(ProvisioningState) + **out = **in + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineStatus. +func (in *AzureMachineStatus) DeepCopy() *AzureMachineStatus { + if in == nil { + return nil + } + out := new(AzureMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplate) DeepCopyInto(out *AzureMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplate. +func (in *AzureMachineTemplate) DeepCopy() *AzureMachineTemplate { + if in == nil { + return nil + } + out := new(AzureMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplateList) DeepCopyInto(out *AzureMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateList. +func (in *AzureMachineTemplateList) DeepCopy() *AzureMachineTemplateList { + if in == nil { + return nil + } + out := new(AzureMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplateResource) DeepCopyInto(out *AzureMachineTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateResource. +func (in *AzureMachineTemplateResource) DeepCopy() *AzureMachineTemplateResource { + if in == nil { + return nil + } + out := new(AzureMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplateSpec) DeepCopyInto(out *AzureMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateSpec. +func (in *AzureMachineTemplateSpec) DeepCopy() *AzureMachineTemplateSpec { + if in == nil { + return nil + } + out := new(AzureMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplateStatus) DeepCopyInto(out *AzureMachineTemplateStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.NodeInfo != nil { + in, out := &in.NodeInfo, &out.NodeInfo + *out = new(NodeInfo) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateStatus. +func (in *AzureMachineTemplateStatus) DeepCopy() *AzureMachineTemplateStatus { + if in == nil { + return nil + } + out := new(AzureMachineTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. +func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { + if in == nil { + return nil + } + out := new(AzureManagedCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. +func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { + if in == nil { + return nil + } + out := new(AzureManagedClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. +func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. +func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { + if in == nil { + return nil + } + out := new(AzureManagedClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterTemplate) DeepCopyInto(out *AzureManagedClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterTemplate. +func (in *AzureManagedClusterTemplate) DeepCopy() *AzureManagedClusterTemplate { + if in == nil { + return nil + } + out := new(AzureManagedClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterTemplateList) DeepCopyInto(out *AzureManagedClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterTemplateList. +func (in *AzureManagedClusterTemplateList) DeepCopy() *AzureManagedClusterTemplateList { + if in == nil { + return nil + } + out := new(AzureManagedClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterTemplateResource) DeepCopyInto(out *AzureManagedClusterTemplateResource) { + *out = *in + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterTemplateResource. +func (in *AzureManagedClusterTemplateResource) DeepCopy() *AzureManagedClusterTemplateResource { + if in == nil { + return nil + } + out := new(AzureManagedClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterTemplateResourceSpec) DeepCopyInto(out *AzureManagedClusterTemplateResourceSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterTemplateResourceSpec. +func (in *AzureManagedClusterTemplateResourceSpec) DeepCopy() *AzureManagedClusterTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterTemplateSpec) DeepCopyInto(out *AzureManagedClusterTemplateSpec) { + *out = *in + out.Template = in.Template +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterTemplateSpec. +func (in *AzureManagedClusterTemplateSpec) DeepCopy() *AzureManagedClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlane. +func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { + if in == nil { + return nil + } + out := new(AzureManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlane) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneClassSpec) DeepCopyInto(out *AzureManagedControlPlaneClassSpec) { + *out = *in + if in.MachineTemplate != nil { + in, out := &in.MachineTemplate, &out.MachineTemplate + *out = new(AzureManagedControlPlaneTemplateMachineTemplate) + **out = **in + } + in.VirtualNetwork.DeepCopyInto(&out.VirtualNetwork) + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NetworkPlugin != nil { + in, out := &in.NetworkPlugin, &out.NetworkPlugin + *out = new(string) + **out = **in + } + if in.NetworkPluginMode != nil { + in, out := &in.NetworkPluginMode, &out.NetworkPluginMode + *out = new(NetworkPluginMode) + **out = **in + } + if in.NetworkPolicy != nil { + in, out := &in.NetworkPolicy, &out.NetworkPolicy + *out = new(string) + **out = **in + } + if in.NetworkDataplane != nil { + in, out := &in.NetworkDataplane, &out.NetworkDataplane + *out = new(NetworkDataplaneType) + **out = **in + } + if in.OutboundType != nil { + in, out := &in.OutboundType, &out.OutboundType + *out = new(ManagedControlPlaneOutboundType) + **out = **in + } + if in.DNSServiceIP != nil { + in, out := &in.DNSServiceIP, &out.DNSServiceIP + *out = new(string) + **out = **in + } + if in.LoadBalancerSKU != nil { + in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU + *out = new(string) + **out = **in + } + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.AADProfile != nil { + in, out := &in.AADProfile, &out.AADProfile + *out = new(AADProfile) + (*in).DeepCopyInto(*out) + } + if in.AddonProfiles != nil { + in, out := &in.AddonProfiles, &out.AddonProfiles + *out = make([]AddonProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SKU != nil { + in, out := &in.SKU, &out.SKU + *out = new(AKSSku) + **out = **in + } + if in.LoadBalancerProfile != nil { + in, out := &in.LoadBalancerProfile, &out.LoadBalancerProfile + *out = new(LoadBalancerProfile) + (*in).DeepCopyInto(*out) + } + if in.APIServerAccessProfile != nil { + in, out := &in.APIServerAccessProfile, &out.APIServerAccessProfile + *out = new(APIServerAccessProfile) + (*in).DeepCopyInto(*out) + } + if in.AutoScalerProfile != nil { + in, out := &in.AutoScalerProfile, &out.AutoScalerProfile + *out = new(AutoScalerProfile) + (*in).DeepCopyInto(*out) + } + if in.Identity != nil { + in, out := &in.Identity, &out.Identity + *out = new(Identity) + **out = **in + } + if in.HTTPProxyConfig != nil { + in, out := &in.HTTPProxyConfig, &out.HTTPProxyConfig + *out = new(HTTPProxyConfig) + (*in).DeepCopyInto(*out) + } + if in.OIDCIssuerProfile != nil { + in, out := &in.OIDCIssuerProfile, &out.OIDCIssuerProfile + *out = new(OIDCIssuerProfile) + (*in).DeepCopyInto(*out) + } + if in.DisableLocalAccounts != nil { + in, out := &in.DisableLocalAccounts, &out.DisableLocalAccounts + *out = new(bool) + **out = **in + } + if in.FleetsMember != nil { + in, out := &in.FleetsMember, &out.FleetsMember + *out = new(FleetsMemberClassSpec) + **out = **in + } + if in.Extensions != nil { + in, out := &in.Extensions, &out.Extensions + *out = make([]AKSExtension, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AutoUpgradeProfile != nil { + in, out := &in.AutoUpgradeProfile, &out.AutoUpgradeProfile + *out = new(ManagedClusterAutoUpgradeProfile) + (*in).DeepCopyInto(*out) + } + if in.SecurityProfile != nil { + in, out := &in.SecurityProfile, &out.SecurityProfile + *out = new(ManagedClusterSecurityProfile) + (*in).DeepCopyInto(*out) + } + if in.ASOManagedClusterPatches != nil { + in, out := &in.ASOManagedClusterPatches, &out.ASOManagedClusterPatches + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.EnablePreviewFeatures != nil { + in, out := &in.EnablePreviewFeatures, &out.EnablePreviewFeatures + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneClassSpec. +func (in *AzureManagedControlPlaneClassSpec) DeepCopy() *AzureManagedControlPlaneClassSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. +func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { + *out = *in + in.AzureManagedControlPlaneClassSpec.DeepCopyInto(&out.AzureManagedControlPlaneClassSpec) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.SSHPublicKey != nil { + in, out := &in.SSHPublicKey, &out.SSHPublicKey + *out = new(string) + **out = **in + } + if in.DNSPrefix != nil { + in, out := &in.DNSPrefix, &out.DNSPrefix + *out = new(string) + **out = **in + } + if in.FleetsMember != nil { + in, out := &in.FleetsMember, &out.FleetsMember + *out = new(FleetsMember) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. +func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } + if in.OIDCIssuerProfile != nil { + in, out := &in.OIDCIssuerProfile, &out.OIDCIssuerProfile + *out = new(OIDCIssuerProfileStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. +func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplate) DeepCopyInto(out *AzureManagedControlPlaneTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplate. +func (in *AzureManagedControlPlaneTemplate) DeepCopy() *AzureManagedControlPlaneTemplate { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplateList) DeepCopyInto(out *AzureManagedControlPlaneTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlaneTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplateList. +func (in *AzureManagedControlPlaneTemplateList) DeepCopy() *AzureManagedControlPlaneTemplateList { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplateMachineTemplate) DeepCopyInto(out *AzureManagedControlPlaneTemplateMachineTemplate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplateMachineTemplate. +func (in *AzureManagedControlPlaneTemplateMachineTemplate) DeepCopy() *AzureManagedControlPlaneTemplateMachineTemplate { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplateMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplateResource) DeepCopyInto(out *AzureManagedControlPlaneTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplateResource. +func (in *AzureManagedControlPlaneTemplateResource) DeepCopy() *AzureManagedControlPlaneTemplateResource { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplateResourceSpec) DeepCopyInto(out *AzureManagedControlPlaneTemplateResourceSpec) { + *out = *in + in.AzureManagedControlPlaneClassSpec.DeepCopyInto(&out.AzureManagedControlPlaneClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplateResourceSpec. +func (in *AzureManagedControlPlaneTemplateResourceSpec) DeepCopy() *AzureManagedControlPlaneTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneTemplateSpec) DeepCopyInto(out *AzureManagedControlPlaneTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneTemplateSpec. +func (in *AzureManagedControlPlaneTemplateSpec) DeepCopy() *AzureManagedControlPlaneTemplateSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePool. +func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { + if in == nil { + return nil + } + out := new(AzureManagedMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolClassSpec) DeepCopyInto(out *AzureManagedMachinePoolClassSpec) { + *out = *in + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OSDiskSizeGB != nil { + in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB + *out = new(int) + **out = **in + } + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.NodeLabels != nil { + in, out := &in.NodeLabels, &out.NodeLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make(Taints, len(*in)) + copy(*out, *in) + } + if in.Scaling != nil { + in, out := &in.Scaling, &out.Scaling + *out = new(ManagedMachinePoolScaling) + (*in).DeepCopyInto(*out) + } + if in.MaxPods != nil { + in, out := &in.MaxPods, &out.MaxPods + *out = new(int) + **out = **in + } + if in.OsDiskType != nil { + in, out := &in.OsDiskType, &out.OsDiskType + *out = new(string) + **out = **in + } + if in.EnableUltraSSD != nil { + in, out := &in.EnableUltraSSD, &out.EnableUltraSSD + *out = new(bool) + **out = **in + } + if in.OSType != nil { + in, out := &in.OSType, &out.OSType + *out = new(string) + **out = **in + } + if in.EnableNodePublicIP != nil { + in, out := &in.EnableNodePublicIP, &out.EnableNodePublicIP + *out = new(bool) + **out = **in + } + if in.NodePublicIPPrefixID != nil { + in, out := &in.NodePublicIPPrefixID, &out.NodePublicIPPrefixID + *out = new(string) + **out = **in + } + if in.ScaleSetPriority != nil { + in, out := &in.ScaleSetPriority, &out.ScaleSetPriority + *out = new(string) + **out = **in + } + if in.ScaleDownMode != nil { + in, out := &in.ScaleDownMode, &out.ScaleDownMode + *out = new(string) + **out = **in + } + if in.SpotMaxPrice != nil { + in, out := &in.SpotMaxPrice, &out.SpotMaxPrice + x := (*in).DeepCopy() + *out = &x + } + if in.KubeletConfig != nil { + in, out := &in.KubeletConfig, &out.KubeletConfig + *out = new(KubeletConfig) + (*in).DeepCopyInto(*out) + } + if in.KubeletDiskType != nil { + in, out := &in.KubeletDiskType, &out.KubeletDiskType + *out = new(KubeletDiskType) + **out = **in + } + if in.LinuxOSConfig != nil { + in, out := &in.LinuxOSConfig, &out.LinuxOSConfig + *out = new(LinuxOSConfig) + (*in).DeepCopyInto(*out) + } + if in.SubnetName != nil { + in, out := &in.SubnetName, &out.SubnetName + *out = new(string) + **out = **in + } + if in.EnableFIPS != nil { + in, out := &in.EnableFIPS, &out.EnableFIPS + *out = new(bool) + **out = **in + } + if in.EnableEncryptionAtHost != nil { + in, out := &in.EnableEncryptionAtHost, &out.EnableEncryptionAtHost + *out = new(bool) + **out = **in + } + if in.ASOManagedClustersAgentPoolPatches != nil { + in, out := &in.ASOManagedClustersAgentPoolPatches, &out.ASOManagedClustersAgentPoolPatches + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolClassSpec. +func (in *AzureManagedMachinePoolClassSpec) DeepCopy() *AzureManagedMachinePoolClassSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. +func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePoolList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { + *out = *in + in.AzureManagedMachinePoolClassSpec.DeepCopyInto(&out.AzureManagedMachinePoolClassSpec) + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. +func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { + *out = *in + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(string) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. +func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolTemplate) DeepCopyInto(out *AzureManagedMachinePoolTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolTemplate. +func (in *AzureManagedMachinePoolTemplate) DeepCopy() *AzureManagedMachinePoolTemplate { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePoolTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolTemplateList) DeepCopyInto(out *AzureManagedMachinePoolTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePoolTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolTemplateList. +func (in *AzureManagedMachinePoolTemplateList) DeepCopy() *AzureManagedMachinePoolTemplateList { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePoolTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolTemplateResource) DeepCopyInto(out *AzureManagedMachinePoolTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolTemplateResource. +func (in *AzureManagedMachinePoolTemplateResource) DeepCopy() *AzureManagedMachinePoolTemplateResource { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolTemplateResourceSpec) DeepCopyInto(out *AzureManagedMachinePoolTemplateResourceSpec) { + *out = *in + in.AzureManagedMachinePoolClassSpec.DeepCopyInto(&out.AzureManagedMachinePoolClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolTemplateResourceSpec. +func (in *AzureManagedMachinePoolTemplateResourceSpec) DeepCopy() *AzureManagedMachinePoolTemplateResourceSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolTemplateResourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolTemplateSpec) DeepCopyInto(out *AzureManagedMachinePoolTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolTemplateSpec. +func (in *AzureManagedMachinePoolTemplateSpec) DeepCopy() *AzureManagedMachinePoolTemplateSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMarketplaceImage) DeepCopyInto(out *AzureMarketplaceImage) { + *out = *in + out.ImagePlan = in.ImagePlan +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMarketplaceImage. +func (in *AzureMarketplaceImage) DeepCopy() *AzureMarketplaceImage { + if in == nil { + return nil + } + out := new(AzureMarketplaceImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureSharedGalleryImage) DeepCopyInto(out *AzureSharedGalleryImage) { + *out = *in + if in.Publisher != nil { + in, out := &in.Publisher, &out.Publisher + *out = new(string) + **out = **in + } + if in.Offer != nil { + in, out := &in.Offer, &out.Offer + *out = new(string) + **out = **in + } + if in.SKU != nil { + in, out := &in.SKU, &out.SKU + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSharedGalleryImage. +func (in *AzureSharedGalleryImage) DeepCopy() *AzureSharedGalleryImage { + if in == nil { + return nil + } + out := new(AzureSharedGalleryImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackOffConfig) DeepCopyInto(out *BackOffConfig) { + *out = *in + if in.CloudProviderBackoffExponent != nil { + in, out := &in.CloudProviderBackoffExponent, &out.CloudProviderBackoffExponent + x := (*in).DeepCopy() + *out = &x + } + if in.CloudProviderBackoffJitter != nil { + in, out := &in.CloudProviderBackoffJitter, &out.CloudProviderBackoffJitter + x := (*in).DeepCopy() + *out = &x + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackOffConfig. +func (in *BackOffConfig) DeepCopy() *BackOffConfig { + if in == nil { + return nil + } + out := new(BackOffConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendPool) DeepCopyInto(out *BackendPool) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendPool. +func (in *BackendPool) DeepCopy() *BackendPool { + if in == nil { + return nil + } + out := new(BackendPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BastionSpec) DeepCopyInto(out *BastionSpec) { + *out = *in + if in.AzureBastion != nil { + in, out := &in.AzureBastion, &out.AzureBastion + *out = new(AzureBastion) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BastionSpec. +func (in *BastionSpec) DeepCopy() *BastionSpec { + if in == nil { + return nil + } + out := new(BastionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BastionTemplateSpec) DeepCopyInto(out *BastionTemplateSpec) { + *out = *in + if in.AzureBastion != nil { + in, out := &in.AzureBastion, &out.AzureBastion + *out = new(AzureBastionTemplateSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BastionTemplateSpec. +func (in *BastionTemplateSpec) DeepCopy() *BastionTemplateSpec { + if in == nil { + return nil + } + out := new(BastionTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BootDiagnostics) DeepCopyInto(out *BootDiagnostics) { + *out = *in + if in.UserManaged != nil { + in, out := &in.UserManaged, &out.UserManaged + *out = new(UserManagedBootDiagnostics) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootDiagnostics. +func (in *BootDiagnostics) DeepCopy() *BootDiagnostics { + if in == nil { + return nil + } + out := new(BootDiagnostics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildParams) DeepCopyInto(out *BuildParams) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Role != nil { + in, out := &in.Role, &out.Role + *out = new(string) + **out = **in + } + if in.Additional != nil { + in, out := &in.Additional, &out.Additional + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildParams. +func (in *BuildParams) DeepCopy() *BuildParams { + if in == nil { + return nil + } + out := new(BuildParams) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudProviderConfigOverrides) DeepCopyInto(out *CloudProviderConfigOverrides) { + *out = *in + if in.RateLimits != nil { + in, out := &in.RateLimits, &out.RateLimits + *out = make([]RateLimitSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.BackOffs.DeepCopyInto(&out.BackOffs) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfigOverrides. +func (in *CloudProviderConfigOverrides) DeepCopy() *CloudProviderConfigOverrides { + if in == nil { + return nil + } + out := new(CloudProviderConfigOverrides) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DataDisk) DeepCopyInto(out *DataDisk) { + *out = *in + if in.ManagedDisk != nil { + in, out := &in.ManagedDisk, &out.ManagedDisk + *out = new(ManagedDiskParameters) + (*in).DeepCopyInto(*out) + } + if in.Lun != nil { + in, out := &in.Lun, &out.Lun + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataDisk. +func (in *DataDisk) DeepCopy() *DataDisk { + if in == nil { + return nil + } + out := new(DataDisk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Diagnostics) DeepCopyInto(out *Diagnostics) { + *out = *in + if in.Boot != nil { + in, out := &in.Boot, &out.Boot + *out = new(BootDiagnostics) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Diagnostics. +func (in *Diagnostics) DeepCopy() *Diagnostics { + if in == nil { + return nil + } + out := new(Diagnostics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiffDiskSettings) DeepCopyInto(out *DiffDiskSettings) { + *out = *in + if in.Placement != nil { + in, out := &in.Placement, &out.Placement + *out = new(DiffDiskPlacement) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiffDiskSettings. +func (in *DiffDiskSettings) DeepCopy() *DiffDiskSettings { + if in == nil { + return nil + } + out := new(DiffDiskSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiskEncryptionSetParameters) DeepCopyInto(out *DiskEncryptionSetParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskEncryptionSetParameters. +func (in *DiskEncryptionSetParameters) DeepCopy() *DiskEncryptionSetParameters { + if in == nil { + return nil + } + out := new(DiskEncryptionSetParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtendedLocationSpec) DeepCopyInto(out *ExtendedLocationSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedLocationSpec. +func (in *ExtendedLocationSpec) DeepCopy() *ExtendedLocationSpec { + if in == nil { + return nil + } + out := new(ExtendedLocationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionPlan) DeepCopyInto(out *ExtensionPlan) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionPlan. +func (in *ExtensionPlan) DeepCopy() *ExtensionPlan { + if in == nil { + return nil + } + out := new(ExtensionPlan) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtensionScope) DeepCopyInto(out *ExtensionScope) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtensionScope. +func (in *ExtensionScope) DeepCopy() *ExtensionScope { + if in == nil { + return nil + } + out := new(ExtensionScope) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FleetsMember) DeepCopyInto(out *FleetsMember) { + *out = *in + out.FleetsMemberClassSpec = in.FleetsMemberClassSpec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetsMember. +func (in *FleetsMember) DeepCopy() *FleetsMember { + if in == nil { + return nil + } + out := new(FleetsMember) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FleetsMemberClassSpec) DeepCopyInto(out *FleetsMemberClassSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetsMemberClassSpec. +func (in *FleetsMemberClassSpec) DeepCopy() *FleetsMemberClassSpec { + if in == nil { + return nil + } + out := new(FleetsMemberClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FrontendIP) DeepCopyInto(out *FrontendIP) { + *out = *in + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(PublicIPSpec) + (*in).DeepCopyInto(*out) + } + out.FrontendIPClass = in.FrontendIPClass +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendIP. +func (in *FrontendIP) DeepCopy() *FrontendIP { + if in == nil { + return nil + } + out := new(FrontendIP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FrontendIPClass) DeepCopyInto(out *FrontendIPClass) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendIPClass. +func (in *FrontendIPClass) DeepCopy() *FrontendIPClass { + if in == nil { + return nil + } + out := new(FrontendIPClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Future) DeepCopyInto(out *Future) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Future. +func (in *Future) DeepCopy() *Future { + if in == nil { + return nil + } + out := new(Future) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Futures) DeepCopyInto(out *Futures) { + { + in := &in + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Futures. +func (in Futures) DeepCopy() Futures { + if in == nil { + return nil + } + out := new(Futures) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPProxyConfig) DeepCopyInto(out *HTTPProxyConfig) { + *out = *in + if in.HTTPProxy != nil { + in, out := &in.HTTPProxy, &out.HTTPProxy + *out = new(string) + **out = **in + } + if in.HTTPSProxy != nil { + in, out := &in.HTTPSProxy, &out.HTTPSProxy + *out = new(string) + **out = **in + } + if in.NoProxy != nil { + in, out := &in.NoProxy, &out.NoProxy + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TrustedCA != nil { + in, out := &in.TrustedCA, &out.TrustedCA + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPProxyConfig. +func (in *HTTPProxyConfig) DeepCopy() *HTTPProxyConfig { + if in == nil { + return nil + } + out := new(HTTPProxyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPTag) DeepCopyInto(out *IPTag) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPTag. +func (in *IPTag) DeepCopy() *IPTag { + if in == nil { + return nil + } + out := new(IPTag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity) DeepCopyInto(out *Identity) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Image) DeepCopyInto(out *Image) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.SharedGallery != nil { + in, out := &in.SharedGallery, &out.SharedGallery + *out = new(AzureSharedGalleryImage) + (*in).DeepCopyInto(*out) + } + if in.Marketplace != nil { + in, out := &in.Marketplace, &out.Marketplace + *out = new(AzureMarketplaceImage) + **out = **in + } + if in.ComputeGallery != nil { + in, out := &in.ComputeGallery, &out.ComputeGallery + *out = new(AzureComputeGalleryImage) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image. +func (in *Image) DeepCopy() *Image { + if in == nil { + return nil + } + out := new(Image) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImagePlan) DeepCopyInto(out *ImagePlan) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePlan. +func (in *ImagePlan) DeepCopy() *ImagePlan { + if in == nil { + return nil + } + out := new(ImagePlan) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeletConfig) DeepCopyInto(out *KubeletConfig) { + *out = *in + if in.CPUManagerPolicy != nil { + in, out := &in.CPUManagerPolicy, &out.CPUManagerPolicy + *out = new(CPUManagerPolicy) + **out = **in + } + if in.CPUCfsQuota != nil { + in, out := &in.CPUCfsQuota, &out.CPUCfsQuota + *out = new(bool) + **out = **in + } + if in.CPUCfsQuotaPeriod != nil { + in, out := &in.CPUCfsQuotaPeriod, &out.CPUCfsQuotaPeriod + *out = new(string) + **out = **in + } + if in.ImageGcHighThreshold != nil { + in, out := &in.ImageGcHighThreshold, &out.ImageGcHighThreshold + *out = new(int) + **out = **in + } + if in.ImageGcLowThreshold != nil { + in, out := &in.ImageGcLowThreshold, &out.ImageGcLowThreshold + *out = new(int) + **out = **in + } + if in.TopologyManagerPolicy != nil { + in, out := &in.TopologyManagerPolicy, &out.TopologyManagerPolicy + *out = new(TopologyManagerPolicy) + **out = **in + } + if in.AllowedUnsafeSysctls != nil { + in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FailSwapOn != nil { + in, out := &in.FailSwapOn, &out.FailSwapOn + *out = new(bool) + **out = **in + } + if in.ContainerLogMaxSizeMB != nil { + in, out := &in.ContainerLogMaxSizeMB, &out.ContainerLogMaxSizeMB + *out = new(int) + **out = **in + } + if in.ContainerLogMaxFiles != nil { + in, out := &in.ContainerLogMaxFiles, &out.ContainerLogMaxFiles + *out = new(int) + **out = **in + } + if in.PodMaxPids != nil { + in, out := &in.PodMaxPids, &out.PodMaxPids + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletConfig. +func (in *KubeletConfig) DeepCopy() *KubeletConfig { + if in == nil { + return nil + } + out := new(KubeletConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinuxOSConfig) DeepCopyInto(out *LinuxOSConfig) { + *out = *in + if in.SwapFileSizeMB != nil { + in, out := &in.SwapFileSizeMB, &out.SwapFileSizeMB + *out = new(int) + **out = **in + } + if in.Sysctls != nil { + in, out := &in.Sysctls, &out.Sysctls + *out = new(SysctlConfig) + (*in).DeepCopyInto(*out) + } + if in.TransparentHugePageDefrag != nil { + in, out := &in.TransparentHugePageDefrag, &out.TransparentHugePageDefrag + *out = new(TransparentHugePageOption) + **out = **in + } + if in.TransparentHugePageEnabled != nil { + in, out := &in.TransparentHugePageEnabled, &out.TransparentHugePageEnabled + *out = new(TransparentHugePageOption) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinuxOSConfig. +func (in *LinuxOSConfig) DeepCopy() *LinuxOSConfig { + if in == nil { + return nil + } + out := new(LinuxOSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerClassSpec) DeepCopyInto(out *LoadBalancerClassSpec) { + *out = *in + if in.IdleTimeoutInMinutes != nil { + in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerClassSpec. +func (in *LoadBalancerClassSpec) DeepCopy() *LoadBalancerClassSpec { + if in == nil { + return nil + } + out := new(LoadBalancerClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerPort) DeepCopyInto(out *LoadBalancerPort) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerPort. +func (in *LoadBalancerPort) DeepCopy() *LoadBalancerPort { + if in == nil { + return nil + } + out := new(LoadBalancerPort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerProfile) DeepCopyInto(out *LoadBalancerProfile) { + *out = *in + if in.ManagedOutboundIPs != nil { + in, out := &in.ManagedOutboundIPs, &out.ManagedOutboundIPs + *out = new(int) + **out = **in + } + if in.OutboundIPPrefixes != nil { + in, out := &in.OutboundIPPrefixes, &out.OutboundIPPrefixes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.OutboundIPs != nil { + in, out := &in.OutboundIPs, &out.OutboundIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllocatedOutboundPorts != nil { + in, out := &in.AllocatedOutboundPorts, &out.AllocatedOutboundPorts + *out = new(int) + **out = **in + } + if in.IdleTimeoutInMinutes != nil { + in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerProfile. +func (in *LoadBalancerProfile) DeepCopy() *LoadBalancerProfile { + if in == nil { + return nil + } + out := new(LoadBalancerProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { + *out = *in + if in.FrontendIPs != nil { + in, out := &in.FrontendIPs, &out.FrontendIPs + *out = make([]FrontendIP, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FrontendIPsCount != nil { + in, out := &in.FrontendIPsCount, &out.FrontendIPsCount + *out = new(int32) + **out = **in + } + out.BackendPool = in.BackendPool + in.LoadBalancerClassSpec.DeepCopyInto(&out.LoadBalancerClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec. +func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { + if in == nil { + return nil + } + out := new(LoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterAutoUpgradeProfile) DeepCopyInto(out *ManagedClusterAutoUpgradeProfile) { + *out = *in + if in.UpgradeChannel != nil { + in, out := &in.UpgradeChannel, &out.UpgradeChannel + *out = new(UpgradeChannel) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterAutoUpgradeProfile. +func (in *ManagedClusterAutoUpgradeProfile) DeepCopy() *ManagedClusterAutoUpgradeProfile { + if in == nil { + return nil + } + out := new(ManagedClusterAutoUpgradeProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSecurityProfile) DeepCopyInto(out *ManagedClusterSecurityProfile) { + *out = *in + if in.AzureKeyVaultKms != nil { + in, out := &in.AzureKeyVaultKms, &out.AzureKeyVaultKms + *out = new(AzureKeyVaultKms) + (*in).DeepCopyInto(*out) + } + if in.Defender != nil { + in, out := &in.Defender, &out.Defender + *out = new(ManagedClusterSecurityProfileDefender) + **out = **in + } + if in.ImageCleaner != nil { + in, out := &in.ImageCleaner, &out.ImageCleaner + *out = new(ManagedClusterSecurityProfileImageCleaner) + (*in).DeepCopyInto(*out) + } + if in.WorkloadIdentity != nil { + in, out := &in.WorkloadIdentity, &out.WorkloadIdentity + *out = new(ManagedClusterSecurityProfileWorkloadIdentity) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSecurityProfile. +func (in *ManagedClusterSecurityProfile) DeepCopy() *ManagedClusterSecurityProfile { + if in == nil { + return nil + } + out := new(ManagedClusterSecurityProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSecurityProfileDefender) DeepCopyInto(out *ManagedClusterSecurityProfileDefender) { + *out = *in + out.SecurityMonitoring = in.SecurityMonitoring +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSecurityProfileDefender. +func (in *ManagedClusterSecurityProfileDefender) DeepCopy() *ManagedClusterSecurityProfileDefender { + if in == nil { + return nil + } + out := new(ManagedClusterSecurityProfileDefender) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSecurityProfileDefenderSecurityMonitoring) DeepCopyInto(out *ManagedClusterSecurityProfileDefenderSecurityMonitoring) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSecurityProfileDefenderSecurityMonitoring. +func (in *ManagedClusterSecurityProfileDefenderSecurityMonitoring) DeepCopy() *ManagedClusterSecurityProfileDefenderSecurityMonitoring { + if in == nil { + return nil + } + out := new(ManagedClusterSecurityProfileDefenderSecurityMonitoring) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSecurityProfileImageCleaner) DeepCopyInto(out *ManagedClusterSecurityProfileImageCleaner) { + *out = *in + if in.IntervalHours != nil { + in, out := &in.IntervalHours, &out.IntervalHours + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSecurityProfileImageCleaner. +func (in *ManagedClusterSecurityProfileImageCleaner) DeepCopy() *ManagedClusterSecurityProfileImageCleaner { + if in == nil { + return nil + } + out := new(ManagedClusterSecurityProfileImageCleaner) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterSecurityProfileWorkloadIdentity) DeepCopyInto(out *ManagedClusterSecurityProfileWorkloadIdentity) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterSecurityProfileWorkloadIdentity. +func (in *ManagedClusterSecurityProfileWorkloadIdentity) DeepCopy() *ManagedClusterSecurityProfileWorkloadIdentity { + if in == nil { + return nil + } + out := new(ManagedClusterSecurityProfileWorkloadIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { + *out = *in + if in.ServiceEndpoints != nil { + in, out := &in.ServiceEndpoints, &out.ServiceEndpoints + *out = make(ServiceEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateEndpoints != nil { + in, out := &in.PrivateEndpoints, &out.PrivateEndpoints + *out = make(PrivateEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. +func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { + if in == nil { + return nil + } + out := new(ManagedControlPlaneSubnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { + *out = *in + in.ManagedControlPlaneVirtualNetworkClassSpec.DeepCopyInto(&out.ManagedControlPlaneVirtualNetworkClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { + if in == nil { + return nil + } + out := new(ManagedControlPlaneVirtualNetwork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneVirtualNetworkClassSpec) DeepCopyInto(out *ManagedControlPlaneVirtualNetworkClassSpec) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetworkClassSpec. +func (in *ManagedControlPlaneVirtualNetworkClassSpec) DeepCopy() *ManagedControlPlaneVirtualNetworkClassSpec { + if in == nil { + return nil + } + out := new(ManagedControlPlaneVirtualNetworkClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedDiskParameters) DeepCopyInto(out *ManagedDiskParameters) { + *out = *in + if in.DiskEncryptionSet != nil { + in, out := &in.DiskEncryptionSet, &out.DiskEncryptionSet + *out = new(DiskEncryptionSetParameters) + **out = **in + } + if in.SecurityProfile != nil { + in, out := &in.SecurityProfile, &out.SecurityProfile + *out = new(VMDiskSecurityProfile) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedDiskParameters. +func (in *ManagedDiskParameters) DeepCopy() *ManagedDiskParameters { + if in == nil { + return nil + } + out := new(ManagedDiskParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { + *out = *in + if in.MinSize != nil { + in, out := &in.MinSize, &out.MinSize + *out = new(int) + **out = **in + } + if in.MaxSize != nil { + in, out := &in.MaxSize, &out.MaxSize + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. +func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { + if in == nil { + return nil + } + out := new(ManagedMachinePoolScaling) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NatGateway) DeepCopyInto(out *NatGateway) { + *out = *in + in.NatGatewayIP.DeepCopyInto(&out.NatGatewayIP) + if in.Zones != nil { + in, out := &in.Zones, &out.Zones + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.NatGatewayClassSpec = in.NatGatewayClassSpec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NatGateway. +func (in *NatGateway) DeepCopy() *NatGateway { + if in == nil { + return nil + } + out := new(NatGateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NatGatewayClassSpec) DeepCopyInto(out *NatGatewayClassSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NatGatewayClassSpec. +func (in *NatGatewayClassSpec) DeepCopy() *NatGatewayClassSpec { + if in == nil { + return nil + } + out := new(NatGatewayClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkClassSpec) DeepCopyInto(out *NetworkClassSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkClassSpec. +func (in *NetworkClassSpec) DeepCopy() *NetworkClassSpec { + if in == nil { + return nil + } + out := new(NetworkClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkInterface) DeepCopyInto(out *NetworkInterface) { + *out = *in + if in.AcceleratedNetworking != nil { + in, out := &in.AcceleratedNetworking, &out.AcceleratedNetworking + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkInterface. +func (in *NetworkInterface) DeepCopy() *NetworkInterface { + if in == nil { + return nil + } + out := new(NetworkInterface) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + in.Vnet.DeepCopyInto(&out.Vnet) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.APIServerLB != nil { + in, out := &in.APIServerLB, &out.APIServerLB + *out = new(LoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + if in.NodeOutboundLB != nil { + in, out := &in.NodeOutboundLB, &out.NodeOutboundLB + *out = new(LoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + if in.ControlPlaneOutboundLB != nil { + in, out := &in.ControlPlaneOutboundLB, &out.ControlPlaneOutboundLB + *out = new(LoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + if in.AdditionalAPIServerLBPorts != nil { + in, out := &in.AdditionalAPIServerLBPorts, &out.AdditionalAPIServerLBPorts + *out = make([]LoadBalancerPort, len(*in)) + copy(*out, *in) + } + if in.PrivateDNSZone != nil { + in, out := &in.PrivateDNSZone, &out.PrivateDNSZone + *out = new(PrivateDNSZoneMode) + **out = **in + } + out.NetworkClassSpec = in.NetworkClassSpec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkTemplateSpec) DeepCopyInto(out *NetworkTemplateSpec) { + *out = *in + out.NetworkClassSpec = in.NetworkClassSpec + in.Vnet.DeepCopyInto(&out.Vnet) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make(SubnetTemplatesSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.APIServerLB.DeepCopyInto(&out.APIServerLB) + if in.NodeOutboundLB != nil { + in, out := &in.NodeOutboundLB, &out.NodeOutboundLB + *out = new(LoadBalancerClassSpec) + (*in).DeepCopyInto(*out) + } + if in.ControlPlaneOutboundLB != nil { + in, out := &in.ControlPlaneOutboundLB, &out.ControlPlaneOutboundLB + *out = new(LoadBalancerClassSpec) + (*in).DeepCopyInto(*out) + } + if in.AdditionalAPIServerLBPorts != nil { + in, out := &in.AdditionalAPIServerLBPorts, &out.AdditionalAPIServerLBPorts + *out = make([]LoadBalancerPort, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkTemplateSpec. +func (in *NetworkTemplateSpec) DeepCopy() *NetworkTemplateSpec { + if in == nil { + return nil + } + out := new(NetworkTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeInfo) DeepCopyInto(out *NodeInfo) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInfo. +func (in *NodeInfo) DeepCopy() *NodeInfo { + if in == nil { + return nil + } + out := new(NodeInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OIDCIssuerProfile) DeepCopyInto(out *OIDCIssuerProfile) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCIssuerProfile. +func (in *OIDCIssuerProfile) DeepCopy() *OIDCIssuerProfile { + if in == nil { + return nil + } + out := new(OIDCIssuerProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OIDCIssuerProfileStatus) DeepCopyInto(out *OIDCIssuerProfileStatus) { + *out = *in + if in.IssuerURL != nil { + in, out := &in.IssuerURL, &out.IssuerURL + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCIssuerProfileStatus. +func (in *OIDCIssuerProfileStatus) DeepCopy() *OIDCIssuerProfileStatus { + if in == nil { + return nil + } + out := new(OIDCIssuerProfileStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OSDisk) DeepCopyInto(out *OSDisk) { + *out = *in + if in.DiskSizeGB != nil { + in, out := &in.DiskSizeGB, &out.DiskSizeGB + *out = new(int32) + **out = **in + } + if in.ManagedDisk != nil { + in, out := &in.ManagedDisk, &out.ManagedDisk + *out = new(ManagedDiskParameters) + (*in).DeepCopyInto(*out) + } + if in.DiffDiskSettings != nil { + in, out := &in.DiffDiskSettings, &out.DiffDiskSettings + *out = new(DiffDiskSettings) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSDisk. +func (in *OSDisk) DeepCopy() *OSDisk { + if in == nil { + return nil + } + out := new(OSDisk) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateEndpointSpec) DeepCopyInto(out *PrivateEndpointSpec) { + *out = *in + if in.PrivateLinkServiceConnections != nil { + in, out := &in.PrivateLinkServiceConnections, &out.PrivateLinkServiceConnections + *out = make([]PrivateLinkServiceConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateIPAddresses != nil { + in, out := &in.PrivateIPAddresses, &out.PrivateIPAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ApplicationSecurityGroups != nil { + in, out := &in.ApplicationSecurityGroups, &out.ApplicationSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateEndpointSpec. +func (in *PrivateEndpointSpec) DeepCopy() *PrivateEndpointSpec { + if in == nil { + return nil + } + out := new(PrivateEndpointSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in PrivateEndpoints) DeepCopyInto(out *PrivateEndpoints) { + { + in := &in + *out = make(PrivateEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateEndpoints. +func (in PrivateEndpoints) DeepCopy() PrivateEndpoints { + if in == nil { + return nil + } + out := new(PrivateEndpoints) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateLinkServiceConnection) DeepCopyInto(out *PrivateLinkServiceConnection) { + *out = *in + if in.GroupIDs != nil { + in, out := &in.GroupIDs, &out.GroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateLinkServiceConnection. +func (in *PrivateLinkServiceConnection) DeepCopy() *PrivateLinkServiceConnection { + if in == nil { + return nil + } + out := new(PrivateLinkServiceConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicIPSpec) DeepCopyInto(out *PublicIPSpec) { + *out = *in + if in.IPTags != nil { + in, out := &in.IPTags, &out.IPTags + *out = make([]IPTag, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicIPSpec. +func (in *PublicIPSpec) DeepCopy() *PublicIPSpec { + if in == nil { + return nil + } + out := new(PublicIPSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitConfig) DeepCopyInto(out *RateLimitConfig) { + *out = *in + if in.CloudProviderRateLimitQPS != nil { + in, out := &in.CloudProviderRateLimitQPS, &out.CloudProviderRateLimitQPS + x := (*in).DeepCopy() + *out = &x + } + if in.CloudProviderRateLimitQPSWrite != nil { + in, out := &in.CloudProviderRateLimitQPSWrite, &out.CloudProviderRateLimitQPSWrite + x := (*in).DeepCopy() + *out = &x + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitConfig. +func (in *RateLimitConfig) DeepCopy() *RateLimitConfig { + if in == nil { + return nil + } + out := new(RateLimitConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitSpec) DeepCopyInto(out *RateLimitSpec) { + *out = *in + in.Config.DeepCopyInto(&out.Config) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitSpec. +func (in *RateLimitSpec) DeepCopy() *RateLimitSpec { + if in == nil { + return nil + } + out := new(RateLimitSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus) { + *out = *in + out.Resource = in.Resource +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus. +func (in *ResourceStatus) DeepCopy() *ResourceStatus { + if in == nil { + return nil + } + out := new(ResourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteTable) DeepCopyInto(out *RouteTable) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTable. +func (in *RouteTable) DeepCopy() *RouteTable { + if in == nil { + return nil + } + out := new(RouteTable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in + in.SecurityGroupClass.DeepCopyInto(&out.SecurityGroupClass) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupClass) DeepCopyInto(out *SecurityGroupClass) { + *out = *in + if in.SecurityRules != nil { + in, out := &in.SecurityRules, &out.SecurityRules + *out = make(SecurityRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupClass. +func (in *SecurityGroupClass) DeepCopy() *SecurityGroupClass { + if in == nil { + return nil + } + out := new(SecurityGroupClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityProfile) DeepCopyInto(out *SecurityProfile) { + *out = *in + if in.EncryptionAtHost != nil { + in, out := &in.EncryptionAtHost, &out.EncryptionAtHost + *out = new(bool) + **out = **in + } + if in.UefiSettings != nil { + in, out := &in.UefiSettings, &out.UefiSettings + *out = new(UefiSettings) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityProfile. +func (in *SecurityProfile) DeepCopy() *SecurityProfile { + if in == nil { + return nil + } + out := new(SecurityProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityRule) DeepCopyInto(out *SecurityRule) { + *out = *in + if in.SourcePorts != nil { + in, out := &in.SourcePorts, &out.SourcePorts + *out = new(string) + **out = **in + } + if in.DestinationPorts != nil { + in, out := &in.DestinationPorts, &out.DestinationPorts + *out = new(string) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } + if in.Sources != nil { + in, out := &in.Sources, &out.Sources + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityRule. +func (in *SecurityRule) DeepCopy() *SecurityRule { + if in == nil { + return nil + } + out := new(SecurityRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in SecurityRules) DeepCopyInto(out *SecurityRules) { + { + in := &in + *out = make(SecurityRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityRules. +func (in SecurityRules) DeepCopy() SecurityRules { + if in == nil { + return nil + } + out := new(SecurityRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEndpointSpec) DeepCopyInto(out *ServiceEndpointSpec) { + *out = *in + if in.Locations != nil { + in, out := &in.Locations, &out.Locations + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEndpointSpec. +func (in *ServiceEndpointSpec) DeepCopy() *ServiceEndpointSpec { + if in == nil { + return nil + } + out := new(ServiceEndpointSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ServiceEndpoints) DeepCopyInto(out *ServiceEndpoints) { + { + in := &in + *out = make(ServiceEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEndpoints. +func (in ServiceEndpoints) DeepCopy() ServiceEndpoints { + if in == nil { + return nil + } + out := new(ServiceEndpoints) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpotVMOptions) DeepCopyInto(out *SpotVMOptions) { + *out = *in + if in.MaxPrice != nil { + in, out := &in.MaxPrice, &out.MaxPrice + x := (*in).DeepCopy() + *out = &x + } + if in.EvictionPolicy != nil { + in, out := &in.EvictionPolicy, &out.EvictionPolicy + *out = new(SpotEvictionPolicy) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpotVMOptions. +func (in *SpotVMOptions) DeepCopy() *SpotVMOptions { + if in == nil { + return nil + } + out := new(SpotVMOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusResource) DeepCopyInto(out *StatusResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusResource. +func (in *StatusResource) DeepCopy() *StatusResource { + if in == nil { + return nil + } + out := new(StatusResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetClassSpec) DeepCopyInto(out *SubnetClassSpec) { + *out = *in + if in.CIDRBlocks != nil { + in, out := &in.CIDRBlocks, &out.CIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceEndpoints != nil { + in, out := &in.ServiceEndpoints, &out.ServiceEndpoints + *out = make(ServiceEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateEndpoints != nil { + in, out := &in.PrivateEndpoints, &out.PrivateEndpoints + *out = make(PrivateEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetClassSpec. +func (in *SubnetClassSpec) DeepCopy() *SubnetClassSpec { + if in == nil { + return nil + } + out := new(SubnetClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + in.SecurityGroup.DeepCopyInto(&out.SecurityGroup) + out.RouteTable = in.RouteTable + in.NatGateway.DeepCopyInto(&out.NatGateway) + in.SubnetClassSpec.DeepCopyInto(&out.SubnetClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetTemplateSpec) DeepCopyInto(out *SubnetTemplateSpec) { + *out = *in + in.SubnetClassSpec.DeepCopyInto(&out.SubnetClassSpec) + in.SecurityGroup.DeepCopyInto(&out.SecurityGroup) + out.NatGateway = in.NatGateway +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetTemplateSpec. +func (in *SubnetTemplateSpec) DeepCopy() *SubnetTemplateSpec { + if in == nil { + return nil + } + out := new(SubnetTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in SubnetTemplatesSpec) DeepCopyInto(out *SubnetTemplatesSpec) { + { + in := &in + *out = make(SubnetTemplatesSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetTemplatesSpec. +func (in SubnetTemplatesSpec) DeepCopy() SubnetTemplatesSpec { + if in == nil { + return nil + } + out := new(SubnetTemplatesSpec) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Subnets) DeepCopyInto(out *Subnets) { + { + in := &in + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnets. +func (in Subnets) DeepCopy() Subnets { + if in == nil { + return nil + } + out := new(Subnets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SysctlConfig) DeepCopyInto(out *SysctlConfig) { + *out = *in + if in.FsAioMaxNr != nil { + in, out := &in.FsAioMaxNr, &out.FsAioMaxNr + *out = new(int) + **out = **in + } + if in.FsFileMax != nil { + in, out := &in.FsFileMax, &out.FsFileMax + *out = new(int) + **out = **in + } + if in.FsInotifyMaxUserWatches != nil { + in, out := &in.FsInotifyMaxUserWatches, &out.FsInotifyMaxUserWatches + *out = new(int) + **out = **in + } + if in.FsNrOpen != nil { + in, out := &in.FsNrOpen, &out.FsNrOpen + *out = new(int) + **out = **in + } + if in.KernelThreadsMax != nil { + in, out := &in.KernelThreadsMax, &out.KernelThreadsMax + *out = new(int) + **out = **in + } + if in.NetCoreNetdevMaxBacklog != nil { + in, out := &in.NetCoreNetdevMaxBacklog, &out.NetCoreNetdevMaxBacklog + *out = new(int) + **out = **in + } + if in.NetCoreOptmemMax != nil { + in, out := &in.NetCoreOptmemMax, &out.NetCoreOptmemMax + *out = new(int) + **out = **in + } + if in.NetCoreRmemDefault != nil { + in, out := &in.NetCoreRmemDefault, &out.NetCoreRmemDefault + *out = new(int) + **out = **in + } + if in.NetCoreRmemMax != nil { + in, out := &in.NetCoreRmemMax, &out.NetCoreRmemMax + *out = new(int) + **out = **in + } + if in.NetCoreSomaxconn != nil { + in, out := &in.NetCoreSomaxconn, &out.NetCoreSomaxconn + *out = new(int) + **out = **in + } + if in.NetCoreWmemDefault != nil { + in, out := &in.NetCoreWmemDefault, &out.NetCoreWmemDefault + *out = new(int) + **out = **in + } + if in.NetCoreWmemMax != nil { + in, out := &in.NetCoreWmemMax, &out.NetCoreWmemMax + *out = new(int) + **out = **in + } + if in.NetIpv4IPLocalPortRange != nil { + in, out := &in.NetIpv4IPLocalPortRange, &out.NetIpv4IPLocalPortRange + *out = new(string) + **out = **in + } + if in.NetIpv4NeighDefaultGcThresh1 != nil { + in, out := &in.NetIpv4NeighDefaultGcThresh1, &out.NetIpv4NeighDefaultGcThresh1 + *out = new(int) + **out = **in + } + if in.NetIpv4NeighDefaultGcThresh2 != nil { + in, out := &in.NetIpv4NeighDefaultGcThresh2, &out.NetIpv4NeighDefaultGcThresh2 + *out = new(int) + **out = **in + } + if in.NetIpv4NeighDefaultGcThresh3 != nil { + in, out := &in.NetIpv4NeighDefaultGcThresh3, &out.NetIpv4NeighDefaultGcThresh3 + *out = new(int) + **out = **in + } + if in.NetIpv4TCPFinTimeout != nil { + in, out := &in.NetIpv4TCPFinTimeout, &out.NetIpv4TCPFinTimeout + *out = new(int) + **out = **in + } + if in.NetIpv4TCPKeepaliveProbes != nil { + in, out := &in.NetIpv4TCPKeepaliveProbes, &out.NetIpv4TCPKeepaliveProbes + *out = new(int) + **out = **in + } + if in.NetIpv4TCPKeepaliveTime != nil { + in, out := &in.NetIpv4TCPKeepaliveTime, &out.NetIpv4TCPKeepaliveTime + *out = new(int) + **out = **in + } + if in.NetIpv4TCPMaxSynBacklog != nil { + in, out := &in.NetIpv4TCPMaxSynBacklog, &out.NetIpv4TCPMaxSynBacklog + *out = new(int) + **out = **in + } + if in.NetIpv4TCPMaxTwBuckets != nil { + in, out := &in.NetIpv4TCPMaxTwBuckets, &out.NetIpv4TCPMaxTwBuckets + *out = new(int) + **out = **in + } + if in.NetIpv4TCPTwReuse != nil { + in, out := &in.NetIpv4TCPTwReuse, &out.NetIpv4TCPTwReuse + *out = new(bool) + **out = **in + } + if in.NetIpv4TCPkeepaliveIntvl != nil { + in, out := &in.NetIpv4TCPkeepaliveIntvl, &out.NetIpv4TCPkeepaliveIntvl + *out = new(int) + **out = **in + } + if in.NetNetfilterNfConntrackBuckets != nil { + in, out := &in.NetNetfilterNfConntrackBuckets, &out.NetNetfilterNfConntrackBuckets + *out = new(int) + **out = **in + } + if in.NetNetfilterNfConntrackMax != nil { + in, out := &in.NetNetfilterNfConntrackMax, &out.NetNetfilterNfConntrackMax + *out = new(int) + **out = **in + } + if in.VMMaxMapCount != nil { + in, out := &in.VMMaxMapCount, &out.VMMaxMapCount + *out = new(int) + **out = **in + } + if in.VMSwappiness != nil { + in, out := &in.VMSwappiness, &out.VMSwappiness + *out = new(int) + **out = **in + } + if in.VMVfsCachePressure != nil { + in, out := &in.VMVfsCachePressure, &out.VMVfsCachePressure + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SysctlConfig. +func (in *SysctlConfig) DeepCopy() *SysctlConfig { + if in == nil { + return nil + } + out := new(SysctlConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SystemAssignedIdentityRole) DeepCopyInto(out *SystemAssignedIdentityRole) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemAssignedIdentityRole. +func (in *SystemAssignedIdentityRole) DeepCopy() *SystemAssignedIdentityRole { + if in == nil { + return nil + } + out := new(SystemAssignedIdentityRole) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Tags) DeepCopyInto(out *Tags) { + { + in := &in + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. +func (in Tags) DeepCopy() Tags { + if in == nil { + return nil + } + out := new(Tags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Taint) DeepCopyInto(out *Taint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. +func (in *Taint) DeepCopy() *Taint { + if in == nil { + return nil + } + out := new(Taint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Taints) DeepCopyInto(out *Taints) { + { + in := &in + *out = make(Taints, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. +func (in Taints) DeepCopy() Taints { + if in == nil { + return nil + } + out := new(Taints) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UefiSettings) DeepCopyInto(out *UefiSettings) { + *out = *in + if in.SecureBootEnabled != nil { + in, out := &in.SecureBootEnabled, &out.SecureBootEnabled + *out = new(bool) + **out = **in + } + if in.VTpmEnabled != nil { + in, out := &in.VTpmEnabled, &out.VTpmEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UefiSettings. +func (in *UefiSettings) DeepCopy() *UefiSettings { + if in == nil { + return nil + } + out := new(UefiSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentity) DeepCopyInto(out *UserAssignedIdentity) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentity. +func (in *UserAssignedIdentity) DeepCopy() *UserAssignedIdentity { + if in == nil { + return nil + } + out := new(UserAssignedIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserManagedBootDiagnostics) DeepCopyInto(out *UserManagedBootDiagnostics) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserManagedBootDiagnostics. +func (in *UserManagedBootDiagnostics) DeepCopy() *UserManagedBootDiagnostics { + if in == nil { + return nil + } + out := new(UserManagedBootDiagnostics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMDiskSecurityProfile) DeepCopyInto(out *VMDiskSecurityProfile) { + *out = *in + if in.DiskEncryptionSet != nil { + in, out := &in.DiskEncryptionSet, &out.DiskEncryptionSet + *out = new(DiskEncryptionSetParameters) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMDiskSecurityProfile. +func (in *VMDiskSecurityProfile) DeepCopy() *VMDiskSecurityProfile { + if in == nil { + return nil + } + out := new(VMDiskSecurityProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VMExtension) DeepCopyInto(out *VMExtension) { + *out = *in + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ProtectedSettings != nil { + in, out := &in.ProtectedSettings, &out.ProtectedSettings + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMExtension. +func (in *VMExtension) DeepCopy() *VMExtension { + if in == nil { + return nil + } + out := new(VMExtension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetClassSpec) DeepCopyInto(out *VnetClassSpec) { + *out = *in + if in.CIDRBlocks != nil { + in, out := &in.CIDRBlocks, &out.CIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetClassSpec. +func (in *VnetClassSpec) DeepCopy() *VnetClassSpec { + if in == nil { + return nil + } + out := new(VnetClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetPeeringClassSpec) DeepCopyInto(out *VnetPeeringClassSpec) { + *out = *in + in.ForwardPeeringProperties.DeepCopyInto(&out.ForwardPeeringProperties) + in.ReversePeeringProperties.DeepCopyInto(&out.ReversePeeringProperties) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetPeeringClassSpec. +func (in *VnetPeeringClassSpec) DeepCopy() *VnetPeeringClassSpec { + if in == nil { + return nil + } + out := new(VnetPeeringClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetPeeringProperties) DeepCopyInto(out *VnetPeeringProperties) { + *out = *in + if in.AllowForwardedTraffic != nil { + in, out := &in.AllowForwardedTraffic, &out.AllowForwardedTraffic + *out = new(bool) + **out = **in + } + if in.AllowGatewayTransit != nil { + in, out := &in.AllowGatewayTransit, &out.AllowGatewayTransit + *out = new(bool) + **out = **in + } + if in.AllowVirtualNetworkAccess != nil { + in, out := &in.AllowVirtualNetworkAccess, &out.AllowVirtualNetworkAccess + *out = new(bool) + **out = **in + } + if in.UseRemoteGateways != nil { + in, out := &in.UseRemoteGateways, &out.UseRemoteGateways + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetPeeringProperties. +func (in *VnetPeeringProperties) DeepCopy() *VnetPeeringProperties { + if in == nil { + return nil + } + out := new(VnetPeeringProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetPeeringSpec) DeepCopyInto(out *VnetPeeringSpec) { + *out = *in + in.VnetPeeringClassSpec.DeepCopyInto(&out.VnetPeeringClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetPeeringSpec. +func (in *VnetPeeringSpec) DeepCopy() *VnetPeeringSpec { + if in == nil { + return nil + } + out := new(VnetPeeringSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in VnetPeerings) DeepCopyInto(out *VnetPeerings) { + { + in := &in + *out = make(VnetPeerings, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetPeerings. +func (in VnetPeerings) DeepCopy() VnetPeerings { + if in == nil { + return nil + } + out := new(VnetPeerings) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in VnetPeeringsTemplateSpec) DeepCopyInto(out *VnetPeeringsTemplateSpec) { + { + in := &in + *out = make(VnetPeeringsTemplateSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetPeeringsTemplateSpec. +func (in VnetPeeringsTemplateSpec) DeepCopy() VnetPeeringsTemplateSpec { + if in == nil { + return nil + } + out := new(VnetPeeringsTemplateSpec) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetSpec) DeepCopyInto(out *VnetSpec) { + *out = *in + if in.Peerings != nil { + in, out := &in.Peerings, &out.Peerings + *out = make(VnetPeerings, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.VnetClassSpec.DeepCopyInto(&out.VnetClassSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetSpec. +func (in *VnetSpec) DeepCopy() *VnetSpec { + if in == nil { + return nil + } + out := new(VnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VnetTemplateSpec) DeepCopyInto(out *VnetTemplateSpec) { + *out = *in + in.VnetClassSpec.DeepCopyInto(&out.VnetClassSpec) + if in.Peerings != nil { + in, out := &in.Peerings, &out.Peerings + *out = make(VnetPeeringsTemplateSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VnetTemplateSpec. +func (in *VnetTemplateSpec) DeepCopy() *VnetTemplateSpec { + if in == nil { + return nil + } + out := new(VnetTemplateSpec) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/azure/go.mod b/pkg/capi/azure/go.mod new file mode 100644 index 000000000000..216278a2efc2 --- /dev/null +++ b/pkg/capi/azure/go.mod @@ -0,0 +1,57 @@ +module sigs.k8s.io/cluster-api-provider-azure + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + k8s.io/utils v0.0.0-20260108192941-914a6e750570 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_conversion.go b/pkg/capi/gcp/api/v1beta1/doc.go similarity index 79% rename from vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_conversion.go rename to pkg/capi/gcp/api/v1beta1/doc.go index 78f5e2be7872..d55ab5609a7b 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_conversion.go +++ b/pkg/capi/gcp/api/v1beta1/doc.go @@ -15,9 +15,3 @@ limitations under the License. */ package v1beta1 - -// Hub marks GCPMachine as a conversion hub. -func (*GCPMachine) Hub() {} - -// Hub marks GCPMachineList as a conversion hub. -func (*GCPMachineList) Hub() {} diff --git a/pkg/capi/gcp/api/v1beta1/endpoints.go b/pkg/capi/gcp/api/v1beta1/endpoints.go new file mode 100644 index 000000000000..e66827b43f44 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/endpoints.go @@ -0,0 +1,49 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// ServiceEndpoints contains all the gcp service endpoints that the user may override. Each field corresponds to +// a service where the expected value is the url that is used to override the default API endpoint. +type ServiceEndpoints struct { + // ComputeServiceEndpoint is the custom endpoint url for the Compute Service + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri + // +kubebuilder:validation:Pattern=`^https://` + // +optional + ComputeServiceEndpoint string `json:"compute,omitempty"` + + // ContainerServiceEndpoint is the custom endpoint url for the Container Service + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri + // +kubebuilder:validation:Pattern=`^https://` + // +optional + ContainerServiceEndpoint string `json:"container,omitempty"` + + // IAMServiceEndpoint is the custom endpoint url for the IAM Service + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri + // +kubebuilder:validation:Pattern=`^https://` + // +optional + IAMServiceEndpoint string `json:"iam,omitempty"` + + // ResourceManagerServiceEndpoint is the custom endpoint url for the Resource Manager Service + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:Format=uri + // +kubebuilder:validation:Pattern=`^https://` + // +optional + ResourceManagerServiceEndpoint string `json:"resourceManager,omitempty"` +} diff --git a/pkg/capi/gcp/api/v1beta1/gcpcluster_types.go b/pkg/capi/gcp/api/v1beta1/gcpcluster_types.go new file mode 100644 index 000000000000..ca3d2f7c351d --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/gcpcluster_types.go @@ -0,0 +1,118 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +const ( + // ClusterFinalizer allows ReconcileGCPCluster to clean up GCP resources associated with GCPCluster before + // removing it from the apiserver. + ClusterFinalizer = "gcpcluster.infrastructure.cluster.x-k8s.io" +) + +// GCPClusterSpec defines the desired state of GCPCluster. +type GCPClusterSpec struct { + // Project is the name of the project to deploy the cluster to. + Project string `json:"project"` + + // The GCP Region the cluster lives in. + Region string `json:"region"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` + + // NetworkSpec encapsulates all things related to GCP network. + // +optional + Network NetworkSpec `json:"network"` + + // FailureDomains is an optional field which is used to assign selected availability zones to a cluster + // FailureDomains if empty, defaults to all the zones in the selected region and if specified would override + // the default zones. + // +optional + FailureDomains []string `json:"failureDomains,omitempty"` + + // AdditionalLabels is an optional set of tags to add to GCP resources managed by the GCP provider, in addition to the + // ones added by default. + // +optional + AdditionalLabels Labels `json:"additionalLabels,omitempty"` + + // ResourceManagerTags is an optional set of tags to apply to GCP resources managed + // by the GCP provider. GCP supports a maximum of 50 tags per resource. + // +maxItems=50 + // +optional + ResourceManagerTags ResourceManagerTags `json:"resourceManagerTags,omitempty"` + + // CredentialsRef is a reference to a Secret that contains the credentials to use for provisioning this cluster. If not + // supplied then the credentials of the controller will be used. + // When creating a new GCP client, the controller will try to extract the type + // of credential from the JSON data, and it will request a client for the specific credential type. + // +optional + CredentialsRef *ObjectReference `json:"credentialsRef,omitempty"` + + // LoadBalancer contains configuration for one or more LoadBalancers. + // +optional + LoadBalancer LoadBalancerSpec `json:"loadBalancer,omitempty"` + + // ServiceEndpoints contains the custom GCP Service Endpoint urls for each applicable service. + // For instance, the user can specify a new endpoint for the compute service. + // +optional + ServiceEndpoints *ServiceEndpoints `json:"serviceEndpoints,omitempty"` +} + +// GCPClusterStatus defines the observed state of GCPCluster. +type GCPClusterStatus struct { + FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` + Network Network `json:"network,omitempty"` + + // Bastion Instance `json:"bastion,omitempty"` + Ready bool `json:"ready"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=gcpclusters,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this GCPCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for GCE instances" +// +kubebuilder:printcolumn:name="Network",type="string",JSONPath=".spec.network.name",description="GCP network the cluster is using" +// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".status.apiEndpoints[0]",description="API Endpoint",priority=1 + +// GCPCluster is the Schema for the gcpclusters API. +type GCPCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GCPClusterSpec `json:"spec,omitempty"` + Status GCPClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GCPClusterList contains a list of GCPCluster. +type GCPClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GCPCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&GCPCluster{}, &GCPClusterList{}) +} diff --git a/pkg/capi/gcp/api/v1beta1/gcpclustertemplate_types.go b/pkg/capi/gcp/api/v1beta1/gcpclustertemplate_types.go new file mode 100644 index 000000000000..4f8a3dc2bac3 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/gcpclustertemplate_types.go @@ -0,0 +1,62 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// GCPClusterTemplateSpec defines the desired state of GCPClusterTemplate. +type GCPClusterTemplateSpec struct { + Template GCPClusterTemplateResource `json:"template"` +} + +// GCPClusterTemplateResource contains spec for GCPClusterSpec. +type GCPClusterTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + + Spec GCPClusterSpec `json:"spec"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=gcpclustertemplates,scope=Namespaced,categories=cluster-api,shortName=gcpct +// +kubebuilder:storageversion + +// GCPClusterTemplate is the Schema for the gcpclustertemplates API. +type GCPClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GCPClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// GCPClusterTemplateList contains a list of GCPClusterTemplate. +type GCPClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GCPClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&GCPClusterTemplate{}, &GCPClusterTemplateList{}) +} diff --git a/pkg/capi/gcp/api/v1beta1/gcpmachine_types.go b/pkg/capi/gcp/api/v1beta1/gcpmachine_types.go new file mode 100644 index 000000000000..b0659ab767ba --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/gcpmachine_types.go @@ -0,0 +1,495 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // MachineFinalizer allows ReconcileGCPMachine to clean up GCP resources associated with GCPMachine before + // removing it from the apiserver. + MachineFinalizer = "gcpmachine.infrastructure.cluster.x-k8s.io" +) + +// DiskType is a type to use to define with disk type will be used. +type DiskType string + +const ( + // PdStandardDiskType defines the name for the standard disk. + PdStandardDiskType DiskType = "pd-standard" + // PdSsdDiskType defines the name for the ssd disk. + PdSsdDiskType DiskType = "pd-ssd" + // LocalSsdDiskType defines the name for the local ssd disk. + LocalSsdDiskType DiskType = "local-ssd" +) + +// AttachedDiskSpec degined GCP machine disk. +type AttachedDiskSpec struct { + // DeviceType is a device type of the attached disk. + // Supported types of non-root attached volumes: + // 1. "pd-standard" - Standard (HDD) persistent disk + // 2. "pd-ssd" - SSD persistent disk + // 3. "local-ssd" - Local SSD disk (https://cloud.google.com/compute/docs/disks/local-ssd). + // 4. "pd-balanced" - Balanced Persistent Disk + // 5. "hyperdisk-balanced" - Hyperdisk Balanced + // Default is "pd-standard". + // +optional + DeviceType *DiskType `json:"deviceType,omitempty"` + // Size is the size of the disk in GBs. + // Defaults to 30GB. For "local-ssd" size is always 375GB. + // +optional + Size *int64 `json:"size,omitempty"` + // EncryptionKey defines the KMS key to be used to encrypt the disk. + // +optional + EncryptionKey *CustomerEncryptionKey `json:"encryptionKey,omitempty"` +} + +// IPForwarding represents the IP forwarding configuration for the GCP machine. +type IPForwarding string + +const ( + // IPForwardingEnabled enables the IP forwarding configuration for the GCP machine. + IPForwardingEnabled IPForwarding = "Enabled" + // IPForwardingDisabled disables the IP forwarding configuration for the GCP machine. + IPForwardingDisabled IPForwarding = "Disabled" +) + +// SecureBootPolicy represents the secure boot configuration for the GCP machine. +type SecureBootPolicy string + +const ( + // SecureBootPolicyEnabled enables the secure boot configuration for the GCP machine. + SecureBootPolicyEnabled SecureBootPolicy = "Enabled" + // SecureBootPolicyDisabled disables the secure boot configuration for the GCP machine. + SecureBootPolicyDisabled SecureBootPolicy = "Disabled" +) + +// VirtualizedTrustedPlatformModulePolicy represents the virtualized trusted platform module configuration for the GCP machine. +type VirtualizedTrustedPlatformModulePolicy string + +const ( + // VirtualizedTrustedPlatformModulePolicyEnabled enables the virtualized trusted platform module configuration for the GCP machine. + VirtualizedTrustedPlatformModulePolicyEnabled VirtualizedTrustedPlatformModulePolicy = "Enabled" + // VirtualizedTrustedPlatformModulePolicyDisabled disables the virtualized trusted platform module configuration for the GCP machine. + VirtualizedTrustedPlatformModulePolicyDisabled VirtualizedTrustedPlatformModulePolicy = "Disabled" +) + +// IntegrityMonitoringPolicy represents the integrity monitoring configuration for the GCP machine. +type IntegrityMonitoringPolicy string + +const ( + // IntegrityMonitoringPolicyEnabled enables integrity monitoring for the GCP machine. + IntegrityMonitoringPolicyEnabled IntegrityMonitoringPolicy = "Enabled" + // IntegrityMonitoringPolicyDisabled disables integrity monitoring for the GCP machine. + IntegrityMonitoringPolicyDisabled IntegrityMonitoringPolicy = "Disabled" +) + +// GCPShieldedInstanceConfig describes the shielded VM configuration of the instance on GCP. +// Shielded VM configuration allow users to enable and disable Secure Boot, vTPM, and Integrity Monitoring. +type GCPShieldedInstanceConfig struct { + // SecureBoot Defines whether the instance should have secure boot enabled. + // Secure Boot verify the digital signature of all boot components, and halting the boot process if signature verification fails. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is Disabled. + // +kubebuilder:validation:Enum=Enabled;Disabled + //+optional + SecureBoot SecureBootPolicy `json:"secureBoot,omitempty"` + + // VirtualizedTrustedPlatformModule enable virtualized trusted platform module measurements to create a known good boot integrity policy baseline. + // The integrity policy baseline is used for comparison with measurements from subsequent VM boots to determine if anything has changed. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is Enabled. + // +kubebuilder:validation:Enum=Enabled;Disabled + // +optional + VirtualizedTrustedPlatformModule VirtualizedTrustedPlatformModulePolicy `json:"virtualizedTrustedPlatformModule,omitempty"` + + // IntegrityMonitoring determines whether the instance should have integrity monitoring that verify the runtime boot integrity. + // Compares the most recent boot measurements to the integrity policy baseline and return + // a pair of pass/fail results depending on whether they match or not. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is Enabled. + // +kubebuilder:validation:Enum=Enabled;Disabled + // +optional + IntegrityMonitoring IntegrityMonitoringPolicy `json:"integrityMonitoring,omitempty"` +} + +// ConfidentialComputePolicy represents the confidential compute configuration for the GCP machine. +type ConfidentialComputePolicy string + +const ( + // ConfidentialComputePolicyEnabled enables confidential compute for the GCP machine. + ConfidentialComputePolicyEnabled ConfidentialComputePolicy = "Enabled" + // ConfidentialComputePolicyDisabled disables confidential compute for the GCP machine. + ConfidentialComputePolicyDisabled ConfidentialComputePolicy = "Disabled" + // ConfidentialComputePolicySEV sets AMD SEV as the VM instance's confidential computing technology of choice. + ConfidentialComputePolicySEV ConfidentialComputePolicy = "AMDEncryptedVirtualization" + // ConfidentialComputePolicySEVSNP sets AMD SEV-SNP as the VM instance's confidential computing technology of choice. + ConfidentialComputePolicySEVSNP ConfidentialComputePolicy = "AMDEncryptedVirtualizationNestedPaging" + // ConfidentialComputePolicyTDX sets Intel TDX as the VM instance's confidential computing technology of choice. + ConfidentialComputePolicyTDX ConfidentialComputePolicy = "IntelTrustedDomainExtensions" +) + +// Confidential VM Technology support depends on the configured machine types. +// reference: https://cloud.google.com/compute/confidential-vm/docs/os-and-machine-type#machine-type +var ( + confidentialMachineSeriesSupportingSev = []string{"n2d", "c2d", "c3d"} + confidentialMachineSeriesSupportingSevsnp = []string{"n2d"} + confidentialMachineSeriesSupportingTdx = []string{"c3"} +) + +// HostMaintenancePolicy represents the desired behavior ase of a host maintenance event. +type HostMaintenancePolicy string + +const ( + // HostMaintenancePolicyMigrate causes Compute Engine to live migrate an instance when there is a maintenance event. + HostMaintenancePolicyMigrate HostMaintenancePolicy = "Migrate" + // HostMaintenancePolicyTerminate - stops an instance instead of migrating it. + HostMaintenancePolicyTerminate HostMaintenancePolicy = "Terminate" +) + +// KeyType is a type for disk encryption. +type KeyType string + +const ( + // CustomerManagedKey (CMEK) references an encryption key stored in Google Cloud KMS. + CustomerManagedKey KeyType = "Managed" + // CustomerSuppliedKey (CSEK) specifies an encryption key to use. + CustomerSuppliedKey KeyType = "Supplied" +) + +// ManagedKey is a reference to a key managed by the Cloud Key Management Service. +type ManagedKey struct { + // KMSKeyName is the name of the encryption key that is stored in Google Cloud KMS. For example: + // "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/key_region/cryptoKeys/key + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern=`projects\/[-_[A-Za-z0-9]+\/locations\/[-_[A-Za-z0-9]+\/keyRings\/[-_[A-Za-z0-9]+\/cryptoKeys\/[-_[A-Za-z0-9]+` + // +kubebuilder:validation:MaxLength=160 + KMSKeyName string `json:"kmsKeyName,omitempty"` +} + +// SuppliedKey contains a key for disk encryption. Either RawKey or RSAEncryptedKey must be provided. +// +kubebuilder:validation:MinProperties=1 +// +kubebuilder:validation:MaxProperties=1 +type SuppliedKey struct { + // RawKey specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 + // base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. + // For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" + // +optional + RawKey []byte `json:"rawKey,omitempty"` + // RSAEncryptedKey specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption + // key to either encrypt or decrypt this resource. You can provide either the rawKey or the + // rsaEncryptedKey. + // For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFHi + // z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoDi + // D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" + // The key must meet the following requirements before you can provide it to Compute Engine: + // 1. The key is wrapped using a RSA public key certificate provided by Google. + // 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. + // Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + // +optional + RSAEncryptedKey []byte `json:"rsaEncryptedKey,omitempty"` +} + +// CustomerEncryptionKey supports both Customer-Managed or Customer-Supplied encryption keys . +type CustomerEncryptionKey struct { + // KeyType is the type of encryption key. Must be either Managed, aka Customer-Managed Encryption Key (CMEK) or + // Supplied, aka Customer-Supplied EncryptionKey (CSEK). + // +kubebuilder:validation:Enum=Managed;Supplied + KeyType KeyType `json:"keyType"` + // KMSKeyServiceAccount is the service account being used for the encryption request for the given KMS key. + // If absent, the Compute Engine default service account is used. For example: + // "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com. + // The maximum length is based on the Service Account ID (max 30), Project (max 30), and a valid gcloud email + // suffix ("iam.gserviceaccount.com"). + // +kubebuilder:validation:MaxLength=85 + // +kubebuilder:validation:Pattern=`[-_[A-Za-z0-9]+@[-_[A-Za-z0-9]+.iam.gserviceaccount.com` + // +optional + KMSKeyServiceAccount *string `json:"kmsKeyServiceAccount,omitempty"` + // ManagedKey references keys managed by the Cloud Key Management Service. This should be set when KeyType is Managed. + // +optional + ManagedKey *ManagedKey `json:"managedKey,omitempty"` + // SuppliedKey provides the key used to create or manage a disk. This should be set when KeyType is Managed. + // +optional + SuppliedKey *SuppliedKey `json:"suppliedKey,omitempty"` +} + +// ProvisioningModel is a type for Spot VM enablement. +type ProvisioningModel string + +const ( + // ProvisioningModelStandard specifies the VM type to NOT be Spot. + ProvisioningModelStandard ProvisioningModel = "Standard" + // ProvisioningModelSpot specifies the VM type to be Spot. + ProvisioningModelSpot ProvisioningModel = "Spot" +) + +// AliasIPRange is an alias IP range attached to an instance's network interface. +type AliasIPRange struct { + // IPCidrRange is the IP alias ranges to allocate for this interface. This IP + // CIDR range must belong to the specified subnetwork and cannot contain IP + // addresses reserved by system or used by other network interfaces. This range + // may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a + // CIDR-formatted string (such as 10.1.2.0/24). + // +kubebuilder:validation:Pattern=`^((([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])|(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(/([0-9]|[12][0-9]|3[0-2])))$` + // +required + IPCidrRange string `json:"ipCidrRange"` + // SubnetworkRangeName is the name of a subnetwork secondary IP range from which + // to allocate an IP alias range. If not specified, the primary range of the + // subnetwork is used. + // +optional + SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"` +} + +// GCPMachineSpec defines the desired state of GCPMachine. +type GCPMachineSpec struct { + // InstanceType is the type of instance to create. Example: n1.standard-2 + InstanceType string `json:"instanceType"` + + // Subnet is a reference to the subnetwork to use for this instance. If not specified, + // the first subnetwork retrieved from the Cluster Region and Network is picked. + // +optional + Subnet *string `json:"subnet,omitempty"` + + // AliasIPRanges let you assign ranges of internal IP addresses as aliases to a VM's network interfaces. + // +optional + AliasIPRanges []AliasIPRange `json:"aliasIPRanges,omitempty"` + + // ProviderID is the unique identifier as specified by the cloud provider. + // +optional + ProviderID *string `json:"providerID,omitempty"` + + // ImageFamily is the full reference to a valid image family to be used for this machine. + // +optional + ImageFamily *string `json:"imageFamily,omitempty"` + + // Image is the full reference to a valid image to be used for this machine. + // Takes precedence over ImageFamily. + // +optional + Image *string `json:"image,omitempty"` + + // AdditionalLabels is an optional set of tags to add to an instance, in addition to the ones added by default by the + // GCP provider. If both the GCPCluster and the GCPMachine specify the same tag name with different values, the + // GCPMachine's value takes precedence. + // +optional + AdditionalLabels Labels `json:"additionalLabels,omitempty"` + + // AdditionalMetadata is an optional set of metadata to add to an instance, in addition to the ones added by default by the + // GCP provider. + // +listType=map + // +listMapKey=key + // +optional + AdditionalMetadata []MetadataItem `json:"additionalMetadata,omitempty"` + + // IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + // +optional + // IAMInstanceProfile string `json:"iamInstanceProfile,omitempty"` + + // PublicIP specifies whether the instance should get a public IP. + // Set this to true if you don't have a NAT instances or Cloud Nat setup. + // +optional + PublicIP *bool `json:"publicIP,omitempty"` + + // AdditionalNetworkTags is a list of network tags that should be applied to the + // instance. These tags are set in addition to any network tags defined + // at the cluster level or in the actuator. + // +optional + AdditionalNetworkTags []string `json:"additionalNetworkTags,omitempty"` + + // ResourceManagerTags is an optional set of tags to apply to GCP resources managed + // by the GCP provider. GCP supports a maximum of 50 tags per resource. + // +maxItems=50 + // +optional + ResourceManagerTags ResourceManagerTags `json:"resourceManagerTags,omitempty"` + + // RootDeviceSize is the size of the root volume in GB. + // Defaults to 30. + // +optional + RootDeviceSize int64 `json:"rootDeviceSize,omitempty"` + + // RootDeviceType is the type of the root volume. + // Supported types of root volumes: + // 1. "pd-standard" - Standard (HDD) persistent disk + // 2. "pd-ssd" - SSD persistent disk + // 3. "pd-balanced" - Balanced Persistent Disk + // 4. "hyperdisk-balanced" - Hyperdisk Balanced + // Default is "pd-standard". + // +optional + RootDeviceType *DiskType `json:"rootDeviceType,omitempty"` + + // AdditionalDisks are optional non-boot attached disks. + // +optional + AdditionalDisks []AttachedDiskSpec `json:"additionalDisks,omitempty"` + + // ServiceAccount specifies the service account email and which scopes to assign to the machine. + // Defaults to: email: "default", scope: []{compute.CloudPlatformScope} + // +optional + ServiceAccount *ServiceAccount `json:"serviceAccounts,omitempty"` + + // Preemptible defines if instance is preemptible + // +optional + Preemptible bool `json:"preemptible,omitempty"` + + // ProvisioningModel defines if instance is spot. + // If set to "Standard" while preemptible is true, then the VM will be of type "Preemptible". + // If "Spot", VM type is "Spot". When unspecified, defaults to "Standard". + // +kubebuilder:validation:Enum=Standard;Spot + // +optional + ProvisioningModel *ProvisioningModel `json:"provisioningModel,omitempty"` + + // IPForwarding Allows this instance to send and receive packets with non-matching destination or source IPs. + // This is required if you plan to use this instance to forward routes. Defaults to enabled. + // +kubebuilder:validation:Enum=Enabled;Disabled + // +kubebuilder:default=Enabled + // +optional + IPForwarding *IPForwarding `json:"ipForwarding,omitempty"` + + // ShieldedInstanceConfig is the Shielded VM configuration for this machine + // +optional + ShieldedInstanceConfig *GCPShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"` + + // OnHostMaintenance determines the behavior when a maintenance event occurs that might cause the instance to reboot. + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is "Migrate". + // +kubebuilder:validation:Enum=Migrate;Terminate; + // +optional + OnHostMaintenance *HostMaintenancePolicy `json:"onHostMaintenance,omitempty"` + + // ConfidentialCompute Defines whether the instance should have confidential compute enabled or not, and the confidential computing technology of choice. + // If Disabled, the machine will not be configured to be a confidential computing instance. + // If Enabled, confidential computing will be configured and AMD Secure Encrypted Virtualization will be configured by default. That is subject to change over time. If using AMD Secure Encrypted Virtualization is vital, use AMDEncryptedVirtualization explicitly instead. + // If AMDEncryptedVirtualization, it will configure AMD Secure Encrypted Virtualization (AMD SEV) as the confidential computing technology. + // If AMDEncryptedVirtualizationNestedPaging, it will configure AMD Secure Encrypted Virtualization Secure Nested Paging (AMD SEV-SNP) as the confidential computing technology. + // If IntelTrustedDomainExtensions, it will configure Intel TDX as the confidential computing technology. + // If enabled (any value other than Disabled) OnHostMaintenance is required to be set to "Terminate". + // If omitted, the platform chooses a default, which is subject to change over time, currently that default is false. + // +kubebuilder:validation:Enum=Enabled;Disabled;AMDEncryptedVirtualization;AMDEncryptedVirtualizationNestedPaging;IntelTrustedDomainExtensions + // +optional + ConfidentialCompute *ConfidentialComputePolicy `json:"confidentialCompute,omitempty"` + + // RootDiskEncryptionKey defines the KMS key to be used to encrypt the root disk. + // +optional + RootDiskEncryptionKey *CustomerEncryptionKey `json:"rootDiskEncryptionKey,omitempty"` + + // GuestAccelerators is a list of the type and count of accelerator cards + // attached to the instance. + // +optional + GuestAccelerators []Accelerator `json:"guestAccelerators,omitempty"` +} + +// Accelerator is a specification of the type and number of accelerator +// cards attached to the instance. +type Accelerator struct { + // Count is the number of the guest accelerator cards exposed to this + // instance. + Count int64 `json:"count,omitempty"` + // Type is the full or partial URL of the accelerator type resource to + // attach to this instance. For example: + // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 + // If you are creating an instance template, specify only the accelerator name. + // See GPUs on Compute Engine for a full list of accelerator types. + Type string `json:"type,omitempty"` +} + +// MetadataItem defines a single piece of metadata associated with an instance. +type MetadataItem struct { + // Key is the identifier for the metadata entry. + Key string `json:"key"` + // Value is the value of the metadata entry. + Value *string `json:"value,omitempty"` +} + +// GCPMachineStatus defines the observed state of GCPMachine. +type GCPMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Addresses contains the GCP instance associated addresses. + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // InstanceStatus is the status of the GCP instance for this machine. + // +optional + InstanceStatus *InstanceStatus `json:"instanceState,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *string `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=gcpmachines,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this GCPMachine belongs" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="GCE instance state" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" +// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="GCE instance ID" +// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this GCPMachine" + +// GCPMachine is the Schema for the gcpmachines API. +type GCPMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GCPMachineSpec `json:"spec,omitempty"` + Status GCPMachineStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GCPMachineList contains a list of GCPMachine. +type GCPMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GCPMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&GCPMachine{}, &GCPMachineList{}) +} diff --git a/pkg/capi/gcp/api/v1beta1/gcpmachinetemplate_types.go b/pkg/capi/gcp/api/v1beta1/gcpmachinetemplate_types.go new file mode 100644 index 000000000000..d7c5271efed6 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/gcpmachinetemplate_types.go @@ -0,0 +1,51 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// GCPMachineTemplateSpec defines the desired state of GCPMachineTemplate. +type GCPMachineTemplateSpec struct { + Template GCPMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=gcpmachinetemplates,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion + +// GCPMachineTemplate is the Schema for the gcpmachinetemplates API. +type GCPMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GCPMachineTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// GCPMachineTemplateList contains a list of GCPMachineTemplate. +type GCPMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GCPMachineTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&GCPMachineTemplate{}, &GCPMachineTemplateList{}) +} diff --git a/pkg/capi/gcp/api/v1beta1/groupversion_info.go b/pkg/capi/gcp/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..3715bbfa5beb --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/capi/gcp/api/v1beta1/labels.go b/pkg/capi/gcp/api/v1beta1/labels.go new file mode 100644 index 000000000000..eded27abf23c --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/labels.go @@ -0,0 +1,162 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "reflect" + "strings" +) + +// Labels defines a map of tags. +type Labels map[string]string + +// Equals returns true if the tags are equal. +func (in Labels) Equals(other Labels) bool { + return reflect.DeepEqual(in, other) +} + +// HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling. +func (in Labels) HasOwned(cluster string) bool { + value, ok := in[ClusterTagKey(cluster)] + + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// // HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of the in-tree cloud provider. +// func (in Labels) HasGCPCloudProviderOwned(cluster string) bool { +// value, ok := t[ClusterGCPCloudProviderTagKey(cluster)] +// return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +// } + +// GetRole returns the Cluster API role for the tagged resource. +func (in Labels) GetRole() string { + return in[NameGCPClusterAPIRole] +} + +// ToComputeFilter returns the string representation of the labels as a filter +// to be used in google compute sdk calls. +func (in Labels) ToComputeFilter() string { + var builder strings.Builder + for k, v := range in { + builder.WriteString(fmt.Sprintf("(labels.%s = %q) ", k, v)) + } + + return builder.String() +} + +// Difference returns the difference between this map of tags and the other map of tags. +// Items are considered equals if key and value are equals. +func (in Labels) Difference(other Labels) Labels { + res := make(Labels, len(in)) + + for key, value := range in { + if otherValue, ok := other[key]; ok && value == otherValue { + continue + } + res[key] = value + } + + return res +} + +// AddLabels adds (and overwrites) the current labels with the ones passed in. +func (in Labels) AddLabels(other Labels) Labels { + for key, value := range other { + if in == nil { + in = make(map[string]string, len(other)) + } + in[key] = value + } + + return in +} + +// ResourceLifecycle configures the lifecycle of a resource. +type ResourceLifecycle string + +const ( + // ResourceLifecycleOwned is the value we use when tagging resources to indicate + // that the resource is considered owned and managed by the cluster, + // and in particular that the lifecycle is tied to the lifecycle of the cluster. + ResourceLifecycleOwned = ResourceLifecycle("owned") + + // NameGCPProviderPrefix is the tag prefix we use to differentiate + // cluster-api-provider-gcp owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameGCPProviderPrefix = "capg-" + + // NameGCPProviderOwned is the tag name we use to differentiate + // cluster-api-provider-gcp owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameGCPProviderOwned = NameGCPProviderPrefix + "cluster-" + + // NameGCPClusterAPIRole is the tag name we use to mark roles for resources + // dedicated to this cluster api provider implementation. + NameGCPClusterAPIRole = NameGCPProviderPrefix + "role" + + // APIServerRoleTagValue describes the value for the apiserver role. + APIServerRoleTagValue = "apiserver" + + // InternalRoleTagValue describes the value for the internal role. + InternalRoleTagValue = "api-internal" +) + +// ClusterTagKey generates the key for resources associated with a cluster. +func ClusterTagKey(name string) string { + return fmt.Sprintf("%s%s", NameGCPProviderOwned, name) +} + +// ClusterGCPCloudProviderTagKey generates the key for resources associated a cluster's GCP cloud provider. +// func ClusterGCPCloudProviderTagKey(name string) string { +// return fmt.Sprintf("%s%s", NameKubernetesGCPCloudProviderPrefix, name) +// } + +// BuildParams is used to build tags around an gcp resource. +type BuildParams struct { + // Lifecycle determines the resource lifecycle. + Lifecycle ResourceLifecycle + + // ClusterName is the cluster associated with the resource. + ClusterName string + + // ResourceID is the unique identifier of the resource to be tagged. + ResourceID string + + // Role is the role associated to the resource. + // +optional + Role *string + + // Any additional tags to be added to the resource. + // +optional + Additional Labels +} + +// Build builds tags including the cluster tag and returns them in map form. +func Build(params BuildParams) Labels { + tags := make(Labels) + for k, v := range params.Additional { + tags[strings.ToLower(k)] = strings.ToLower(v) + } + + tags[ClusterTagKey(params.ClusterName)] = string(params.Lifecycle) + if params.Role != nil { + tags[NameGCPClusterAPIRole] = strings.ToLower(*params.Role) + } + + return tags +} diff --git a/pkg/capi/gcp/api/v1beta1/tags.go b/pkg/capi/gcp/api/v1beta1/tags.go new file mode 100644 index 000000000000..424d672f34e6 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/tags.go @@ -0,0 +1,64 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// ResourceManagerTags is an slice of ResourceManagerTag structs. +type ResourceManagerTags []ResourceManagerTag + +// ResourceManagerTagsMap defines a map of key value pairs as expected by compute.InstanceParams.ResourceManagerTags. +type ResourceManagerTagsMap map[string]string + +// ResourceManagerTag is a tag to apply to GCP resources managed by the GCP provider. +type ResourceManagerTag struct { + // ParentID is the ID of the hierarchical resource where the tags are defined + // e.g. at the Organization or the Project level. To find the Organization or Project ID ref + // https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id + // https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects + // An OrganizationID must consist of decimal numbers, and cannot have leading zeroes. + // A ProjectID must be 6 to 30 characters in length, can only contain lowercase letters, + // numbers, and hyphens, and must start with a letter, and cannot end with a hyphen. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + // +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)` + ParentID string `json:"parentID"` + + // Key is the key part of the tag. A tag key can have a maximum of 63 characters and cannot + // be empty. Tag key must begin and end with an alphanumeric character, and must contain + // only uppercase, lowercase alphanumeric characters, and the following special + // characters `._-`. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([0-9A-Za-z_.-]{0,61}[a-zA-Z0-9])?$` + Key string `json:"key"` + + // Value is the value part of the tag. A tag value can have a maximum of 63 characters and + // cannot be empty. Tag value must begin and end with an alphanumeric character, and must + // contain only uppercase, lowercase alphanumeric characters, and the following special + // characters `_-.@%=+:,*#&(){}[]` and spaces. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([0-9A-Za-z_.@%=+:,*#&()\[\]{}\-\s]{0,61}[a-zA-Z0-9])?$` + Value string `json:"value"` +} + +// Merge merges resource manager tags in receiver and other. +func (t *ResourceManagerTags) Merge(other ResourceManagerTags) { + *t = append(*t, other...) +} diff --git a/pkg/capi/gcp/api/v1beta1/types.go b/pkg/capi/gcp/api/v1beta1/types.go new file mode 100644 index 000000000000..4d94c8f2ca89 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/types.go @@ -0,0 +1,448 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// GCPMachineTemplateResource describes the data needed to create am GCPMachine from a template. +type GCPMachineTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + + // Spec is the specification of the desired behavior of the machine. + Spec GCPMachineSpec `json:"spec"` +} + +// Filter is a filter used to identify an GCP resource. +type Filter struct { + // Name of the filter. Filter names are case-sensitive. + Name string `json:"name"` + + // Values includes one or more filter values. Filter values are case-sensitive. + Values []string `json:"values"` +} + +// Network encapsulates GCP networking resources. +type Network struct { + // SelfLink is the link to the Network used for this cluster. + SelfLink *string `json:"selfLink,omitempty"` + + // FirewallRules is a map from the name of the rule to its full reference. + // +optional + FirewallRules map[string]string `json:"firewallRules,omitempty"` + + // Router is the full reference to the router created within the network + // it'll contain the cloud nat gateway + // +optional + Router *string `json:"router,omitempty"` + + // APIServerAddress is the IPV4 global address assigned to the load balancer + // created for the API Server. + // +optional + APIServerAddress *string `json:"apiServerIpAddress,omitempty"` + + // APIServerHealthCheck is the full reference to the health check + // created for the API Server. + // +optional + APIServerHealthCheck *string `json:"apiServerHealthCheck,omitempty"` + + // APIServerInstanceGroups is a map from zone to the full reference + // to the instance groups created for the control plane nodes created in the same zone. + // +optional + APIServerInstanceGroups map[string]string `json:"apiServerInstanceGroups,omitempty"` + + // APIServerBackendService is the full reference to the backend service + // created for the API Server. + // +optional + APIServerBackendService *string `json:"apiServerBackendService,omitempty"` + + // APIServerTargetProxy is the full reference to the target proxy + // created for the API Server. + // +optional + APIServerTargetProxy *string `json:"apiServerTargetProxy,omitempty"` + + // APIServerForwardingRule is the full reference to the forwarding rule + // created for the API Server. + // +optional + APIServerForwardingRule *string `json:"apiServerForwardingRule,omitempty"` + + // APIInternalAddress is the IPV4 regional address assigned to the + // internal Load Balancer. + // +optional + APIInternalAddress *string `json:"apiInternalIpAddress,omitempty"` + + // APIInternalHealthCheck is the full reference to the health check + // created for the internal Load Balancer. + // +optional + APIInternalHealthCheck *string `json:"apiInternalHealthCheck,omitempty"` + + // APIInternalBackendService is the full reference to the backend service + // created for the internal Load Balancer. + // +optional + APIInternalBackendService *string `json:"apiInternalBackendService,omitempty"` + + // APIInternalForwardingRule is the full reference to the forwarding rule + // created for the internal Load Balancer. + // +optional + APIInternalForwardingRule *string `json:"apiInternalForwardingRule,omitempty"` +} + +// FirewallSpec contains configuration for the firewall. +type FirewallSpec struct { + // DefaultRulesManagement determines the management policy for the default firewall rules + // created by the controller. DefaultRulesManagement has no effect on user specified firewall + // rules. DefaultRulesManagement has no effect when a HostProject is specified. + // "Managed": The controller will create and manage firewall rules. + // "Unmanaged": The controller will not create or modify any firewall rules. If + // the RulesManagement is changed from Managed to Unmanaged after the firewall rules + // have been created, then the firewall rules will not be deleted. + // + // Defaults to "Managed". + // +optional + // +kubebuilder:default:="Managed" + DefaultRulesManagement RulesManagementPolicy `json:"defaultRulesManagement,omitempty"` +} + +// RulesManagementPolicy is a string enum type for managing firewall rules. +// +kubebuilder:validation:Enum=Managed;Unmanaged +type RulesManagementPolicy string + +const ( + // RulesManagementManaged indicates that the controller should create and manage + // firewall rules. This is the default behavior. + RulesManagementManaged RulesManagementPolicy = "Managed" + + // RulesManagementUnmanaged indicates that the controller should not create or manage + // any firewall rules. If rules already exist, they will be left as-is. + RulesManagementUnmanaged RulesManagementPolicy = "Unmanaged" +) + +// NetworkSpec encapsulates all things related to a GCP network. +type NetworkSpec struct { + // Name is the name of the network to be used. + // +optional + Name *string `json:"name,omitempty"` + + // AutoCreateSubnetworks: When set to true, the VPC network is created + // in "auto" mode. When set to false, the VPC network is created in + // "custom" mode. + // + // An auto mode VPC network starts with one subnet per region. Each + // subnet has a predetermined range as described in Auto mode VPC + // network IP ranges. + // + // Defaults to true. + // +optional + AutoCreateSubnetworks *bool `json:"autoCreateSubnetworks,omitempty"` + + // Subnets configuration. + // +optional + Subnets Subnets `json:"subnets,omitempty"` + + // Allow for configuration of load balancer backend (useful for changing apiserver port) + // +optional + LoadBalancerBackendPort *int32 `json:"loadBalancerBackendPort,omitempty"` + + // HostProject is the name of the project hosting the shared VPC network resources. + // +optional + HostProject *string `json:"hostProject,omitempty"` + + // Firewall configuration. + // +optional + Firewall FirewallSpec `json:"firewall,omitempty,omitzero"` + + // Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is + // 1300 and the maximum value is 8896. The suggested value is 1500, which is + // the default MTU used on the Internet, or 8896 if you want to use Jumbo + // frames. If unspecified, the value defaults to 1460. + // More info: https://pkg.go.dev/google.golang.org/api/compute/v1#Network + // +kubebuilder:validation:Minimum:=1300 + // +kubebuilder:validation:Maximum:=8896 + // +kubebuilder:default:=1460 + // +optional + Mtu int64 `json:"mtu,omitempty"` + + // MinPortsPerVM: Minimum number of ports allocated to a VM from this NAT + // config. If not set, a default number of ports is allocated to a VM. This is + // rounded up to the nearest power of 2. For example, if the value of this + // field is 50, at least 64 ports are allocated to a VM. + // +kubebuilder:validation:Minimum:=2 + // +kubebuilder:validation:Maximum:=65536 + // +kubebuilder:default:=64 + // +optional + MinPortsPerVM int64 `json:"minPortsPerVm,omitempty"` +} + +// LoadBalancerType defines the Load Balancer that should be created. +type LoadBalancerType string + +var ( + // External creates a Global External Proxy Load Balancer + // to manage traffic to backends in multiple regions. This is the default Load + // Balancer and will be created if no LoadBalancerType is defined. + External = LoadBalancerType("External") + + // Internal creates a Regional Internal Passthrough Load + // Balancer to manage traffic to backends in the configured region. + Internal = LoadBalancerType("Internal") + + // InternalExternal creates both External and Internal Load Balancers to provide + // separate endpoints for managing both external and internal traffic. + InternalExternal = LoadBalancerType("InternalExternal") +) + +// LoadBalancerSpec contains configuration for one or more LoadBalancers. +type LoadBalancerSpec struct { + // APIServerInstanceGroupTagOverride overrides the default setting for the + // tag used when creating the API Server Instance Group. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:MaxLength=16 + // +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)` + // +optional + APIServerInstanceGroupTagOverride *string `json:"apiServerInstanceGroupTagOverride,omitempty"` + + // LoadBalancerType defines the type of Load Balancer that should be created. + // If not set, a Global External Proxy Load Balancer will be created by default. + // +optional + LoadBalancerType *LoadBalancerType `json:"loadBalancerType,omitempty"` + + // InternalLoadBalancer is the configuration for an Internal Passthrough Network Load Balancer. + // +optional + InternalLoadBalancer *LoadBalancer `json:"internalLoadBalancer,omitempty"` +} + +// SubnetSpec configures an GCP Subnet. +type SubnetSpec struct { + // Name defines a unique identifier to reference this resource. + Name string `json:"name,omitempty"` + + // CidrBlock is the range of internal addresses that are owned by this + // subnetwork. Provide this property when you create the subnetwork. For + // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + // non-overlapping within a network. Only IPv4 is supported. This field + // can be set only at resource creation time. + CidrBlock string `json:"cidrBlock,omitempty"` + + // Description is an optional description associated with the resource. + // +optional + Description *string `json:"description,omitempty"` + + // SecondaryCidrBlocks defines secondary CIDR ranges, + // from which secondary IP ranges of a VM may be allocated + // +optional + SecondaryCidrBlocks map[string]string `json:"secondaryCidrBlocks,omitempty"` + + // Region is the name of the region where the Subnetwork resides. + Region string `json:"region,omitempty"` + + // PrivateGoogleAccess defines whether VMs in this subnet can access + // Google services without assigning external IP addresses + // +optional + PrivateGoogleAccess *bool `json:"privateGoogleAccess,omitempty"` + + // EnableFlowLogs: Whether to enable flow logging for this subnetwork. + // If this field is not explicitly set, it will not appear in get + // listings. If not set the default behavior is to disable flow logging. + // +optional + EnableFlowLogs *bool `json:"enableFlowLogs,omitempty"` + + // Purpose: The purpose of the resource. + // If unspecified, the purpose defaults to PRIVATE_RFC_1918. + // The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER. + // + // Possible values: + // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal + // HTTP(S) Load Balancing. + // "PRIVATE" - Regular user created or automatically created subnet. + // "PRIVATE_RFC_1918" - Regular user created or automatically created + // subnet. + // "PRIVATE_SERVICE_CONNECT" - Subnetworks created for Private Service + // Connect in the producer network. + // "REGIONAL_MANAGED_PROXY" - Subnetwork used for Regional + // Internal/External HTTP(S) Load Balancing. + // +kubebuilder:validation:Enum=INTERNAL_HTTPS_LOAD_BALANCER;PRIVATE_RFC_1918;PRIVATE;PRIVATE_SERVICE_CONNECT;REGIONAL_MANAGED_PROXY + // +kubebuilder:default=PRIVATE_RFC_1918 + // +optional + Purpose *string `json:"purpose,omitempty"` + + // StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in + // the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in + // the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, + // IPV4_ONLY is used. This field can be both set at resource creation time and + // updated using patch. + // + // Possible values: + // "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6 + // addresses. + // "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses. + // "IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses. + // +kubebuilder:validation:Enum=IPV4_ONLY;IPV4_IPV6;IPV6_ONLY + // +kubebuilder:default=IPV4_ONLY + // +optional + StackType string `json:"stackType,omitempty"` +} + +// String returns a string representation of the subnet. +func (s *SubnetSpec) String() string { + return fmt.Sprintf("name=%s/region=%s", s.Name, s.Region) +} + +// Subnets is a slice of Subnet. +type Subnets []SubnetSpec + +// ToMap returns a map from name to subnet. +func (s Subnets) ToMap() map[string]*SubnetSpec { + res := make(map[string]*SubnetSpec) + for i := range s { + x := s[i] + res[x.Name] = &x + } + + return res +} + +// FindByName returns a single subnet matching the given name or nil. +func (s Subnets) FindByName(name string) *SubnetSpec { + for _, x := range s { + if x.Name == name { + return &x + } + } + + return nil +} + +// FilterByRegion returns a slice containing all subnets that live in the specified region. +func (s Subnets) FilterByRegion(region string) (res Subnets) { + for _, x := range s { + if x.Region == region { + res = append(res, x) + } + } + + return +} + +// InstanceStatus describes the state of an GCP instance. +type InstanceStatus string + +var ( + // InstanceStatusProvisioning is the string representing an instance in a provisioning state. + InstanceStatusProvisioning = InstanceStatus("PROVISIONING") + + // InstanceStatusRepairing is the string representing an instance in a repairing state. + InstanceStatusRepairing = InstanceStatus("REPAIRING") + + // InstanceStatusRunning is the string representing an instance in a pending state. + InstanceStatusRunning = InstanceStatus("RUNNING") + + // InstanceStatusStaging is the string representing an instance in a staging state. + InstanceStatusStaging = InstanceStatus("STAGING") + + // InstanceStatusStopped is the string representing an instance + // that has been stopped and can be restarted. + InstanceStatusStopped = InstanceStatus("STOPPED") + + // InstanceStatusStopping is the string representing an instance + // that is in the process of being stopped and can be restarted. + InstanceStatusStopping = InstanceStatus("STOPPING") + + // InstanceStatusSuspended is the string representing an instance + // that is suspended. + InstanceStatusSuspended = InstanceStatus("SUSPENDED") + + // InstanceStatusSuspending is the string representing an instance + // that is in the process of being suspended. + InstanceStatusSuspending = InstanceStatus("SUSPENDING") + + // InstanceStatusTerminated is the string representing an instance that has been terminated. + InstanceStatusTerminated = InstanceStatus("TERMINATED") +) + +// ServiceAccount describes compute.serviceAccount. +type ServiceAccount struct { + // Email: Email address of the service account. + Email string `json:"email,omitempty"` + + // Scopes: The list of scopes to be made available for this service + // account. + Scopes []string `json:"scopes,omitempty"` +} + +// ObjectReference is a reference to another Kubernetes object instance. +type ObjectReference struct { + // Namespace of the referent. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + // +kubebuilder:validation:Required + Namespace string `json:"namespace"` + // Name of the referent. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // +kubebuilder:validation:Required + Name string `json:"name"` +} + +// InternalAccess defines the access for the Internal Passthrough Load Balancer. +type InternalAccess string + +const ( + // InternalAccessRegional restricts traffic to clients within the same region as the internal load balancer. + InternalAccessRegional = InternalAccess("Regional") + + // InternalAccessGlobal allows traffic from any region to access the internal load balancer. + InternalAccessGlobal = InternalAccess("Global") +) + +// LoadBalancer specifies the configuration of a LoadBalancer. +type LoadBalancer struct { + // Name is the name of the Load Balancer. If not set a default name + // will be used. For an Internal Load Balancer service the default + // name is "api-internal". + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Pattern=`(^[1-9][0-9]{0,31}$)|(^[a-z][a-z0-9-]{4,28}[a-z0-9]$)` + // +optional + Name *string `json:"name,omitempty"` + + // Subnet is the name of the subnet to use for a regional Load Balancer. A subnet is + // required for the Load Balancer, if not defined the first configured subnet will be + // used. + Subnet *string `json:"subnet,omitempty"` + + // InternalAccess defines the access for the Internal Passthrough Load Balancer. + // It determines whether the load balancer allows global access, + // or restricts traffic to clients within the same region as the load balancer. + // If unspecified, the value defaults to "Regional". + // + // Possible values: + // "Regional" - Only clients in the same region as the load balancer can access it. + // "Global" - Clients from any region can access the load balancer. + // +kubebuilder:validation:Enum=Regional;Global + // +kubebuilder:default=Regional + // +optional + InternalAccess InternalAccess `json:"internalAccess,omitempty"` + + // IPAddress is the static IP address to use for the Load Balancer. + // If not set, a new static IP address will be allocated. + // If set, it must be a valid free IP address from the LoadBalancer Subnet. + // +optional + IPAddress *string `json:"ipAddress,omitempty"` +} diff --git a/pkg/capi/gcp/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/gcp/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..38cb445f8648 --- /dev/null +++ b/pkg/capi/gcp/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,1154 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Accelerator) DeepCopyInto(out *Accelerator) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Accelerator. +func (in *Accelerator) DeepCopy() *Accelerator { + if in == nil { + return nil + } + out := new(Accelerator) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AliasIPRange) DeepCopyInto(out *AliasIPRange) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AliasIPRange. +func (in *AliasIPRange) DeepCopy() *AliasIPRange { + if in == nil { + return nil + } + out := new(AliasIPRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttachedDiskSpec) DeepCopyInto(out *AttachedDiskSpec) { + *out = *in + if in.DeviceType != nil { + in, out := &in.DeviceType, &out.DeviceType + *out = new(DiskType) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(int64) + **out = **in + } + if in.EncryptionKey != nil { + in, out := &in.EncryptionKey, &out.EncryptionKey + *out = new(CustomerEncryptionKey) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttachedDiskSpec. +func (in *AttachedDiskSpec) DeepCopy() *AttachedDiskSpec { + if in == nil { + return nil + } + out := new(AttachedDiskSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildParams) DeepCopyInto(out *BuildParams) { + *out = *in + if in.Role != nil { + in, out := &in.Role, &out.Role + *out = new(string) + **out = **in + } + if in.Additional != nil { + in, out := &in.Additional, &out.Additional + *out = make(Labels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildParams. +func (in *BuildParams) DeepCopy() *BuildParams { + if in == nil { + return nil + } + out := new(BuildParams) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomerEncryptionKey) DeepCopyInto(out *CustomerEncryptionKey) { + *out = *in + if in.KMSKeyServiceAccount != nil { + in, out := &in.KMSKeyServiceAccount, &out.KMSKeyServiceAccount + *out = new(string) + **out = **in + } + if in.ManagedKey != nil { + in, out := &in.ManagedKey, &out.ManagedKey + *out = new(ManagedKey) + **out = **in + } + if in.SuppliedKey != nil { + in, out := &in.SuppliedKey, &out.SuppliedKey + *out = new(SuppliedKey) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomerEncryptionKey. +func (in *CustomerEncryptionKey) DeepCopy() *CustomerEncryptionKey { + if in == nil { + return nil + } + out := new(CustomerEncryptionKey) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallSpec) DeepCopyInto(out *FirewallSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallSpec. +func (in *FirewallSpec) DeepCopy() *FirewallSpec { + if in == nil { + return nil + } + out := new(FirewallSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPCluster) DeepCopyInto(out *GCPCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPCluster. +func (in *GCPCluster) DeepCopy() *GCPCluster { + if in == nil { + return nil + } + out := new(GCPCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterList) DeepCopyInto(out *GCPClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GCPCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterList. +func (in *GCPClusterList) DeepCopy() *GCPClusterList { + if in == nil { + return nil + } + out := new(GCPClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterSpec) DeepCopyInto(out *GCPClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + in.Network.DeepCopyInto(&out.Network) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdditionalLabels != nil { + in, out := &in.AdditionalLabels, &out.AdditionalLabels + *out = make(Labels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ResourceManagerTags != nil { + in, out := &in.ResourceManagerTags, &out.ResourceManagerTags + *out = make(ResourceManagerTags, len(*in)) + copy(*out, *in) + } + if in.CredentialsRef != nil { + in, out := &in.CredentialsRef, &out.CredentialsRef + *out = new(ObjectReference) + **out = **in + } + in.LoadBalancer.DeepCopyInto(&out.LoadBalancer) + if in.ServiceEndpoints != nil { + in, out := &in.ServiceEndpoints, &out.ServiceEndpoints + *out = new(ServiceEndpoints) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterSpec. +func (in *GCPClusterSpec) DeepCopy() *GCPClusterSpec { + if in == nil { + return nil + } + out := new(GCPClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterStatus) DeepCopyInto(out *GCPClusterStatus) { + *out = *in + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(corev1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + in.Network.DeepCopyInto(&out.Network) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterStatus. +func (in *GCPClusterStatus) DeepCopy() *GCPClusterStatus { + if in == nil { + return nil + } + out := new(GCPClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterTemplate) DeepCopyInto(out *GCPClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterTemplate. +func (in *GCPClusterTemplate) DeepCopy() *GCPClusterTemplate { + if in == nil { + return nil + } + out := new(GCPClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterTemplateList) DeepCopyInto(out *GCPClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GCPClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterTemplateList. +func (in *GCPClusterTemplateList) DeepCopy() *GCPClusterTemplateList { + if in == nil { + return nil + } + out := new(GCPClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterTemplateResource) DeepCopyInto(out *GCPClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterTemplateResource. +func (in *GCPClusterTemplateResource) DeepCopy() *GCPClusterTemplateResource { + if in == nil { + return nil + } + out := new(GCPClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPClusterTemplateSpec) DeepCopyInto(out *GCPClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPClusterTemplateSpec. +func (in *GCPClusterTemplateSpec) DeepCopy() *GCPClusterTemplateSpec { + if in == nil { + return nil + } + out := new(GCPClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachine) DeepCopyInto(out *GCPMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachine. +func (in *GCPMachine) DeepCopy() *GCPMachine { + if in == nil { + return nil + } + out := new(GCPMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineList) DeepCopyInto(out *GCPMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GCPMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineList. +func (in *GCPMachineList) DeepCopy() *GCPMachineList { + if in == nil { + return nil + } + out := new(GCPMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineSpec) DeepCopyInto(out *GCPMachineSpec) { + *out = *in + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(string) + **out = **in + } + if in.AliasIPRanges != nil { + in, out := &in.AliasIPRanges, &out.AliasIPRanges + *out = make([]AliasIPRange, len(*in)) + copy(*out, *in) + } + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.ImageFamily != nil { + in, out := &in.ImageFamily, &out.ImageFamily + *out = new(string) + **out = **in + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } + if in.AdditionalLabels != nil { + in, out := &in.AdditionalLabels, &out.AdditionalLabels + *out = make(Labels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AdditionalMetadata != nil { + in, out := &in.AdditionalMetadata, &out.AdditionalMetadata + *out = make([]MetadataItem, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(bool) + **out = **in + } + if in.AdditionalNetworkTags != nil { + in, out := &in.AdditionalNetworkTags, &out.AdditionalNetworkTags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ResourceManagerTags != nil { + in, out := &in.ResourceManagerTags, &out.ResourceManagerTags + *out = make(ResourceManagerTags, len(*in)) + copy(*out, *in) + } + if in.RootDeviceType != nil { + in, out := &in.RootDeviceType, &out.RootDeviceType + *out = new(DiskType) + **out = **in + } + if in.AdditionalDisks != nil { + in, out := &in.AdditionalDisks, &out.AdditionalDisks + *out = make([]AttachedDiskSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceAccount != nil { + in, out := &in.ServiceAccount, &out.ServiceAccount + *out = new(ServiceAccount) + (*in).DeepCopyInto(*out) + } + if in.ProvisioningModel != nil { + in, out := &in.ProvisioningModel, &out.ProvisioningModel + *out = new(ProvisioningModel) + **out = **in + } + if in.IPForwarding != nil { + in, out := &in.IPForwarding, &out.IPForwarding + *out = new(IPForwarding) + **out = **in + } + if in.ShieldedInstanceConfig != nil { + in, out := &in.ShieldedInstanceConfig, &out.ShieldedInstanceConfig + *out = new(GCPShieldedInstanceConfig) + **out = **in + } + if in.OnHostMaintenance != nil { + in, out := &in.OnHostMaintenance, &out.OnHostMaintenance + *out = new(HostMaintenancePolicy) + **out = **in + } + if in.ConfidentialCompute != nil { + in, out := &in.ConfidentialCompute, &out.ConfidentialCompute + *out = new(ConfidentialComputePolicy) + **out = **in + } + if in.RootDiskEncryptionKey != nil { + in, out := &in.RootDiskEncryptionKey, &out.RootDiskEncryptionKey + *out = new(CustomerEncryptionKey) + (*in).DeepCopyInto(*out) + } + if in.GuestAccelerators != nil { + in, out := &in.GuestAccelerators, &out.GuestAccelerators + *out = make([]Accelerator, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineSpec. +func (in *GCPMachineSpec) DeepCopy() *GCPMachineSpec { + if in == nil { + return nil + } + out := new(GCPMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineStatus) DeepCopyInto(out *GCPMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.InstanceStatus != nil { + in, out := &in.InstanceStatus, &out.InstanceStatus + *out = new(InstanceStatus) + **out = **in + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineStatus. +func (in *GCPMachineStatus) DeepCopy() *GCPMachineStatus { + if in == nil { + return nil + } + out := new(GCPMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineTemplate) DeepCopyInto(out *GCPMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineTemplate. +func (in *GCPMachineTemplate) DeepCopy() *GCPMachineTemplate { + if in == nil { + return nil + } + out := new(GCPMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineTemplateList) DeepCopyInto(out *GCPMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GCPMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineTemplateList. +func (in *GCPMachineTemplateList) DeepCopy() *GCPMachineTemplateList { + if in == nil { + return nil + } + out := new(GCPMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineTemplateResource) DeepCopyInto(out *GCPMachineTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineTemplateResource. +func (in *GCPMachineTemplateResource) DeepCopy() *GCPMachineTemplateResource { + if in == nil { + return nil + } + out := new(GCPMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPMachineTemplateSpec) DeepCopyInto(out *GCPMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineTemplateSpec. +func (in *GCPMachineTemplateSpec) DeepCopy() *GCPMachineTemplateSpec { + if in == nil { + return nil + } + out := new(GCPMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPShieldedInstanceConfig) DeepCopyInto(out *GCPShieldedInstanceConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPShieldedInstanceConfig. +func (in *GCPShieldedInstanceConfig) DeepCopy() *GCPShieldedInstanceConfig { + if in == nil { + return nil + } + out := new(GCPShieldedInstanceConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Labels) DeepCopyInto(out *Labels) { + { + in := &in + *out = make(Labels, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Labels. +func (in Labels) DeepCopy() Labels { + if in == nil { + return nil + } + out := new(Labels) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(string) + **out = **in + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { + *out = *in + if in.APIServerInstanceGroupTagOverride != nil { + in, out := &in.APIServerInstanceGroupTagOverride, &out.APIServerInstanceGroupTagOverride + *out = new(string) + **out = **in + } + if in.LoadBalancerType != nil { + in, out := &in.LoadBalancerType, &out.LoadBalancerType + *out = new(LoadBalancerType) + **out = **in + } + if in.InternalLoadBalancer != nil { + in, out := &in.InternalLoadBalancer, &out.InternalLoadBalancer + *out = new(LoadBalancer) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec. +func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { + if in == nil { + return nil + } + out := new(LoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedKey) DeepCopyInto(out *ManagedKey) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedKey. +func (in *ManagedKey) DeepCopy() *ManagedKey { + if in == nil { + return nil + } + out := new(ManagedKey) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetadataItem) DeepCopyInto(out *MetadataItem) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataItem. +func (in *MetadataItem) DeepCopy() *MetadataItem { + if in == nil { + return nil + } + out := new(MetadataItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Network) DeepCopyInto(out *Network) { + *out = *in + if in.SelfLink != nil { + in, out := &in.SelfLink, &out.SelfLink + *out = new(string) + **out = **in + } + if in.FirewallRules != nil { + in, out := &in.FirewallRules, &out.FirewallRules + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Router != nil { + in, out := &in.Router, &out.Router + *out = new(string) + **out = **in + } + if in.APIServerAddress != nil { + in, out := &in.APIServerAddress, &out.APIServerAddress + *out = new(string) + **out = **in + } + if in.APIServerHealthCheck != nil { + in, out := &in.APIServerHealthCheck, &out.APIServerHealthCheck + *out = new(string) + **out = **in + } + if in.APIServerInstanceGroups != nil { + in, out := &in.APIServerInstanceGroups, &out.APIServerInstanceGroups + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.APIServerBackendService != nil { + in, out := &in.APIServerBackendService, &out.APIServerBackendService + *out = new(string) + **out = **in + } + if in.APIServerTargetProxy != nil { + in, out := &in.APIServerTargetProxy, &out.APIServerTargetProxy + *out = new(string) + **out = **in + } + if in.APIServerForwardingRule != nil { + in, out := &in.APIServerForwardingRule, &out.APIServerForwardingRule + *out = new(string) + **out = **in + } + if in.APIInternalAddress != nil { + in, out := &in.APIInternalAddress, &out.APIInternalAddress + *out = new(string) + **out = **in + } + if in.APIInternalHealthCheck != nil { + in, out := &in.APIInternalHealthCheck, &out.APIInternalHealthCheck + *out = new(string) + **out = **in + } + if in.APIInternalBackendService != nil { + in, out := &in.APIInternalBackendService, &out.APIInternalBackendService + *out = new(string) + **out = **in + } + if in.APIInternalForwardingRule != nil { + in, out := &in.APIInternalForwardingRule, &out.APIInternalForwardingRule + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. +func (in *Network) DeepCopy() *Network { + if in == nil { + return nil + } + out := new(Network) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.AutoCreateSubnetworks != nil { + in, out := &in.AutoCreateSubnetworks, &out.AutoCreateSubnetworks + *out = new(bool) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LoadBalancerBackendPort != nil { + in, out := &in.LoadBalancerBackendPort, &out.LoadBalancerBackendPort + *out = new(int32) + **out = **in + } + if in.HostProject != nil { + in, out := &in.HostProject, &out.HostProject + *out = new(string) + **out = **in + } + out.Firewall = in.Firewall +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference. +func (in *ObjectReference) DeepCopy() *ObjectReference { + if in == nil { + return nil + } + out := new(ObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceManagerTag) DeepCopyInto(out *ResourceManagerTag) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceManagerTag. +func (in *ResourceManagerTag) DeepCopy() *ResourceManagerTag { + if in == nil { + return nil + } + out := new(ResourceManagerTag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ResourceManagerTags) DeepCopyInto(out *ResourceManagerTags) { + { + in := &in + *out = make(ResourceManagerTags, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceManagerTags. +func (in ResourceManagerTags) DeepCopy() ResourceManagerTags { + if in == nil { + return nil + } + out := new(ResourceManagerTags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ResourceManagerTagsMap) DeepCopyInto(out *ResourceManagerTagsMap) { + { + in := &in + *out = make(ResourceManagerTagsMap, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceManagerTagsMap. +func (in ResourceManagerTagsMap) DeepCopy() ResourceManagerTagsMap { + if in == nil { + return nil + } + out := new(ResourceManagerTagsMap) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceAccount) DeepCopyInto(out *ServiceAccount) { + *out = *in + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccount. +func (in *ServiceAccount) DeepCopy() *ServiceAccount { + if in == nil { + return nil + } + out := new(ServiceAccount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEndpoints) DeepCopyInto(out *ServiceEndpoints) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEndpoints. +func (in *ServiceEndpoints) DeepCopy() *ServiceEndpoints { + if in == nil { + return nil + } + out := new(ServiceEndpoints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.SecondaryCidrBlocks != nil { + in, out := &in.SecondaryCidrBlocks, &out.SecondaryCidrBlocks + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PrivateGoogleAccess != nil { + in, out := &in.PrivateGoogleAccess, &out.PrivateGoogleAccess + *out = new(bool) + **out = **in + } + if in.EnableFlowLogs != nil { + in, out := &in.EnableFlowLogs, &out.EnableFlowLogs + *out = new(bool) + **out = **in + } + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Subnets) DeepCopyInto(out *Subnets) { + { + in := &in + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnets. +func (in Subnets) DeepCopy() Subnets { + if in == nil { + return nil + } + out := new(Subnets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SuppliedKey) DeepCopyInto(out *SuppliedKey) { + *out = *in + if in.RawKey != nil { + in, out := &in.RawKey, &out.RawKey + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.RSAEncryptedKey != nil { + in, out := &in.RSAEncryptedKey, &out.RSAEncryptedKey + *out = make([]byte, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuppliedKey. +func (in *SuppliedKey) DeepCopy() *SuppliedKey { + if in == nil { + return nil + } + out := new(SuppliedKey) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/gcp/go.mod b/pkg/capi/gcp/go.mod new file mode 100644 index 000000000000..3177fae1e489 --- /dev/null +++ b/pkg/capi/gcp/go.mod @@ -0,0 +1,56 @@ +module sigs.k8s.io/cluster-api-provider-gcp + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/conditions_consts.go b/pkg/capi/ibmcloud/api/v1beta1/conditions_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/conditions_consts.go rename to pkg/capi/ibmcloud/api/v1beta1/conditions_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/doc.go b/pkg/capi/ibmcloud/api/v1beta1/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/doc.go rename to pkg/capi/ibmcloud/api/v1beta1/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/groupversion_info.go b/pkg/capi/ibmcloud/api/v1beta1/groupversion_info.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/groupversion_info.go rename to pkg/capi/ibmcloud/api/v1beta1/groupversion_info.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervscluster_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmpowervscluster_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervscluster_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmpowervscluster_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsimage_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsimage_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsmachine_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsmachine_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpccluster_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmvpccluster_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpccluster_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmvpccluster_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpcmachine_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachine_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpcmachine_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachine_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.go b/pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.go rename to pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/types.go b/pkg/capi/ibmcloud/api/v1beta1/types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/types.go rename to pkg/capi/ibmcloud/api/v1beta1/types.go diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/ibmcloud/api/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.deepcopy.go rename to pkg/capi/ibmcloud/api/v1beta1/zz_generated.deepcopy.go index 134be0c1d667..b811318b6e2e 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.deepcopy.go +++ b/pkg/capi/ibmcloud/api/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/capi/ibmcloud/api/v1beta2/conditions_consts.go b/pkg/capi/ibmcloud/api/v1beta2/conditions_consts.go new file mode 100644 index 000000000000..7777739d0e93 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/conditions_consts.go @@ -0,0 +1,380 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// IBMPowerVSMachine's InstanceReady condition and corresponding reasons that will be used in v1Beta2 API version. +const ( + // IBMPowerVSMachineReadyV1Beta2Condition is true if the IBMPowerVSMachine's deletionTimestamp is not set, IBMPowerVSMachine's + // IBMPowerVSMachineInstanceReadyV1Beta2Condition is true. + IBMPowerVSMachineReadyV1Beta2Condition = clusterv1beta1.ReadyV1Beta2Condition + + // IBMPowerVSMachineReadyV1Beta2Reason surfaces when the IBMPowerVSMachine readiness criteria is met. + IBMPowerVSMachineReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // IBMPowerVSMachineNotReadyV1Beta2Reason surfaces when the IBMPowerVSMachine readiness criteria is not met. + IBMPowerVSMachineNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // IBMPowerVSMachineReadyUnknownV1Beta2Reason surfaces when at least one IBMPowerVSMachine readiness criteria is unknown + // and no IBMPowerVSMachine readiness criteria is not met. + IBMPowerVSMachineReadyUnknownV1Beta2Reason = clusterv1beta1.ReadyUnknownV1Beta2Reason +) + +const ( + // IBMVPCMachineReadyV1Beta2Condition is true if the IBMVPCMachine's deletionTimestamp is not set, IBMVPCMachine's + // IBMVPCMachineInstanceReadyV1Beta2Condition is true. + IBMVPCMachineReadyV1Beta2Condition = clusterv1beta1.ReadyV1Beta2Condition + + // IBMVPCMachineReadyV1Beta2Reason surfaces when the IBMVPCMachine readiness criteria is met. + IBMVPCMachineReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // IBMVPCMachineNotReadyV1Beta2Reason surfaces when the IBMVPCMachine readiness criteria is not met. + IBMVPCMachineNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // IBMVPCMachineReadyUnknownV1Beta2Reason surfaces when at least one IBMVPCMachine readiness criteria is unknown. + IBMVPCMachineReadyUnknownV1Beta2Reason = clusterv1beta1.ReadyUnknownV1Beta2Reason +) + +// IBMVPCMachine's InstanceReady condition and corresponding reasons that will be used in v1Beta2 API version. +const ( + // IBMVPCMachineInstanceReadyV1Beta2Condition documents the status of the instance that is controlled + // by the IBMVPCMachine. + IBMVPCMachineInstanceReadyV1Beta2Condition = "InstanceReady" + + // IBMVPCMachineInstanceReadyV1Beta2Reason surfaces when the instance that is controlled + // by the IBMVPCMachine is ready. + IBMVPCMachineInstanceReadyV1Beta2Reason = "InstanceReady" + + // IBMVPCMachineInstanceNotReadyV1Beta2Reason surfaces when the instance that is controlled + // by the IBMVPCMachine is not ready. + IBMVPCMachineInstanceNotReadyV1Beta2Reason = "InstanceNotReady" +) +const ( + // IBMPowerVSMachineInstanceReadyV1Beta2Condition documents the status of the instance that is controlled + // by the IBMPowerVSMachine. + IBMPowerVSMachineInstanceReadyV1Beta2Condition = "InstanceReady" + + // IBMPowerVSMachineInstanceReadyV1Beta2Reason surfaces when the instance that is controlled + // by the IBMPowerVSMachine is ready. + IBMPowerVSMachineInstanceReadyV1Beta2Reason = "InstanceReady" + + // IBMPowerVSMachineInstanceNotReadyV1Beta2Reason surfaces when the instance that is controlled + // by the IBMPowerVSMachine is not ready. + IBMPowerVSMachineInstanceNotReadyV1Beta2Reason = "InstanceNotReady" + + // IBMPowerVSMachineInstanceWaitingForClusterInfrastructureReadyV1Beta2Reason documents the virtual machine that is controller by + // IBMPowerVSMachine waiting for the cluster infrastructure to be ready. + // TODO: Use when CAPI version is updated: IBMPowerVSMachineInstanceWaitingForClusterInfrastructureReadyV1Beta2Reason = clusterv1beta1.WaitingForClusterInfrastructureReadyV1Beta2Reason. + IBMPowerVSMachineInstanceWaitingForClusterInfrastructureReadyV1Beta2Reason = "WaitingForClusterInfrastructureReady" + + // IBMPowerVSMachineInstanceWaitingForControlPlaneInitializedV1Beta2Reason documents the virtual machine that is controller by IBMPowerVSMachine waiting + // for the control plane to be initialized. + // TODO: Use when CAPI version is updated: IBMPowerVSMachineInstanceWaitingForControlPlaneInitializedV1Beta2Reason = clusterv1beta1.WaitingForControlPlaneInitializedV1Beta2Reason. + IBMPowerVSMachineInstanceWaitingForControlPlaneInitializedV1Beta2Reason = "WaitingForControlPlaneInitialized" + + // IBMPowerVSMachineInstanceWaitingForBootstrapDataV1Beta2Reason documents the virtual machine that is controller by IBMPowerVSMachine waiting for the bootstrap + // data to be ready. + // TODO: Use when CAPI version is updated: IBMPowerVSMachineInstanceWaitingForBootstrapDataV1Beta2Reason = clusterv1beta1.WaitingForBootstrapDataV1Beta2Reason. + IBMPowerVSMachineInstanceWaitingForBootstrapDataV1Beta2Reason = "WaitingForBootstrapData" + + // IBMPowerVSMachineInstanceDeletingV1Beta2Reason surfaces when the virtual machine controller by IBMPowerVSMachine is deleting. + IBMPowerVSMachineInstanceDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // IBMPowerVSMachineInstanceLoadBalancerConfigurationFailedV1Beta2Reason surfaces when configuring the virtual machine IP to load balancer fails. + IBMPowerVSMachineInstanceLoadBalancerConfigurationFailedV1Beta2Reason = "LoadBalancerConfigurationFailed" + + // IBMPowerVSMachineInstanceWaitingForNetworkAddressV1Beta2Reason surfaces when the PowerVS instance that is controlled + // by the IBMPowerVSMachine waiting for the machine network settings to be reported after machine being powered on. + IBMPowerVSMachineInstanceWaitingForNetworkAddressV1Beta2Reason = "WaitingForNetworkAddress" +) + +const ( + // InstanceProvisionFailedReason used for failures during instance provisioning. + InstanceProvisionFailedReason = "InstanceProvisionFailed" + // WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + // WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" +) + +const ( + // InstanceStoppedReason instance is in a stopped state. + InstanceStoppedReason = "InstanceStopped" + + // InstanceErroredReason instance is in a errored state. + InstanceErroredReason = "InstanceErrored" + + // InstanceNotReadyReason used when the instance is in a not ready state. + InstanceNotReadyReason = "InstanceNotReady" + + // InstanceDeletingReason is used when the instance is in deleting state. + InstanceDeletingReason = "InstanceDeleting" + + // InstanceStateUnknownReason used when the instance is in a unknown state. + InstanceStateUnknownReason = "InstanceStateUnknown" +) + +const ( + // InstanceReadyCondition reports on current status of the instance. Ready indicates the instance is in a Running state. + InstanceReadyCondition clusterv1beta1.ConditionType = "InstanceReady" +) + +const ( + // WaitingForIBMPowerVSImageReason used when machine is waiting for powervs image to be ready before proceeding. + WaitingForIBMPowerVSImageReason = "WaitingForIBMPowerVSImage" +) + +const ( + // ImageNotReadyReason used when the image is not ready. + ImageNotReadyReason = "ImageNotReady" + + // ImageImportFailedReason used when the image import is failed. + ImageImportFailedReason = "ImageImportFailed" + + // ImageReconciliationFailedReason used when an error occurs during VPC Custom Image reconciliation. + ImageReconciliationFailedReason = "ImageReconciliationFailed" + + // ImageQueuedReason used when the image is in queued state. + ImageQueuedReason = "ImageQueued" +) + +const ( + // ImageReadyCondition reports on current status of the image. Ready indicates the image is in a active state. + ImageReadyCondition clusterv1beta1.ConditionType = "ImageReady" + + // ImageImportedCondition reports on current status of the image import job. Ready indicates the import job is finished. + ImageImportedCondition clusterv1beta1.ConditionType = "ImageImported" + + // IBMPowerVSImageDeletingV1Beta2Reason surfaces when the image is in deleting state. + IBMPowerVSImageDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason +) + +const ( + // LoadBalancerNotReadyReason used when cluster is waiting for load balancer to be ready before proceeding. + LoadBalancerNotReadyReason = "LoadBalancerNotReady" +) + +const ( + // ServiceInstanceReadyCondition reports on the successful reconciliation of a Power VS workspace. + ServiceInstanceReadyCondition clusterv1beta1.ConditionType = "ServiceInstanceReady" + // ServiceInstanceReconciliationFailedReason used when an error occurs during workspace reconciliation. + ServiceInstanceReconciliationFailedReason = "ServiceInstanceReconciliationFailed" + + // NetworkReadyCondition reports on the successful reconciliation of a Power VS network. + NetworkReadyCondition clusterv1beta1.ConditionType = "NetworkReady" + // NetworkReconciliationFailedReason used when an error occurs during network reconciliation. + NetworkReconciliationFailedReason = "NetworkReconciliationFailed" + + // VPCSecurityGroupReadyCondition reports on the successful reconciliation of a VPC. + VPCSecurityGroupReadyCondition clusterv1beta1.ConditionType = "VPCSecurityGroupReady" + // VPCSecurityGroupReconciliationFailedReason used when an error occurs during VPC reconciliation. + VPCSecurityGroupReconciliationFailedReason = "VPCSecurityGroupReconciliationFailed" + + // VPCReadyCondition reports on the successful reconciliation of a VPC. + VPCReadyCondition clusterv1beta1.ConditionType = "VPCReady" + // VPCReconciliationFailedReason used when an error occurs during VPC reconciliation. + VPCReconciliationFailedReason = "VPCReconciliationFailed" + + // VPCSubnetReadyCondition reports on the successful reconciliation of a VPC subnet. + VPCSubnetReadyCondition clusterv1beta1.ConditionType = "VPCSubnetReady" + // VPCSubnetReconciliationFailedReason used when an error occurs during VPC subnet reconciliation. + VPCSubnetReconciliationFailedReason = "VPCSubnetReconciliationFailed" + + // TransitGatewayReadyCondition reports on the successful reconciliation of a Power VS transit gateway. + TransitGatewayReadyCondition clusterv1beta1.ConditionType = "TransitGatewayReady" + // TransitGatewayReconciliationFailedReason used when an error occurs during transit gateway reconciliation. + TransitGatewayReconciliationFailedReason = "TransitGatewayReconciliationFailed" + + // LoadBalancerReadyCondition reports on the successful reconciliation of a Power VS network. + LoadBalancerReadyCondition clusterv1beta1.ConditionType = "LoadBalancerReady" + // LoadBalancerReconciliationFailedReason used when an error occurs during loadbalancer reconciliation. + LoadBalancerReconciliationFailedReason = "LoadBalancerReconciliationFailed" + + // COSInstanceReadyCondition reports on the successful reconciliation of a COS instance. + COSInstanceReadyCondition clusterv1beta1.ConditionType = "COSInstanceCreated" + // COSInstanceReconciliationFailedReason used when an error occurs during COS instance reconciliation. + COSInstanceReconciliationFailedReason = "COSInstanceCreationFailed" +) + +const ( + // CreateInfrastructureAnnotation is the name of an annotation that indicates if + // Power VS infrastructure should be created as a part of cluster creation. + CreateInfrastructureAnnotation = "powervs.cluster.x-k8s.io/create-infra" +) + +// IBMPowerVSCluster's Ready condition and corresponding reasons that will be used in v1Beta2 API version. +const ( + // IBMPowerVSClusterReadyV1Beta2Condition is true if the IBMPowerVSCluster's deletionTimestamp is not set, IBMPowerVSCluster's + // FailureDomainsReady, VCenterAvailable and ClusterModulesReady conditions are true. + IBMPowerVSClusterReadyV1Beta2Condition = clusterv1beta1.ReadyV1Beta2Condition + + // IBMPowerVSClusterReadyV1Beta2Reason surfaces when the IBMPowerVSCluster readiness criteria is met. + IBMPowerVSClusterReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // IBMPowerVSClusterNotReadyV1Beta2Reason surfaces when the IBMPowerVSCluster readiness criteria is not met. + IBMPowerVSClusterNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // IBMPowerVSClusterReadyUnknownV1Beta2Reason surfaces when at least one of the IBMPowerVSCluster readiness criteria is unknown + // and none of the IBMPowerVSCluster readiness criteria is met. + IBMPowerVSClusterReadyUnknownV1Beta2Reason = clusterv1beta1.ReadyUnknownV1Beta2Reason +) + +// IBMVPCCluster's Ready condition and corresponding reasons that will be used in v1Beta2 API version. +const ( + // IBMVPCClusterReadyV1Beta2Condition is true if the IBMVPCCluster's deletionTimestamp is not set and IBMVPCCluster's + // conditions are true. + IBMVPCClusterReadyV1Beta2Condition = clusterv1beta1.ReadyV1Beta2Condition + + // IBMVPCClusterReadyV1Beta2Reason surfaces when the IBMVPCCluster readiness criteria is met. + IBMVPCClusterReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // IBMVPCClusterNotReadyV1Beta2Reason surfaces when the IBMVPCCluster readiness criteria is not met. + IBMVPCClusterNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // IBMVPCClusterReadyUnknownV1Beta2Reason surfaces when at least one of the IBMVPCCluster readiness criteria is unknown + // and none of the IBMVPCCluster readiness criteria is met. + IBMVPCClusterReadyUnknownV1Beta2Reason = clusterv1beta1.ReadyUnknownV1Beta2Reason +) + +const ( + // WorkspaceReadyV1Beta2Condition reports on the successful reconciliation of a PowerVS workspace. + WorkspaceReadyV1Beta2Condition = "WorkspaceReady" + + // WorkspaceReadyV1Beta2Reason surfaces when the PowerVS workspace is ready. + WorkspaceReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // WorkspaceNotReadyV1Beta2Reason surfaces when PowerVS workspace is not ready. + WorkspaceNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // WorkspaceDeletingV1Beta2Reason surfaces when the PowerVS workspace is being deleted. + WorkspaceDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // NetworkReadyV1Beta2Condition reports on the successful reconciliation of a PowerVS network. + NetworkReadyV1Beta2Condition = "NetworkReady" + + // NetworkReadyV1Beta2Reason surfaces when PowerVS workspace is ready. + NetworkReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // NetworkNotReadyV1Beta2Reason surfaces when the PowerVS network is not ready. + NetworkNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // NetworkDeletingV1Beta2Reason surfaces when the PowerVS network is being deleted. + NetworkDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // VPCReadyV1Beta2Condition reports on the successful reconciliation of a VPC. + VPCReadyV1Beta2Condition = "VPCReady" + + // VPCReadyV1Beta2Reason surfaces when the VPC is ready. + VPCReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // VPCNotReadyV1Beta2Reason surfaces when VPC is not ready. + VPCNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // VPCDeletingV1Beta2Reason surfaces when the VPC is being deleted. + VPCDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // VPCSubnetReadyV1Beta2Condition reports on the successful reconciliation of a VPC subnet. + VPCSubnetReadyV1Beta2Condition = "VPCSubnetReady" + + // VPCSubnetReadyV1Beta2Reason surfaces when the VPC subnet is ready. + VPCSubnetReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // VPCSubnetNotReadyV1Beta2Reason surfaces when VPC subnet is not ready. + VPCSubnetNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // VPCSubnetDeletingV1Beta2Reason surfaces when the VPC subnet is being deleted. + VPCSubnetDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // VPCSecurityGroupReadyV1Beta2Condition reports on the successful reconciliation of a VPC Security Group. + VPCSecurityGroupReadyV1Beta2Condition = "VPCSecurityGroupReady" + + // VPCSecurityGroupReadyV1Beta2Reason surfaces when the VPC security group is ready. + VPCSecurityGroupReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // VPCSecurityGroupNotReadyV1Beta2Reason surfaces when VPC security group is not ready. + VPCSecurityGroupNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // VPCSecurityGroupDeletingV1Beta2Reason surfaces when the VPC security group is being deleted. + VPCSecurityGroupDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // TransitGatewayReadyV1Beta2Condition reports on the successful reconciliation of a transit gateway. + TransitGatewayReadyV1Beta2Condition = "TransitGatewayReady" + + // TransitGatewayReadyV1Beta2Reason surfaces when the transit gateway is ready. + TransitGatewayReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // TransitGatewayNotReadyV1Beta2Reason surfaces when the transit gateway is not ready. + TransitGatewayNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // TransitGatewayDeletingV1Beta2Reason surfaces when the transit gateway is being deleted. + TransitGatewayDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // VPCLoadBalancerReadyV1Beta2Condition reports on the successful reconciliation of a VPC LoadBalancer. + VPCLoadBalancerReadyV1Beta2Condition = "LoadBalancerReady" + + // VPCLoadBalancerReadyV1Beta2Reason surfaces when the VPC LoadBalancer is ready. + VPCLoadBalancerReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // VPCLoadBalancerNotReadyV1Beta2Reason surfaces when VPC LoadBalancer is not ready. + VPCLoadBalancerNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // VPCLoadBalancerDeletingV1Beta2Reason surfaces when the VPC LoadBalancer is being deleted. + VPCLoadBalancerDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason + + // VPCImageReadyV1Beta2Condition reports on the successful reconciliation of a VPC custom image. + VPCImageReadyV1Beta2Condition = "VPCImageReady" + + // VPCImageReadyV1Beta2Reason surfaces when the VPC custom image is ready. + VPCImageReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // VPCImageNotReadyV1Beta2Reason surfaces when the VPC custom image is not ready. + VPCImageNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // COSInstanceReadyV1Beta2Condition reports on the successful reconciliation of a COS instance. + COSInstanceReadyV1Beta2Condition = "COSInstanceReady" + + // COSInstanceReadyV1Beta2Reason surfaces when the COS instance is ready. + COSInstanceReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // COSInstanceNotReadyV1Beta2Reason surfaces when the COS instance is not ready. + COSInstanceNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // COSInstanceDeletingV1Beta2Reason surfaces when the COS instance is being deleted. + COSInstanceDeletingV1Beta2Reason = clusterv1beta1.DeletingV1Beta2Reason +) + +// IBMPowerVSImage's Ready condition and corresponding reasons that will be used in v1Beta2 API version. +const ( + // IBMPowerVSImageReadyCondition is true if the IBMPowerVSImage's deletionTimestamp is not set, IBMPowerVSImage's IBMPowerVSImageReadyV1Beta2Condition is true. + IBMPowerVSImageReadyCondition = clusterv1beta1.ReadyV1Beta2Condition + + // IBMPowerVSImageReadyV1Beta2Condition documents the Ready status of the image. + IBMPowerVSImageReadyV1Beta2Condition = "ImageReady" + + // IBMPowerVSImageReadyV1Beta2Reason surfaces when the IBMPowerVSImage readiness criteria is met. + IBMPowerVSImageReadyV1Beta2Reason = clusterv1beta1.ReadyV1Beta2Reason + + // IBMPowerVSImageNotReadyV1Beta2Reason surfaces when the IBMPowerVSImage readiness criteria is not met. + IBMPowerVSImageNotReadyV1Beta2Reason = clusterv1beta1.NotReadyV1Beta2Reason + + // IBMPowerVSImageReadyUnknownV1Beta2Reason surfaces when at least one of the IBMPowerVSImage readiness criteria is unknown + // and none of the IBMPowerVSImage readiness criteria is met. + IBMPowerVSImageReadyUnknownV1Beta2Reason = clusterv1beta1.ReadyUnknownV1Beta2Reason +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_conversion.go b/pkg/capi/ibmcloud/api/v1beta2/doc.go similarity index 74% rename from vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_conversion.go rename to pkg/capi/ibmcloud/api/v1beta2/doc.go index 167ce626befd..6b05887ac83d 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_conversion.go +++ b/pkg/capi/ibmcloud/api/v1beta2/doc.go @@ -14,10 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 - -// Hub marks AzureCluster as a conversion hub. -func (*AzureClusterTemplate) Hub() {} - -// Hub marks AzureClusterList as a conversion hub. -func (*AzureClusterTemplateList) Hub() {} +// Package v1beta2 contains the v1beta2 API implementation. +package v1beta2 diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/groupversion_info.go b/pkg/capi/ibmcloud/api/v1beta2/groupversion_info.go similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/groupversion_info.go rename to pkg/capi/ibmcloud/api/v1beta2/groupversion_info.go index dffa6182d066..0e19a408dda1 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/groupversion_info.go +++ b/pkg/capi/ibmcloud/api/v1beta2/groupversion_info.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,20 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha3 contains API Schema definitions for the clusterctl v1alpha3 API group +// Package v1beta2 contains API Schema definitions for the infrastructure v1beta2 API group. // +kubebuilder:object:generate=true -// +groupName=clusterctl.cluster.x-k8s.io -package v1alpha3 +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) var ( // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "clusterctl.cluster.x-k8s.io", Version: "v1alpha3"} + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta2"} // schemeBuilder is used to add go types to the GroupVersionKind scheme. schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.go new file mode 100644 index 000000000000..bebd4d516bca --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.go @@ -0,0 +1,373 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +const ( + // IBMPowerVSClusterFinalizer allows IBMPowerVSClusterReconciler to clean up resources associated with IBMPowerVSCluster before + // removing it from the apiserver. + IBMPowerVSClusterFinalizer = "ibmpowervscluster.infrastructure.cluster.x-k8s.io" +) + +// IBMPowerVSClusterSpec defines the desired state of IBMPowerVSCluster. +type IBMPowerVSClusterSpec struct { + // ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed. + // Deprecated: use ServiceInstance instead + ServiceInstanceID string `json:"serviceInstanceID"` + + // Network is the reference to the Network to use for this cluster. + // when the field is omitted, A DHCP service will be created in the Power VS workspace and its private network will be used. + // the DHCP service created network will have the following name format + // 1. in the case of DHCPServer.Name is not set the name will be DHCPSERVER_Private. + // 2. if DHCPServer.Name is set the name will be DHCPSERVER_Private. + // when Network.ID is set, its expected that there exist a network in PowerVS workspace with id or else system will give error. + // when Network.Name is set, system will first check for network with Name in PowerVS workspace, if not exist system will check DHCP network with given Network.name, if that also not exist, it will create a new DHCP service and name will be DHCPSERVER_Private. + // Network.RegEx is not yet supported and system will ignore the value. + Network IBMPowerVSResourceReference `json:"network"` + + // dhcpServer is contains the configuration to be used while creating a new DHCP server in PowerVS workspace. + // when the field is omitted, CLUSTER_NAME will be used as DHCPServer.Name and DHCP server will be created. + // it will automatically create network with name DHCPSERVER_Private in PowerVS workspace. + // +optional + DHCPServer *DHCPServer `json:"dhcpServer,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` + + // serviceInstance is the reference to the Power VS server workspace on which the server instance(VM) will be created. + // Power VS server workspace is a container for all Power VS instances at a specific geographic region. + // serviceInstance can be created via IBM Cloud catalog or CLI. + // supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. + // More detail about Power VS service instance. + // https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server + // when omitted system will dynamically create the service instance with name CLUSTER_NAME-serviceInstance. + // when ServiceInstance.ID is set, its expected that there exist a service instance in PowerVS workspace with id or else system will give error. + // when ServiceInstance.Name is set, system will first check for service instance with Name in PowerVS workspace, if not exist system will create new instance. + // if there are more than one service instance exist with the ServiceInstance.Name in given Zone, installation fails with an error. Use ServiceInstance.ID in those situations to use the specific service instance. + // ServiceInstance.Regex is not yet supported not yet supported and system will ignore the value. + // +optional + ServiceInstance *IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` + + // zone is the name of Power VS zone where the cluster will be created + // possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server. + // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource, + // 1. it is expected to set the zone, not setting will result in webhook error. + // 2. the zone should have PER capabilities, or else system will give error. + // +optional + Zone *string `json:"zone,omitempty"` + + // resourceGroup name under which the resources will be created. + // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource, + // 1. it is expected to set the ResourceGroup.Name, not setting will result in webhook error. + // ResourceGroup.ID and ResourceGroup.Regex is not yet supported and system will ignore the value. + // +optional + ResourceGroup *IBMPowerVSResourceReference `json:"resourceGroup,omitempty"` + + // vpc contains information about IBM Cloud VPC resources. + // when omitted system will dynamically create the VPC with name CLUSTER_NAME-vpc. + // when VPC.ID is set, its expected that there exist a VPC with ID or else system will give error. + // when VPC.Name is set, system will first check for VPC with Name, if not exist system will create new VPC. + // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource, + // 1. it is expected to set the VPC.Region, not setting will result in webhook error. + // +optional + VPC *VPCResourceReference `json:"vpc,omitempty"` + + // vpcSubnets contains information about IBM Cloud VPC Subnet resources. + // when omitted system will create the subnets in all the zone corresponding to VPC.Region, with name CLUSTER_NAME-vpcsubnet-ZONE_NAME. + // possible values can be found here https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server. + // when VPCSubnets[].ID is set, its expected that there exist a subnet with ID or else system will give error. + // when VPCSubnets[].Zone is not set, a random zone is picked from available zones of VPC.Region. + // when VPCSubnets[].Name is not set, system will set name as CLUSTER_NAME-vpcsubnet-INDEX. + // if subnet with name VPCSubnets[].Name not found, system will create new subnet in VPCSubnets[].Zone. + // +optional + VPCSubnets []Subnet `json:"vpcSubnets,omitempty"` + + // VPCSecurityGroups to attach it to the VPC resource + // +optional + VPCSecurityGroups []VPCSecurityGroup `json:"vpcSecurityGroups,omitempty"` + + // transitGateway contains information about IBM Cloud TransitGateway + // IBM Cloud TransitGateway helps in establishing network connectivity between IBM Cloud Power VS and VPC infrastructure + // more information about TransitGateway can be found here https://www.ibm.com/products/transit-gateway. + // when TransitGateway.ID is set, its expected that there exist a TransitGateway with ID or else system will give error. + // when TransitGateway.Name is set, system will first check for TransitGateway with Name, if not exist system will create new TransitGateway. + // +optional + TransitGateway *TransitGateway `json:"transitGateway,omitempty"` + + // loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes. + // when omitted system will create a default public loadbalancer with name CLUSTER_NAME-loadbalancer. + // when specified a vpc loadbalancer will be created and controlPlaneEndpoint will be set with associated hostname of loadbalancer. + // ControlPlaneEndpoint will be set with associated hostname of public loadbalancer. + // when LoadBalancers[].ID is set, its expected that there exist a loadbalancer with ID or else system will give error. + // when LoadBalancers[].Name is set, system will first check for loadbalancer with Name, if not exist system will create new loadbalancer. + // For each loadbalancer a default backed pool and front listener will be configured with port 6443. + // +optional + LoadBalancers []VPCLoadBalancerSpec `json:"loadBalancers,omitempty"` + + // cosInstance contains options to configure a supporting IBM Cloud COS bucket for this + // cluster - currently used for nodes requiring Ignition + // (https://coreos.github.io/ignition/) for bootstrapping (requires + // BootstrapFormatIgnition feature flag to be enabled). + // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource and Ignition is set, then + // 1. CosInstance.Name should be set not setting will result in webhook error. + // 2. CosInstance.BucketName should be set not setting will result in webhook error. + // 3. CosInstance.BucketRegion should be set not setting will result in webhook error. + // +optional + CosInstance *CosInstance `json:"cosInstance,omitempty"` + + // Ignition defined options related to the bootstrapping systems where Ignition is used. + // +optional + Ignition *Ignition `json:"ignition,omitempty"` +} + +// Ignition defines options related to the bootstrapping systems where Ignition is used. +type Ignition struct { + // Version defines which version of Ignition will be used to generate bootstrap data. + // + // +optional + // +kubebuilder:default="2.3" + // +kubebuilder:validation:Enum="2.3";"2.4";"3.0";"3.1";"3.2";"3.3";"3.4" + Version string `json:"version,omitempty"` +} + +// DHCPServer contains the DHCP server configurations. +type DHCPServer struct { + // Optional cidr for DHCP private network + Cidr *string `json:"cidr,omitempty"` + + // Optional DNS Server for DHCP service + // +kubebuilder:default="1.1.1.1" + DNSServer *string `json:"dnsServer,omitempty"` + + // Optional name of DHCP Service. Only alphanumeric characters and dashes are allowed. + Name *string `json:"name,omitempty"` + + // Optional id of the existing DHCPServer + ID *string `json:"id,omitempty"` + + // Optional indicates if SNAT will be enabled for DHCP service + // +kubebuilder:default=true + Snat *bool `json:"snat,omitempty"` +} + +// ResourceReference identifies a resource with id. +type ResourceReference struct { + // id represents the id of the resource. + ID *string `json:"id,omitempty"` + // +kubebuilder:default=false + // controllerCreated indicates whether the resource is created by the controller. + ControllerCreated *bool `json:"controllerCreated,omitempty"` +} + +// TransitGatewayStatus defines the status of transit gateway as well as it's connection's status. +type TransitGatewayStatus struct { + // id represents the id of the resource. + ID *string `json:"id,omitempty"` + // +kubebuilder:default=false + // controllerCreated indicates whether the resource is created by the controller. + ControllerCreated *bool `json:"controllerCreated,omitempty"` + // vpcConnection defines the vpc connection status in transit gateway. + VPCConnection *ResourceReference `json:"vpcConnection,omitempty"` + // powerVSConnection defines the powervs connection status in transit gateway. + PowerVSConnection *ResourceReference `json:"powerVSConnection,omitempty"` +} + +// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster. +type IBMPowerVSClusterStatus struct { + // ready is true when the provider resource is ready. + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // ResourceGroup is the reference to the Power VS resource group under which the resources will be created. + ResourceGroup *ResourceReference `json:"resourceGroupID,omitempty"` + + // serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. + ServiceInstance *ResourceReference `json:"serviceInstance,omitempty"` + + // networkID is the reference to the Power VS network to use for this cluster. + Network *ResourceReference `json:"network,omitempty"` + + // dhcpServer is the reference to the Power VS DHCP server. + DHCPServer *ResourceReference `json:"dhcpServer,omitempty"` + + // vpc is reference to IBM Cloud VPC resources. + VPC *ResourceReference `json:"vpc,omitempty"` + + // vpcSubnet is reference to IBM Cloud VPC subnet. + VPCSubnet map[string]ResourceReference `json:"vpcSubnet,omitempty"` + + // vpcSecurityGroups is reference to IBM Cloud VPC security group. + VPCSecurityGroups map[string]VPCSecurityGroupStatus `json:"vpcSecurityGroups,omitempty"` + + // transitGateway is reference to IBM Cloud TransitGateway. + TransitGateway *TransitGatewayStatus `json:"transitGateway,omitempty"` + + // cosInstance is reference to IBM Cloud COS Instance resource. + COSInstance *ResourceReference `json:"cosInstance,omitempty"` + + // loadBalancers reference to IBM Cloud VPC Loadbalancer. + LoadBalancers map[string]VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` + + // Conditions defines current service state of the IBMPowerVSCluster. + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // v1beta2 groups all the fields that will be added or modified in IBMPowerVSCluster's status with the V1Beta2 version. + // +optional + V1Beta2 *IBMPowerVSClusterV1Beta2Status `json:"v1beta2,omitempty"` +} + +// IBMPowerVSClusterV1Beta2Status groups all the fields that will be added or modified in IBMPowerVSCluster with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IBMPowerVSClusterV1Beta2Status struct { + // conditions represents the observations of a DevCluster's current state. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this IBMPowerVSCluster belongs" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IBMPowerVSCluster" +// +kubebuilder:printcolumn:name="PowerVS Cloud Instance ID",type="string",priority=1,JSONPath=".spec.serviceInstanceID" +// +kubebuilder:printcolumn:name="Endpoint",type="string",priority=1,JSONPath=".spec.controlPlaneEndpoint.host",description="Control Plane Endpoint" +// +kubebuilder:printcolumn:name="Port",type="string",priority=1,JSONPath=".spec.controlPlaneEndpoint.port",description="Control Plane Port" + +// IBMPowerVSCluster is the Schema for the ibmpowervsclusters API. +type IBMPowerVSCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMPowerVSClusterSpec `json:"spec,omitempty"` + Status IBMPowerVSClusterStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMPowerVSClusterList contains a list of IBMPowerVSCluster. +type IBMPowerVSClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMPowerVSCluster `json:"items"` +} + +// TransitGateway holds the TransitGateway information. +type TransitGateway struct { + // name of resource. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-zA-Z]|[a-zA-Z][-_a-zA-Z0-9]*[a-zA-Z0-9])$` + // +optional + Name *string `json:"name,omitempty"` + // id of resource. + // +optional + ID *string `json:"id,omitempty"` + // globalRouting indicates whether to set global routing true or not while creating the transit gateway. + // set this field to true only when PowerVS and VPC are from different regions, if they are same it's suggested to use local routing by setting the field to false. + // when the field is omitted, based on PowerVS region (region associated with IBMPowerVSCluster.Spec.Zone) and VPC region(IBMPowerVSCluster.Spec.VPC.Region) system will decide whether to enable globalRouting or not. + // +optional + GlobalRouting *bool `json:"globalRouting,omitempty"` +} + +// VPCResourceReference is a reference to a specific VPC resource by ID or Name +// Only one of ID or Name may be specified. Specifying more than one will result in +// a validation error. +type VPCResourceReference struct { + // id of resource. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=64 + // +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$` + // +optional + ID *string `json:"id,omitempty"` + + // name of resource. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + // +optional + Name *string `json:"name,omitempty"` + + // region of IBM Cloud VPC. + // when powervs.cluster.x-k8s.io/create-infra=true annotation is set on IBMPowerVSCluster resource, + // it is expected to set the region, not setting will result in webhook error. + Region *string `json:"region,omitempty"` +} + +// CosInstance represents IBM Cloud COS instance. +type CosInstance struct { + // name defines name of IBM cloud COS instance to be created. + // when IBMPowerVSCluster.Ignition is set + // +kubebuilder:validation:MinLength:=3 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$` + Name string `json:"name,omitempty"` + + // bucketName is IBM cloud COS bucket name + BucketName string `json:"bucketName,omitempty"` + + // bucketRegion is IBM cloud COS bucket region + BucketRegion string `json:"bucketRegion,omitempty"` +} + +// GetConditions returns the observations of the operational state of the IBMPowerVSCluster resource. +func (r *IBMPowerVSCluster) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the IBMPowerVSCluster to the predescribed clusterv1beta1.Conditions. +func (r *IBMPowerVSCluster) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// GetV1Beta2Conditions returns the set of conditions for this object. +func (r *IBMPowerVSCluster) GetV1Beta2Conditions() []metav1.Condition { + if r.Status.V1Beta2 == nil { + return nil + } + return r.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for an API object. +func (r *IBMPowerVSCluster) SetV1Beta2Conditions(conditions []metav1.Condition) { + if r.Status.V1Beta2 == nil { + r.Status.V1Beta2 = &IBMPowerVSClusterV1Beta2Status{} + } + r.Status.V1Beta2.Conditions = conditions +} + +// Set sets the details of the resource. +func (rf *ResourceReference) Set(resource ResourceReference) { + rf.ID = resource.ID + if !*rf.ControllerCreated { + rf.ControllerCreated = resource.ControllerCreated + } +} + +func init() { + objectTypes = append(objectTypes, &IBMPowerVSCluster{}, &IBMPowerVSClusterList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.go new file mode 100644 index 000000000000..b1b375a1f2f5 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.go @@ -0,0 +1,63 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// IBMPowerVSClusterTemplateSpec defines the desired state of IBMPowerVSClusterTemplate. +type IBMPowerVSClusterTemplateSpec struct { + Template IBMPowerVSClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +//+kubebuilder:storageversion +// +kubebuilder:resource:path=ibmpowervsclustertemplates,scope=Namespaced,categories=cluster-api,shortName=ibmpowervsct +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IBMPowerVSClusterTemplate" + +// IBMPowerVSClusterTemplate is the schema for IBM Power VS Kubernetes Cluster Templates. +type IBMPowerVSClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMPowerVSClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMPowerVSClusterTemplateList contains a list of IBMPowerVSClusterTemplate. +type IBMPowerVSClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMPowerVSClusterTemplate `json:"items"` +} + +// IBMPowerVSClusterTemplateResource describes the data needed to create an IBMPowerVSCluster from a template. +type IBMPowerVSClusterTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + Spec IBMPowerVSClusterSpec `json:"spec"` +} + +func init() { + objectTypes = append(objectTypes, &IBMPowerVSClusterTemplate{}, &IBMPowerVSClusterTemplateList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.go new file mode 100644 index 000000000000..2cd33c8e3567 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.go @@ -0,0 +1,166 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +const ( + // IBMPowerVSImageFinalizer allows IBMPowerVSImageReconciler to clean up resources associated with IBMPowerVSImage before + // removing it from the apiserver. + IBMPowerVSImageFinalizer = "ibmpowervsimage.infrastructure.cluster.x-k8s.io" +) + +// IBMPowerVSImageSpec defines the desired state of IBMPowerVSImage. +type IBMPowerVSImageSpec struct { + + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // ServiceInstanceID is the id of the power cloud instance where the image will get imported. + // Deprecated: use ServiceInstance instead + ServiceInstanceID string `json:"serviceInstanceID"` + + // serviceInstance is the reference to the Power VS workspace on which the server instance(VM) will be created. + // Power VS workspace is a container for all Power VS instances at a specific geographic region. + // serviceInstance can be created via IBM Cloud catalog or CLI. + // supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. + // More detail about Power VS service instance. + // https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server + // when omitted system will dynamically create the service instance + // +optional + ServiceInstance *IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` + + // Cloud Object Storage bucket name; bucket-name[/optional/folder] + Bucket *string `json:"bucket"` + + // Cloud Object Storage image filename. + Object *string `json:"object"` + + // Cloud Object Storage region. + Region *string `json:"region"` + + // Type of storage, storage pool with the most available space will be selected. + // +kubebuilder:default=tier1 + // +kubebuilder:validation:Enum=tier0;tier1;tier3 + // +optional + StorageType string `json:"storageType,omitempty"` + + // DeletePolicy defines the policy used to identify images to be preserved beyond the lifecycle of associated cluster. + // +kubebuilder:default=delete + // +kubebuilder:validation:Enum=delete;retain + // +optional + DeletePolicy string `json:"deletePolicy,omitempty"` +} + +// IBMPowerVSImageStatus defines the observed state of IBMPowerVSImage. +type IBMPowerVSImageStatus struct { + + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // ImageID is the id of the imported image. + ImageID string `json:"imageID,omitempty"` + + // ImageState is the status of the imported image. + // +optional + ImageState PowerVSImageState `json:"imageState,omitempty"` + + // JobID is the job ID of an import operation. + // +optional + JobID string `json:"jobID,omitempty"` + + // Conditions defines current service state of the IBMPowerVSImage. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // v1beta2 groups all the fields that will be added or modified in IBMPowerVSCluster's status with the V1Beta2 version. + // +optional + V1Beta2 *IBMPowerVSImageV1Beta2Status `json:"v1beta2,omitempty"` +} + +// IBMPowerVSImageV1Beta2Status groups all the fields that will be added or modified in IBMPowerVSCluster with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IBMPowerVSImageV1Beta2Status struct { + // conditions represents the observations of a DevCluster's current state. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:storageversion +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.imageState",description="PowerVS image state" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Image is ready for IBM PowerVS instances" + +// IBMPowerVSImage is the Schema for the ibmpowervsimages API. +type IBMPowerVSImage struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMPowerVSImageSpec `json:"spec,omitempty"` + Status IBMPowerVSImageStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the IBMPowerVSImage resource. +func (r *IBMPowerVSImage) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the IBMPowerVSImage to the predescribed clusterv1beta1.Conditions. +func (r *IBMPowerVSImage) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// GetV1Beta2Conditions returns the set of conditions for this object. +func (r *IBMPowerVSImage) GetV1Beta2Conditions() []metav1.Condition { + if r.Status.V1Beta2 == nil { + return nil + } + return r.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for an API object. +func (r *IBMPowerVSImage) SetV1Beta2Conditions(conditions []metav1.Condition) { + if r.Status.V1Beta2 == nil { + r.Status.V1Beta2 = &IBMPowerVSImageV1Beta2Status{} + } + r.Status.V1Beta2.Conditions = conditions +} + +//+kubebuilder:object:root=true + +// IBMPowerVSImageList contains a list of IBMPowerVSImage. +type IBMPowerVSImageList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMPowerVSImage `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IBMPowerVSImage{}, &IBMPowerVSImageList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go new file mode 100644 index 000000000000..2e12ff2089a4 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go @@ -0,0 +1,306 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// PowerVSProcessorType enum attribute to identify the PowerVS instance processor type. +type PowerVSProcessorType string + +const ( + // IBMPowerVSMachineFinalizer allows IBMPowerVSMachineReconciler to clean up resources associated with IBMPowerVSMachine before + // removing it from the apiserver. + IBMPowerVSMachineFinalizer = "ibmpowervsmachine.infrastructure.cluster.x-k8s.io" + // PowerVSProcessorTypeDedicated enum property to identify a Dedicated Power VS processor type. + PowerVSProcessorTypeDedicated PowerVSProcessorType = "Dedicated" + // PowerVSProcessorTypeShared enum property to identify a Shared Power VS processor type. + PowerVSProcessorTypeShared PowerVSProcessorType = "Shared" + // PowerVSProcessorTypeCapped enum property to identify a Capped Power VS processor type. + PowerVSProcessorTypeCapped PowerVSProcessorType = "Capped" + // DefaultIgnitionVersion represents default Ignition version generated for machine userdata. + DefaultIgnitionVersion = "2.3" +) + +// IBMPowerVSMachineSpec defines the desired state of IBMPowerVSMachine. +type IBMPowerVSMachineSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // ServiceInstanceID is the id of the power cloud instance where the vsi instance will get deployed. + // Deprecated: use ServiceInstance instead + ServiceInstanceID string `json:"serviceInstanceID"` + + // serviceInstance is the reference to the Power VS workspace on which the server instance(VM) will be created. + // Power VS workspace is a container for all Power VS instances at a specific geographic region. + // serviceInstance can be created via IBM Cloud catalog or CLI. + // supported serviceInstance identifier in PowerVSResource are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. + // More detail about Power VS service instance. + // https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-creating-power-virtual-server + // when omitted system will dynamically create the service instance + // +optional + ServiceInstance *IBMPowerVSResourceReference `json:"serviceInstance,omitempty"` + + // SSHKey is the name of the SSH key pair provided to the vsi for authenticating users. + SSHKey string `json:"sshKey,omitempty"` + + // Image the reference to the image which is used to create the instance. + // supported image identifier in IBMPowerVSResourceReference are Name and ID and that can be obtained from IBM Cloud UI or IBM Cloud cli. + // +optional + Image *IBMPowerVSResourceReference `json:"image,omitempty"` + + // ImageRef is an optional reference to a provider-specific resource that holds + // the details for provisioning the Image for a Cluster. + // +optional + ImageRef *corev1.LocalObjectReference `json:"imageRef,omitempty"` + + // systemType is the System type used to host the instance. + // systemType determines the number of cores and memory that is available. + // Few of the supported SystemTypes are s922,e980,s1022,e1050,e1080. + // When omitted, this means that the user has no opinion and the platform is left to choose a + // reasonable default, which is subject to change over time. The current default is s922 which is generally available. + // + This is not an enum because we expect other values to be added later which should be supported implicitly. + // +kubebuilder:validation:Enum:="s922";"e980";"s1022";"e1050";"e1080";"" + // +optional + SystemType string `json:"systemType,omitempty"` + + // processorType is the VM instance processor type. + // It must be set to one of the following values: Dedicated, Capped or Shared. + // Dedicated: resources are allocated for a specific client, The hypervisor makes a 1:1 binding of a partition’s processor to a physical processor core. + // Shared: Shared among other clients. + // Capped: Shared, but resources do not expand beyond those that are requested, the amount of CPU time is Capped to the value specified for the entitlement. + // if the processorType is selected as Dedicated, then processors value cannot be fractional. + // When omitted, this means that the user has no opinion and the platform is left to choose a + // reasonable default, which is subject to change over time. The current default is Shared. + // +kubebuilder:validation:Enum:="Dedicated";"Shared";"Capped";"" + // +optional + ProcessorType PowerVSProcessorType `json:"processorType,omitempty"` + + // processors is the number of virtual processors in a virtual machine. + // when the processorType is selected as Dedicated the processors value cannot be fractional. + // maximum value for the Processors depends on the selected SystemType, + // and minimum value for Processors depends on the selected ProcessorType, which can be found here: https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server-on-cloud. + // when ProcessorType is set as Shared or Capped, The minimum processors is 0.25. + // when ProcessorType is set as Dedicated, The minimum processors is 1. + // When omitted, this means that the user has no opinion and the platform is left to choose a + // reasonable default, which is subject to change over time. The default is set based on the selected ProcessorType. + // when ProcessorType selected as Dedicated, the default is set to 1. + // when ProcessorType selected as Shared or Capped, the default is set to 0.25. + // +optional + Processors intstr.IntOrString `json:"processors,omitempty"` + + // memoryGiB is the size of a virtual machine's memory, in GiB. + // maximum value for the MemoryGiB depends on the selected SystemType, which can be found here: https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-pricing-virtual-server-on-cloud + // The minimum memory is 2 GiB. + // When omitted, this means the user has no opinion and the platform is left to choose a reasonable + // default, which is subject to change over time. The current default is 2. + // +optional + MemoryGiB int32 `json:"memoryGiB,omitempty"` + + // Network is the reference to the Network to use for this instance. + // supported network identifier in IBMPowerVSResourceReference are Name, ID and RegEx and that can be obtained from IBM Cloud UI or IBM Cloud cli. + Network IBMPowerVSResourceReference `json:"network"` + + // ProviderID is the unique identifier as specified by the cloud provider. + // +optional + ProviderID *string `json:"providerID,omitempty"` +} + +// IBMPowerVSResourceReference is a reference to a specific PowerVS resource by ID, Name or RegEx +// Only one of ID, Name or RegEx may be specified. Specifying more than one will result in +// a validation error. +type IBMPowerVSResourceReference struct { + // ID of resource + // +kubebuilder:validation:MinLength=1 + // +optional + ID *string `json:"id,omitempty"` + + // Name of resource + // +kubebuilder:validation:MinLength=1 + // +optional + Name *string `json:"name,omitempty"` + + // Regular expression to match resource, + // In case of multiple resources matches the provided regular expression the first matched resource will be selected + // +kubebuilder:validation:MinLength=1 + // +optional + RegEx *string `json:"regex,omitempty"` +} + +// IBMPowerVSMachineStatus defines the observed state of IBMPowerVSMachine. +type IBMPowerVSMachineStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file + + InstanceID string `json:"instanceID,omitempty"` + + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Addresses contains the vsi associated addresses. + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // Health is the health of the vsi. + // +optional + Health string `json:"health,omitempty"` + + // InstanceState is the status of the vsi. + // +optional + InstanceState PowerVSInstanceState `json:"instanceState,omitempty"` + + // Fault will report if any fault messages for the vsi. + // +optional + Fault string `json:"fault,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // + // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + FailureReason *string `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // + // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the IBMPowerVSMachine. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // Region specifies the Power VS Service instance region. + Region *string `json:"region,omitempty"` + + // Zone specifies the Power VS Service instance zone. + Zone *string `json:"zone,omitempty"` + + // v1beta2 groups all the fields that will be added or modified in IBMPowerVSMachine's status with the V1Beta2 version. + // +optional + V1Beta2 *IBMPowerVSMachineV1Beta2Status `json:"v1beta2,omitempty"` +} + +// IBMPowerVSMachineV1Beta2Status groups all the fields that will be added or modified in IBMPowerVSMachineStatus with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IBMPowerVSMachineV1Beta2Status struct { + // conditions represents the observations of a IBMPowerVSMachine's current state. + // Known condition types are Ready, InstanceReady and Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this IBMPowerVSMachine belongs" +// +kubebuilder:printcolumn:name="Machine",type="string",priority=1,JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object to which this IBMPowerVSMachine belongs" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IBMPowerVSMachine" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for IBM PowerVS instances" +// +kubebuilder:printcolumn:name="Internal-IP",type="string",priority=1,JSONPath=".status.addresses[?(@.type==\"InternalIP\")].address",description="Instance Internal Addresses" +// +kubebuilder:printcolumn:name="External-IP",type="string",priority=1,JSONPath=".status.addresses[?(@.type==\"ExternalIP\")].address",description="Instance External Addresses" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="PowerVS instance state" +// +kubebuilder:printcolumn:name="Health",type="string",JSONPath=".status.health",description="PowerVS instance health" + +// IBMPowerVSMachine is the Schema for the ibmpowervsmachines API. +type IBMPowerVSMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMPowerVSMachineSpec `json:"spec,omitempty"` + Status IBMPowerVSMachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the IBMPowerVSMachine resource. +func (r *IBMPowerVSMachine) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the IBMPowerVSMachine to the predescribed clusterv1beta1.Conditions. +func (r *IBMPowerVSMachine) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// GetV1Beta2Conditions returns the set of conditions for this object. +func (r *IBMPowerVSMachine) GetV1Beta2Conditions() []metav1.Condition { + if r.Status.V1Beta2 == nil { + return nil + } + return r.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for an API object. +func (r *IBMPowerVSMachine) SetV1Beta2Conditions(conditions []metav1.Condition) { + if r.Status.V1Beta2 == nil { + r.Status.V1Beta2 = &IBMPowerVSMachineV1Beta2Status{} + } + r.Status.V1Beta2.Conditions = conditions +} + +//+kubebuilder:object:root=true + +// IBMPowerVSMachineList contains a list of IBMPowerVSMachine. +type IBMPowerVSMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMPowerVSMachine `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IBMPowerVSMachine{}, &IBMPowerVSMachineList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.go new file mode 100644 index 000000000000..fd26eee6c029 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.go @@ -0,0 +1,69 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// IBMPowerVSMachineTemplateSpec defines the desired state of IBMPowerVSMachineTemplate. +type IBMPowerVSMachineTemplateSpec struct { + Template IBMPowerVSMachineTemplateResource `json:"template"` +} + +// IBMPowerVSMachineTemplateResource holds the IBMPowerVSMachine spec. +type IBMPowerVSMachineTemplateResource struct { + Spec IBMPowerVSMachineSpec `json:"spec"` +} + +// IBMPowerVSMachineTemplateStatus defines the observed state of IBMPowerVSMachineTemplate. +type IBMPowerVSMachineTemplateStatus struct { + // Capacity defines the resource capacity for this machine. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + Capacity corev1.ResourceList `json:"capacity,omitempty"` +} + +//+kubebuilder:subresource:status +//+kubebuilder:object:root=true +//+kubebuilder:storageversion + +// IBMPowerVSMachineTemplate is the Schema for the ibmpowervsmachinetemplates API. +type IBMPowerVSMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMPowerVSMachineTemplateSpec `json:"spec,omitempty"` + Status IBMPowerVSMachineTemplateStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMPowerVSMachineTemplateList contains a list of IBMPowerVSMachineTemplate. +type IBMPowerVSMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMPowerVSMachineTemplate `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IBMPowerVSMachineTemplate{}, &IBMPowerVSMachineTemplateList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.go new file mode 100644 index 000000000000..848f7f570486 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.go @@ -0,0 +1,436 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +const ( + // ClusterFinalizer allows DockerClusterReconciler to clean up resources associated with DockerCluster before + // removing it from the apiserver. + ClusterFinalizer = "ibmvpccluster.infrastructure.cluster.x-k8s.io" +) + +// IBMVPCClusterSpec defines the desired state of IBMVPCCluster. +type IBMVPCClusterSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // The IBM Cloud Region the cluster lives in. + Region string `json:"region"` + + // The VPC resources should be created under the resource group. + ResourceGroup string `json:"resourceGroup"` + + // The Name of VPC. + VPC string `json:"vpc,omitempty"` + + // The Name of availability zone. + Zone string `json:"zone,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` + + // ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. + // Use this for legacy support, use Network.LoadBalancers for the extended VPC support. + // +optional + ControlPlaneLoadBalancer *VPCLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` + + // image represents the Image details used for the cluster. + // +optional + Image *ImageSpec `json:"image,omitempty"` + + // network represents the VPC network to use for the cluster. + // +optional + Network *VPCNetworkSpec `json:"network,omitempty"` +} + +// VPCLoadBalancerSpec defines the desired state of an VPC load balancer. +type VPCLoadBalancerSpec struct { + // Name sets the name of the VPC load balancer. + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + // +optional + Name string `json:"name,omitempty"` + + // id of the loadbalancer + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=64 + // +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$` + // +optional + ID *string `json:"id,omitempty"` + + // public indicates that load balancer is public or private + // +kubebuilder:default=true + // +optional + Public *bool `json:"public,omitempty"` + + // AdditionalListeners sets the additional listeners for the control plane load balancer. + // +listType=map + // +listMapKey=port + // +optional + // ++kubebuilder:validation:UniqueItems=true + AdditionalListeners []AdditionalListenerSpec `json:"additionalListeners,omitempty"` + + // backendPools defines the load balancer's backend pools. + // +optional + BackendPools []VPCLoadBalancerBackendPoolSpec `json:"backendPools,omitempty"` + + // securityGroups defines the Security Groups to attach to the load balancer. + // Security Groups defined here are expected to already exist when the load balancer is reconciled (these do not get created when reconciling the load balancer). + // +optional + SecurityGroups []VPCResource `json:"securityGroups,omitempty"` + + // subnets defines the VPC Subnets to attach to the load balancer. + // Subnets defiens here are expected to already exist when the load balancer is reconciled (these do not get created when reconciling the load balancer). + // +optional + Subnets []VPCResource `json:"subnets,omitempty"` +} + +// AdditionalListenerSpec defines the desired state of an +// additional listener on an VPC load balancer. +type AdditionalListenerSpec struct { + // defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for the VPC Load Balancer Listener. + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + // +optional + DefaultPoolName *string `json:"defaultPoolName,omitempty"` + + // Port sets the port for the additional listener. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port int64 `json:"port"` + + // protocol defines the protocol to use for the VPC Load Balancer Listener. + // Will default to TCP protocol if not specified. + // +optional + Protocol *VPCLoadBalancerListenerProtocol `json:"protocol,omitempty"` + + // The selector is used to find IBMPowerVSMachines with matching labels. + // If the label matches, the machine is then added to the load balancer listener configuration. + // +kubebuilder:validation:Optional + Selector metav1.LabelSelector `json:"selector,omitempty"` +} + +// VPCLoadBalancerBackendPoolSpec defines the desired configuration of a VPC Load Balancer Backend Pool. +type VPCLoadBalancerBackendPoolSpec struct { + // name defines the name of the Backend Pool. + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + // +optional + Name *string `json:"name,omitempty"` + + // algorithm defines the load balancing algorithm to use. + // +required + Algorithm VPCLoadBalancerBackendPoolAlgorithm `json:"algorithm"` + + // healthMonitor defines the backend pool's health monitor. + // +required + HealthMonitor VPCLoadBalancerHealthMonitorSpec `json:"healthMonitor"` + + // protocol defines the protocol to use for the Backend Pool. + // +required + Protocol VPCLoadBalancerBackendPoolProtocol `json:"protocol"` +} + +// VPCLoadBalancerHealthMonitorSpec defines the desired state of a Health Monitor resource for a VPC Load Balancer Backend Pool. +// kubebuilder:validation:XValidation:rule="self.dely > self.timeout",message="health monitor's delay must be greater than the timeout" +type VPCLoadBalancerHealthMonitorSpec struct { + // delay defines the seconds to wait between health checks. + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=60 + // +required + Delay int64 `json:"delay"` + + // retries defines the max retries for health check. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=10 + // +required + Retries int64 `json:"retries"` + + // port defines the port to perform health monitoring on. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + // +optional + Port *int64 `json:"port,omitempty"` + + // timeout defines the seconds to wait for a health check response. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=59 + // +required + Timeout int64 `json:"timeout"` + + // type defines the protocol used for health checks. + // +required + Type VPCLoadBalancerBackendPoolHealthMonitorType `json:"type"` + + // urlPath defines the URL to use for health monitoring. + // +kubebuilder:validation:Pattern=`^\/(([a-zA-Z0-9-._~!$&'()*+,;=:@]|%[a-fA-F0-9]{2})+(\/([a-zA-Z0-9-._~!$&'()*+,;=:@]|%[a-fA-F0-9]{2})*)*)?(\\?([a-zA-Z0-9-._~!$&'()*+,;=:@\/?]|%[a-fA-F0-9]{2})*)?$` + // +optional + URLPath *string `json:"urlPath,omitempty"` +} + +// ImageSpec defines the desired state of the VPC Custom Image resources for the cluster. +// +kubebuilder:validation:XValidation:rule="(!has(self.cosInstance) && !has(self.cosBucket) && !has(self.cosObject)) || (has(self.cosInstance) && has(self.cosBucket) && has(self.cosObject))",message="if any of cosInstance, cosBucket, or cosObject are specified, all must be specified" +// +kubebuilder:validation:XValidation:rule="has(self.name) || has(self.crn) || (has(self.cosInstance) && has(self.cosBucket) && has(self.cosObject))",message="an existing image name or crn must be provided, or to create a new image the cos resources must be provided, with or without a name" +type ImageSpec struct { + // name is the name of the desired VPC Custom Image. + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + // +optional + Name *string `json:"name,omitempty"` + + // crn is the IBM Cloud CRN of the existing VPC Custom Image. + // +optional + CRN *string `json:"crn,omitempty"` + + // cosInstance is the name of the IBM Cloud COS Instance containing the source of the image, if necessary. + // +optional + COSInstance *string `json:"cosInstance,omitempty"` + + // cosBucket is the name of the IBM Cloud COS Bucket containing the source of the image, if necessary. + // +optional + COSBucket *string `json:"cosBucket,omitempty"` + + // cosBucketRegion is the COS region the bucket is in. + // +optional + COSBucketRegion *string `json:"cosBucketRegion,omitempty"` + + // cosObject is the name of a IBM Cloud COS Object used as the source of the image, if necessary. + // +optional + COSObject *string `json:"cosObject,omitempty"` + + // operatingSystem is the Custom Image's Operating System name. + // +optional + OperatingSystem *string `json:"operatingSystem,omitempty"` + + // resourceGroup is the Resource Group to create the Custom Image in. + // +optional + ResourceGroup *IBMCloudResourceReference `json:"resourceGroup,omitempty"` +} + +// VPCNetworkSpec defines the desired state of the network resources for the cluster for extended VPC Infrastructure support. +type VPCNetworkSpec struct { + // controlPlaneSubnets is a set of Subnet's which define the Control Plane subnets. + // +optional + ControlPlaneSubnets []Subnet `json:"controlPlaneSubnets,omitempty"` + + // loadBalancers is a set of VPC Load Balancer definitions to use for the cluster. + // +optional + LoadBalancers []VPCLoadBalancerSpec `json:"loadBalancers,omitempty"` + + // resourceGroup is the Resource Group containing all of the newtork resources. + // This can be different than the Resource Group containing the remaining cluster resources. + // +optional + ResourceGroup *IBMCloudResourceReference `json:"resourceGroup,omitempty"` + + // securityGroups is a set of VPCSecurityGroup's which define the VPC Security Groups that manage traffic within and out of the VPC. + // +optional + SecurityGroups []VPCSecurityGroup `json:"securityGroups,omitempty"` + + // workerSubnets is a set of Subnet's which define the Worker subnets. + // +optional + WorkerSubnets []Subnet `json:"workerSubnets,omitempty"` + + // vpc defines the IBM Cloud VPC for extended VPC Infrastructure support. + // +optional + VPC *VPCResource `json:"vpc,omitempty"` +} + +// VPCSecurityGroupStatus defines a vpc security group resource status with its id and respective rule's ids. +type VPCSecurityGroupStatus struct { + // id represents the id of the resource. + ID *string `json:"id,omitempty"` + // rules contains the id of rules created under the security group + RuleIDs []*string `json:"ruleIDs,omitempty"` + // +kubebuilder:default=false + // controllerCreated indicates whether the resource is created by the controller. + ControllerCreated *bool `json:"controllerCreated,omitempty"` +} + +// VPCLoadBalancerStatus defines the status VPC load balancer. +type VPCLoadBalancerStatus struct { + // id of VPC load balancer. + // +optional + ID *string `json:"id,omitempty"` + // State is the status of the load balancer. + State VPCLoadBalancerState `json:"state,omitempty"` + // hostname is the hostname of load balancer. + // +optional + Hostname *string `json:"hostname,omitempty"` + // +kubebuilder:default=false + // controllerCreated indicates whether the resource is created by the controller. + ControllerCreated *bool `json:"controllerCreated,omitempty"` +} + +// IBMVPCClusterStatus defines the observed state of IBMVPCCluster. +type IBMVPCClusterStatus struct { + // Important: Run "make" to regenerate code after modifying this file + // dep: rely on Network instead. + VPC VPC `json:"vpc,omitempty"` + + // image is the status of the VPC Custom Image. + // +optional + Image *ResourceStatus `json:"image,omitempty"` + + // network is the status of the VPC network resources for extended VPC Infrastructure support. + // +optional + Network *VPCNetworkStatus `json:"network,omitempty"` + + // Ready is true when the provider resource is ready. + // +optional + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // resourceGroup is the status of the cluster's Resource Group for extended VPC Infrastructure support. + // +optional + ResourceGroup *ResourceStatus `json:"resourceGroup,omitempty"` + + Subnet Subnet `json:"subnet,omitempty"` + VPCEndpoint VPCEndpoint `json:"vpcEndpoint,omitempty"` + + // ControlPlaneLoadBalancerState is the status of the load balancer. + // +optional + ControlPlaneLoadBalancerState VPCLoadBalancerState `json:"controlPlaneLoadBalancerState,omitempty"` + + // Conditions defines current service state of the load balancer. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // V1beta2 groups all the fields that will be added or modified in IBMVPCCluster's status with the V1Beta2 version. + // +optional + V1Beta2 *IBMVPCClusterV1Beta2Status `json:"v1beta2,omitempty"` +} + +// IBMVPCClusterV1Beta2Status groups all the fields that will be added or modified in IBMVPCClusterStatus with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IBMVPCClusterV1Beta2Status struct { + // Conditions represents the observations of a IBMVPCCluster's current state. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// VPCNetworkStatus provides details on the status of VPC network resources for extended VPC Infrastructure support. +type VPCNetworkStatus struct { + // controlPlaneSubnets references the VPC Subnets for the cluster's Control Plane. + // The map simplifies lookups. + // +optional + ControlPlaneSubnets map[string]*ResourceStatus `json:"controlPlaneSubnets,omitempty"` + + // loadBalancers references the VPC Load Balancer's for the cluster. + // The map simplifies lookups. + // +optional + LoadBalancers map[string]*VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` + + // publicGateways references the VPC Public Gateways for the cluster. + // The map simplifies lookups. + // +optional + PublicGateways map[string]*ResourceStatus `json:"publicGateways,omitempty"` + + // resourceGroup references the Resource Group for Network resources for the cluster. + // This can be the same or unique from the cluster's Resource Group. + // +optional + ResourceGroup *ResourceStatus `json:"resourceGroup,omitempty"` + + // securityGroups references the VPC Security Groups for the cluster. + // The map simplifies lookups. + // +optional + SecurityGroups map[string]*ResourceStatus `json:"securityGroups,omitempty"` + + // workerSubnets references the VPC Subnets for the cluster's Data Plane. + // The map simplifies lookups. + // +optional + WorkerSubnets map[string]*ResourceStatus `json:"workerSubnets,omitempty"` + + // vpc references the status of the IBM Cloud VPC as part of the extended VPC Infrastructure support. + // +optional + VPC *ResourceStatus `json:"vpc,omitempty"` +} + +// VPC holds the VPC information. +type VPC struct { + ID string `json:"id"` + Name string `json:"name"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ibmvpcclusters,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this IBMVPCCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for IBM VPC instances" + +// IBMVPCCluster is the Schema for the ibmvpcclusters API. +type IBMVPCCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMVPCClusterSpec `json:"spec,omitempty"` + Status IBMVPCClusterStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMVPCClusterList contains a list of IBMVPCCluster. +type IBMVPCClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMVPCCluster `json:"items"` +} + +// GetConditions returns the observations of the operational state of the IBMVPCCluster resource. +func (r *IBMVPCCluster) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the IBMVPCCluster to the predescribed clusterv1beta1.Conditions. +func (r *IBMVPCCluster) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// GetV1Beta2Conditions returns the set of conditions for IBMVPCCluster object. +func (r *IBMVPCCluster) GetV1Beta2Conditions() []metav1.Condition { + if r.Status.V1Beta2 == nil { + return nil + } + return r.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for IBMVPCCluster object. +func (r *IBMVPCCluster) SetV1Beta2Conditions(conditions []metav1.Condition) { + if r.Status.V1Beta2 == nil { + r.Status.V1Beta2 = &IBMVPCClusterV1Beta2Status{} + } + r.Status.V1Beta2.Conditions = conditions +} + +func init() { + objectTypes = append(objectTypes, &IBMVPCCluster{}, &IBMVPCClusterList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmvpcclustertemplate_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcclustertemplate_types.go new file mode 100644 index 000000000000..e018d719f4ef --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcclustertemplate_types.go @@ -0,0 +1,62 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// IBMVPCClusterTemplateSpec defines the desired state of IBMVPCClusterTemplate. +type IBMVPCClusterTemplateSpec struct { + Template IBMVPCClusterTemplateResource `json:"template,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ibmvpcclustertemplates,scope=Namespaced,categories=cluster-api,shortName=ibmvpcct +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IBMVPCClusterTemplate" + +// IBMVPCClusterTemplate is the Schema for the ibmvpcclustertemplates API. +type IBMVPCClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMVPCClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMVPCClusterTemplateList contains a list of IBMVPCClusterTemplate. +type IBMVPCClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMVPCClusterTemplate `json:"items"` +} + +// IBMVPCClusterTemplateResource describes the data needed to create an IBMVPCCluster from a template. +type IBMVPCClusterTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"` + Spec IBMVPCClusterSpec `json:"spec"` +} + +func init() { + objectTypes = append(objectTypes, &IBMVPCClusterTemplate{}, &IBMVPCClusterTemplateList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.go new file mode 100644 index 000000000000..065ed282d797 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.go @@ -0,0 +1,247 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck +) + +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +const ( + // MachineFinalizer allows IBMVPCMachineReconciler to clean up resources associated with IBMVPCMachine before + // removing it from the apiserver. + MachineFinalizer = "ibmvpcmachine.infrastructure.cluster.x-k8s.io" +) + +// IBMVPCMachineSpec defines the desired state of IBMVPCMachine. +type IBMVPCMachineSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of machine. + // Important: Run "make" to regenerate code after modifying this file + + // Name of the instance. + Name string `json:"name,omitempty"` + + // CatalogOffering is the Catalog Offering OS image which would be installed on the instance. + // An OfferingCRN or VersionCRN is required, the PlanCRN is optional. + // +optional + CatalogOffering *IBMCloudCatalogOffering `json:"catalogOffering,omitempty"` + + // PlacementTarget is the placement restrictions to use for the virtual server instance. No restrictions are used when this field is not defined. + // +optional + PlacementTarget *VPCMachinePlacementTarget `json:"placementTarget,omitempty"` + + // Image is the OS image which would be install on the instance. + // ID will take higher precedence over Name if both specified. + Image *IBMVPCResourceReference `json:"image"` + + // LoadBalancerPoolMembers is the set of IBM Cloud VPC Load Balancer Backend Pools the machine should be added to as a member. + // +optional + LoadBalancerPoolMembers []VPCLoadBalancerBackendPoolMember `json:"loadBalancerPoolMembers,omitempty"` + + // Zone is the place where the instance should be created. Example: us-south-3 + // TODO: Actually zone is transparent to user. The field user can access is location. Example: Dallas 2 + Zone string `json:"zone"` + + // Profile indicates the flavor of instance. Example: bx2-8x32 means 8 vCPUs 32 GB RAM 16 Gbps + // TODO: add a reference link of profile + // +optional + Profile string `json:"profile,omitempty"` + + // BootVolume contains machines's boot volume configurations like size, iops etc.. + // +optional + BootVolume *VPCVolume `json:"bootVolume,omitempty"` + + // ProviderID is the unique identifier as specified by the cloud provider. + // +optional + ProviderID *string `json:"providerID,omitempty"` + + // PrimaryNetworkInterface is required to specify subnet. + PrimaryNetworkInterface NetworkInterface `json:"primaryNetworkInterface,omitempty"` + + // SSHKeys is the SSH pub keys that will be used to access VM. + // ID will take higher precedence over Name if both specified. + SSHKeys []*IBMVPCResourceReference `json:"sshKeys,omitempty"` +} + +// IBMVPCResourceReference is a reference to a specific VPC resource by ID or Name +// Only one of ID or Name may be specified. Specifying more than one will result in +// a validation error. +type IBMVPCResourceReference struct { + // ID of resource + // +kubebuilder:validation:MinLength=1 + // +optional + ID *string `json:"id,omitempty"` + + // Name of resource + // +kubebuilder:validation:MinLength=1 + // +optional + Name *string `json:"name,omitempty"` +} + +// VPCVolume defines the volume information for the instance. +type VPCVolume struct { + // DeleteVolumeOnInstanceDelete If set to true, when deleting the instance the volume will also be deleted. + // Default is set as true + // +kubebuilder:default=true + // +optional + DeleteVolumeOnInstanceDelete bool `json:"deleteVolumeOnInstanceDelete,omitempty"` + + // Name is the unique user-defined name for this volume. + // Default will be autogenerated + // +optional + Name string `json:"name,omitempty"` + + // SizeGiB is the size of the virtual server's boot disk in GiB. + // Default to the size of the image's `minimum_provisioned_size`. + // +optional + SizeGiB int64 `json:"sizeGiB,omitempty"` + + // Profile is the volume profile for the bootdisk, refer https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles + // for more information. + // Default to general-purpose + // +kubebuilder:validation:Enum="general-purpose";"5iops-tier";"10iops-tier";"custom" + // +kubebuilder:default=general-purpose + // +optional + Profile string `json:"profile,omitempty"` + + // Iops is the maximum I/O operations per second (IOPS) to use for the volume. Applicable only to volumes using a profile + // family of `custom`. + // +optional + Iops int64 `json:"iops,omitempty"` + + // EncryptionKey is the root key to use to wrap the data encryption key for the volume and this points to the CRN + // and possible values are as follows. + // The CRN of the [Key Protect Root + // Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) or [Hyper Protect Crypto + // Service Root Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this resource. + // If unspecified, the `encryption` type for the volume will be `provider_managed`. + // +optional + EncryptionKeyCRN string `json:"encryptionKeyCRN,omitempty"` +} + +// IBMVPCMachineStatus defines the observed state of IBMVPCMachine. +type IBMVPCMachineStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // InstanceID defines the IBM Cloud VPC Instance UUID. + // +optional + InstanceID string `json:"instanceID,omitempty"` + + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Addresses contains the IBM Cloud instance associated addresses. + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // Conditions deefines current service state of the IBMVPCMachine. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // +optional + FailureReason *string `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // InstanceStatus is the status of the IBM Cloud instance for this machine. + // +optional + InstanceStatus string `json:"instanceState,omitempty"` + + // LoadBalancerPoolMembers is the status of IBM Cloud VPC Load Balancer Backend Pools the machine is a member. + // +optional + LoadBalancerPoolMembers []VPCLoadBalancerBackendPoolMember `json:"loadBalancerPoolMembers,omitempty"` + + // V1beta2 groups all the fields that will be added or modified in IBMVPCMachine's status with the V1Beta2 version. + // +optional + V1Beta2 *IBMVPCMachineV1Beta2Status `json:"v1beta2,omitempty"` +} + +// IBMVPCMachineV1Beta2Status groups all the fields that will be added or modified in IBMVPCMachineStatus with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IBMVPCMachineV1Beta2Status struct { + // Conditions represents the observations of a IBMVPCMachine's current state. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ibmvpcmachines,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for IBM VPC instances" + +// IBMVPCMachine is the Schema for the ibmvpcmachines API. +type IBMVPCMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMVPCMachineSpec `json:"spec,omitempty"` + Status IBMVPCMachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the IBMVPCMachine resource. +func (r *IBMVPCMachine) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the IBMVPCMachine to the predescribed clusterv1beta1.Conditions. +func (r *IBMVPCMachine) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +//+kubebuilder:object:root=true + +// IBMVPCMachineList contains a list of IBMVPCMachine. +type IBMVPCMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMVPCMachine `json:"items"` +} + +// GetV1Beta2Conditions returns the set of conditions for IBMVPCMachine object. +func (r *IBMVPCMachine) GetV1Beta2Conditions() []metav1.Condition { + if r.Status.V1Beta2 == nil { + return nil + } + return r.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for IBMVPCMachine object. +func (r *IBMVPCMachine) SetV1Beta2Conditions(conditions []metav1.Condition) { + if r.Status.V1Beta2 == nil { + r.Status.V1Beta2 = &IBMVPCMachineV1Beta2Status{} + } + r.Status.V1Beta2.Conditions = conditions +} + +func init() { + objectTypes = append(objectTypes, &IBMVPCMachine{}, &IBMVPCMachineList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.go b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.go new file mode 100644 index 000000000000..210b9617c753 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.go @@ -0,0 +1,69 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// IBMVPCMachineTemplateSpec defines the desired state of IBMVPCMachineTemplate. +type IBMVPCMachineTemplateSpec struct { + Template IBMVPCMachineTemplateResource `json:"template"` +} + +// IBMVPCMachineTemplateResource describes the data needed to create am IBMVPCMachine from a template. +type IBMVPCMachineTemplateResource struct { + // Spec is the specification of the desired behavior of the machine. + Spec IBMVPCMachineSpec `json:"spec"` +} + +// IBMVPCMachineTemplateStatus defines the observed state of IBMVPCMachineTemplate. +type IBMVPCMachineTemplateStatus struct { + // Capacity defines the resource capacity for this machine. + // This value is used for autoscaling from zero operations as defined in: + // https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md + // +optional + Capacity corev1.ResourceList `json:"capacity,omitempty"` +} + +//+kubebuilder:subresource:status +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ibmvpcmachinetemplates,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion + +// IBMVPCMachineTemplate is the Schema for the ibmvpcmachinetemplates API. +type IBMVPCMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec IBMVPCMachineTemplateSpec `json:"spec,omitempty"` + Status IBMVPCMachineTemplateStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// IBMVPCMachineTemplateList contains a list of IBMVPCMachineTemplate. +type IBMVPCMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IBMVPCMachineTemplate `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IBMVPCMachineTemplate{}, &IBMVPCMachineTemplateList{}) +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/types.go b/pkg/capi/ibmcloud/api/v1beta2/types.go new file mode 100644 index 000000000000..dab7e1bb1f25 --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/types.go @@ -0,0 +1,577 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +const ( + // CIDRBlockAny is the CIDRBlock representing any allowable destination/source IP. + CIDRBlockAny string = "0.0.0.0/0" + + // DefaultAPIServerPort is defuault API server port number. + DefaultAPIServerPort int32 = 6443 + + // UpdateMachineError indicates an error while trying to update a machine. + UpdateMachineError string = "UpdateError" +) + +// PowerVSInstanceState describes the state of an IBM Power VS instance. +type PowerVSInstanceState string + +var ( + // PowerVSInstanceStateACTIVE is the string representing an instance in a ACTIVE state. + PowerVSInstanceStateACTIVE = PowerVSInstanceState("ACTIVE") + + // PowerVSInstanceStateBUILD is the string representing an instance in a BUILD state. + PowerVSInstanceStateBUILD = PowerVSInstanceState("BUILD") + + // PowerVSInstanceStateSHUTOFF is the string representing an instance in a SHUTOFF state. + PowerVSInstanceStateSHUTOFF = PowerVSInstanceState("SHUTOFF") + + // PowerVSInstanceStateREBOOT is the string representing an instance in a REBOOT state. + PowerVSInstanceStateREBOOT = PowerVSInstanceState("REBOOT") + + // PowerVSInstanceStateERROR is the string representing an instance in a ERROR state. + PowerVSInstanceStateERROR = PowerVSInstanceState("ERROR") +) + +// PowerVSImageState describes the state of an IBM Power VS image. +type PowerVSImageState string + +var ( + // PowerVSImageStateACTIVE is the string representing an image in a active state. + PowerVSImageStateACTIVE = PowerVSImageState("active") + + // PowerVSImageStateQueued is the string representing an image in a queued state. + PowerVSImageStateQueued = PowerVSImageState("queued") + + // PowerVSImageStateFailed is the string representing an image in a failed state. + PowerVSImageStateFailed = PowerVSImageState("failed") + + // PowerVSImageStateImporting is the string representing an image in a failed state. + PowerVSImageStateImporting = PowerVSImageState("importing") + + // PowerVSImageStateCompleted is the string representing an image in a completed state. + PowerVSImageStateCompleted = PowerVSImageState("completed") +) + +// ServiceInstanceState describes the state of a service instance. +type ServiceInstanceState string + +var ( + // ServiceInstanceStateActive is the string representing a service instance in an active state. + ServiceInstanceStateActive = ServiceInstanceState("active") + + // ServiceInstanceStateProvisioning is the string representing a service instance in a provisioning state. + ServiceInstanceStateProvisioning = ServiceInstanceState("provisioning") + + // ServiceInstanceStateFailed is the string representing a service instance in a failed state. + ServiceInstanceStateFailed = ServiceInstanceState("failed") + + // ServiceInstanceStateRemoved is the string representing a service instance in a removed state. + ServiceInstanceStateRemoved = ServiceInstanceState("removed") +) + +// TransitGatewayState describes the state of an IBM Transit Gateway. +type TransitGatewayState string + +var ( + // TransitGatewayStateAvailable is the string representing a transit gateway in available state. + TransitGatewayStateAvailable = TransitGatewayState("available") + + // TransitGatewayStatePending is the string representing a transit gateway in pending state. + TransitGatewayStatePending = TransitGatewayState("pending") + + // TransitGatewayStateFailed is the string representing a transit gateway in failed state. + TransitGatewayStateFailed = TransitGatewayState("failed") + + // TransitGatewayStateDeletePending is the string representing a transit gateway in deleting state. + TransitGatewayStateDeletePending = TransitGatewayState("deleting") +) + +// TransitGatewayConnectionState describes the state of an IBM Transit Gateway connection. +type TransitGatewayConnectionState string + +var ( + // TransitGatewayConnectionStateAttached is the string representing a transit gateway connection in attached state. + TransitGatewayConnectionStateAttached = TransitGatewayConnectionState("attached") + + // TransitGatewayConnectionStateFailed is the string representing a transit gateway connection in failed state. + TransitGatewayConnectionStateFailed = TransitGatewayConnectionState("failed") + + // TransitGatewayConnectionStatePending is the string representing a transit gateway connection in pending state. + TransitGatewayConnectionStatePending = TransitGatewayConnectionState("pending") + + // TransitGatewayConnectionStateDeleting is the string representing a transit gateway connection in deleting state. + TransitGatewayConnectionStateDeleting = TransitGatewayConnectionState("deleting") +) + +// VPCLoadBalancerBackendPoolAlgorithm describes the backend pool's load balancing algorithm. +// +kubebuilder:validation:Enum=least_connections;round_robin;weighted_round_robin +type VPCLoadBalancerBackendPoolAlgorithm string + +// VPCLoadBalancerBackendPoolAlgorithmLeastConnections is the string representing the least_connections load balancing algorithm. + +// VPCLoadBalancerBackendPoolAlgorithmRoundRobin is the string representing the round_robin load balancing algorithm. + +// VPCLoadBalancerBackendPoolAlgorithmWeightedRoundRobin is the string representing the weighted_round_robin load balancing algorithm. + +// VPCLoadBalancerBackendPoolProtocol describes the protocol for load balancer backend pools. +// We have unique types in case IBM Cloud Load Balancer Listener and Backend Pool supported algorithms ever diverage. +// +kubebuilder:validation:Enum=http;https;tcp;udp +type VPCLoadBalancerBackendPoolProtocol string + +// VPCLoadBalancerBackendPoolProtocolHTTP is the string representing the http protocol for load balancer backend pools. + +// VPCLoadBalancerBackendPoolProtocolHTTPS is the string representing the https protocol for load balancer backend pools. + +// VPCLoadBalancerBackendPoolProtocolTCP is the string representing the tcp protocol for load balancer backend pools. + +// VPCLoadBalancerBackendPoolProtocolUDP is the string representing the tudp protocol for load balancer backend pools. + +// VPCLoadBalancerListenerProtocol describes the protocol for load balancer listeners. +// We have unique types in case IBM Cloud Load Balancer Listener and Backend Pool supported algorithms ever diverage. +// +kubebuilder:validation:Enum=http;https;tcp;udp +type VPCLoadBalancerListenerProtocol string + +// VPCLoadBalancerListenerProtocolHTTP is the string representing the http protocol for load balancer listeners. + +// VPCLoadBalancerListenerProtocolHTTPS is the string representing the https protocol for load balancer listeners. + +// VPCLoadBalancerListenerProtocolTCP is the string representing the tcp protocol for load balancer listeners. + +// VPCLoadBalancerListenerProtocolUDP is the string representing the tudp protocol for load balancer listeners. + +// VPCLoadBalancerBackendPoolHealthMonitorType describes the backend pool's health check protocol type. +// +kubebuilder:validation:Enum=http;https;tcp +type VPCLoadBalancerBackendPoolHealthMonitorType string + +// VPCLoadBalancerBackendPoolHealthMonitorTypeHTTP is the string representing the http health pool protocol type. + +// VPCLoadBalancerBackendPoolHealthMonitorTypeHTTPS is the string representing the https health pool protocol type. + +// VPCLoadBalancerBackendPoolHealthMonitorTypeTCP is the string representing the tcp health pool protocol type. + +// VPCLoadBalancerState describes the state of the load balancer. +type VPCLoadBalancerState string + +var ( + // VPCLoadBalancerStateActive is the string representing the load balancer in a active state. + VPCLoadBalancerStateActive = VPCLoadBalancerState("active") + + // VPCLoadBalancerStateCreatePending is the string representing the load balancer in a queued state. + VPCLoadBalancerStateCreatePending = VPCLoadBalancerState("create_pending") + + // VPCLoadBalancerStateUpdatePending is the string representing the load balancer in updating state. + VPCLoadBalancerStateUpdatePending = VPCLoadBalancerState("update_pending") + + // VPCLoadBalancerStateDeletePending is the string representing the load balancer in deleting state. + VPCLoadBalancerStateDeletePending = VPCLoadBalancerState("delete_pending") +) + +// VPCSubnetState describes the state of a VPC Subnet. +type VPCSubnetState string + +var ( + // VPCSubnetStateDeleting is the string representing a VPC subnet in deleting state. + VPCSubnetStateDeleting = VPCSubnetState("deleting") +) + +// VPCState describes the state of a VPC. +type VPCState string + +var ( + // VPCStatePending is the string representing a VPC in pending state. + VPCStatePending = VPCState("pending") + + // VPCStateDeleting is the string representing a VPC in deleting state. + VPCStateDeleting = VPCState("deleting") +) + +// DHCPServerState describes the state of the DHCP Server. +type DHCPServerState string + +var ( + // DHCPServerStateActive indicates the active state of DHCP server. + DHCPServerStateActive = DHCPServerState("ACTIVE") + + // DHCPServerStateBuild indicates the build state of DHCP server. + DHCPServerStateBuild = DHCPServerState("BUILD") + + // DHCPServerStateError indicates the error state of DHCP server. + DHCPServerStateError = DHCPServerState("ERROR") +) + +// DeletePolicy defines the policy used to identify images to be preserved. +type DeletePolicy string + +var ( + // DeletePolicyRetain is the string representing an image to be retained. + DeletePolicyRetain = DeletePolicy("retain") +) + +// ResourceType describes IBM Cloud resource name. +type ResourceType string + +var ( + // ResourceTypeServiceInstance is Power VS service instance resource. + ResourceTypeServiceInstance = ResourceType("serviceInstance") + // ResourceTypeNetwork is Power VS network resource. + ResourceTypeNetwork = ResourceType("network") + // ResourceTypeDHCPServer is Power VS DHCP server. + ResourceTypeDHCPServer = ResourceType("dhcpServer") + // ResourceTypeLoadBalancer VPC loadBalancer resource. + ResourceTypeLoadBalancer = ResourceType("loadBalancer") + // ResourceTypeLoadBalancerPool is a Load Balancer Pool resource. + ResourceTypeLoadBalancerPool = ResourceType("loadBalancerPool") + // ResourceTypeTransitGateway is transit gateway resource. + ResourceTypeTransitGateway = ResourceType("transitGateway") + // ResourceTypeVPC is Power VS network resource. + ResourceTypeVPC = ResourceType("vpc") + // ResourceTypeSubnet is VPC subnet resource. + ResourceTypeSubnet = ResourceType("subnet") + // ResourceTypeControlPlaneSubnet is a VPC subnet resource designated for the Control Plane. + ResourceTypeControlPlaneSubnet = ResourceType("controlPlaneSubnet") + // ResourceTypeWorkerSubnet is a VPC subnet resource designated for the Worker (Data) Plane. + ResourceTypeWorkerSubnet = ResourceType("workerSubnet") + // ResourceTypeSecurityGroup is a VPC Security Group resource. + ResourceTypeSecurityGroup = ResourceType("securityGroup") + // ResourceTypeCOSInstance is IBM COS instance resource. + ResourceTypeCOSInstance = ResourceType("cosInstance") + // ResourceTypeCOSBucket is IBM COS bucket resource. + ResourceTypeCOSBucket = ResourceType("cosBucket") + // ResourceTypeResourceGroup is IBM Resource Group. + ResourceTypeResourceGroup = ResourceType("resourceGroup") + // ResourceTypePublicGateway is a VPC Public Gatway. + ResourceTypePublicGateway = ResourceType("publicGateway") + // ResourceTypeCustomImage is a VPC Custom Image. + ResourceTypeCustomImage = ResourceType("customImage") +) + +const ( + // VPCSecurityGroupRuleProtocolAllType is a string representation of the 'SecurityGroupRuleSecurityGroupRuleProtocolAll' type. + VPCSecurityGroupRuleProtocolAllType = "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolAll" + + // VPCSecurityGroupRuleProtocolIcmpType is a string representation of the 'SecurityGroupRuleSecurityGroupRuleProtocolIcmp' type. + VPCSecurityGroupRuleProtocolIcmpType = "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolIcmp" + + // VPCSecurityGroupRuleProtocolTcpudpType is a string representation of the 'SecurityGroupRuleSecurityGroupRuleProtocolTcpudp' type. + VPCSecurityGroupRuleProtocolTcpudpType = "*vpcv1.SecurityGroupRuleSecurityGroupRuleProtocolTcpudp" +) + +// VPCSecurityGroupRuleAction represents the actions for a Security Group Rule. +// +kubebuilder:validation:Enum=allow;deny +type VPCSecurityGroupRuleAction string + +// VPCSecurityGroupRuleActionAllow defines that the Rule should allow traffic. + +// VPCSecurityGroupRuleActionDeny defines that the Rule should deny traffic. + +// VPCSecurityGroupRuleDirection represents the directions for a Security Group Rule. +// +kubebuilder:validation:Enum=inbound;outbound +type VPCSecurityGroupRuleDirection string + +// VPCSecurityGroupRuleDirectionInbound defines the Rule is for inbound traffic. + +// VPCSecurityGroupRuleDirectionOutbound defines the Rule is for outbound traffic. + +// VPCSecurityGroupRuleProtocol represents the protocols for a Security Group Rule. +// +kubebuilder:validation:Enum=all;icmp;tcp;udp +type VPCSecurityGroupRuleProtocol string + +// VPCSecurityGroupRuleProtocolAll defines the Rule is for all network protocols. + +// VPCSecurityGroupRuleProtocolIcmp defiens the Rule is for ICMP network protocol. + +// VPCSecurityGroupRuleProtocolTCP defines the Rule is for TCP network protocol. + +// VPCSecurityGroupRuleProtocolUDP defines the Rule is for UDP network protocol. + +// VPCSecurityGroupRuleRemoteType represents the type of Security Group Rule's destination or source is +// intended. This is intended to define the VPCSecurityGroupRulePrototype subtype. +// For example: +// - any - Any source or destination (0.0.0.0/0) +// - cidr - A CIDR representing a set of IP's (10.0.0.0/28) +// - address - A specific address (192.168.0.1) +// - sg - A Security Group. +// +kubebuilder:validation:Enum=any;cidr;address;sg +type VPCSecurityGroupRuleRemoteType string + +const ( + // VPCSecurityGroupRuleRemoteTypeAny defines the destination or source for the Rule is anything/anywhere. + VPCSecurityGroupRuleRemoteTypeAny VPCSecurityGroupRuleRemoteType = VPCSecurityGroupRuleRemoteType("any") + // VPCSecurityGroupRuleRemoteTypeCIDR defines the destination or source for the Rule is a CIDR block. + VPCSecurityGroupRuleRemoteTypeCIDR VPCSecurityGroupRuleRemoteType = VPCSecurityGroupRuleRemoteType("cidr") + // VPCSecurityGroupRuleRemoteTypeAddress defines the destination or source for the Rule is an address. + VPCSecurityGroupRuleRemoteTypeAddress VPCSecurityGroupRuleRemoteType = VPCSecurityGroupRuleRemoteType("address") + // VPCSecurityGroupRuleRemoteTypeSG defines the destination or source for the Rule is a VPC Security Group. + VPCSecurityGroupRuleRemoteTypeSG VPCSecurityGroupRuleRemoteType = VPCSecurityGroupRuleRemoteType("sg") +) + +// IBMCloudResourceReference represents an IBM Cloud resource. +type IBMCloudResourceReference struct { + // id defines the IBM Cloud Resource ID. + // +required + ID string `json:"id"` + + // name defines the IBM Cloud Resource Name. + // +optional + Name *string `json:"name,omitempty"` +} + +// IBMCloudCatalogOffering represents an IBM Cloud Catalog Offering resource. +// +kubebuilder:validation:XValidation:rule="(has(self.offeringCRN) && !has(self.versionCRN)) || (!has(self.offeringCRN) && has(self.versionCRN))",message="either offeringCRN or version CRN must be provided, not both" +type IBMCloudCatalogOffering struct { + // OfferingCRN defines the IBM Cloud Catalog Offering CRN. Using the OfferingCRN expects that the latest version of the Offering will be used. + // If a specific version should be used instead, rely on VersionCRN. + // +optional + OfferingCRN *string `json:"offeringCRN,omitempty"` + + // PlanCRN defines the IBM Cloud Catalog Offering Plan CRN to use for the Offering. + // +optional + PlanCRN *string `json:"planCRN,omitempty"` + + // VersionCRN defines the IBM Cloud Catalog Offering Version CRN. A specific version of the Catalog Offering will be used, as defined by this CRN. + // +optional + VersionCRN *string `json:"versionCRN,omitempty"` +} + +// NetworkInterface holds the network interface information like subnet id. +type NetworkInterface struct { + // SecurityGroups defines a set of IBM Cloud VPC Security Groups to attach to the network interface. + // +optional + SecurityGroups []VPCResource `json:"securityGroups,omitempty"` + + // Subnet ID of the network interface. + Subnet string `json:"subnet,omitempty"` +} + +// VPCLoadBalancerBackendPoolMember represents a VPC Load Balancer Backend Pool Member. +type VPCLoadBalancerBackendPoolMember struct { + // LoadBalancer defines the Load Balancer the Pool Member is for. + // +required + LoadBalancer VPCResource `json:"loadBalancer"` + + // Pool defines the Load Balancer Pool the Pool Member should be in. + // +required + Pool VPCResource `json:"pool"` + + // Port defines the Port the Load Balancer Pool Member listens for traffic. + // +required + Port int64 `json:"port"` + + // Weight of the service member. Only applicable if the pool algorithm is "weighted_round_robin". + // +optional + Weight *int64 `json:"weight,omitempty"` +} + +// VPCMachinePlacementTarget represents a VPC Machine's placement restrictions. +// +kubebuilder:validation:XValidation:rule="(has(self.dedicatedHost) && !has(self.dedicatedHostGroup) && !has(self.placementGroup)) || (!has(self.dedicatedHost) && has(self.dedicatedHostGroup) && !has(self.placementGroup)) || (!has(self.dedicatedHost) && !has(self.dedicatedHostGroup) && has(self.placementGroup))",message="only one of dedicatedHost, dedicatedHostGroup, or placementGroup must be defined for machine placement" +type VPCMachinePlacementTarget struct { + // DedicatedHost defines the Dedicated Host to place a VPC Machine (Instance) on. + // +optional + DedicatedHost *VPCResource `json:"dedicatedHost,omitempty"` + + // DedicatedHostGroup defines the Dedicated Host Group to use when placing a VPC Machine (Instance). + // +optional + DedicatedHostGroup *VPCResource `json:"dedicatedHostGroup,omitempty"` + + // PlacementGroup defines the Placement Group to use when placing a VPC Machine (Instance). + // +optional + PlacementGroup *VPCResource `json:"placementGroup,omitempty"` +} + +// VPCSecurityGroupPortRange represents a range of ports, minimum to maximum. +// +kubebuilder:validation:XValidation:rule="self.maximumPort >= self.minimumPort",message="maximum port must be greater than or equal to minimum port" +type VPCSecurityGroupPortRange struct { + // maximumPort is the inclusive upper range of ports. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + MaximumPort int64 `json:"maximumPort,omitempty"` + + // minimumPort is the inclusive lower range of ports. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + MinimumPort int64 `json:"minimumPort,omitempty"` +} + +// VPCSecurityGroup defines a VPC Security Group that should exist or be created within the specified VPC, with the specified Security Group Rules. +// +kubebuilder:validation:XValidation:rule="has(self.id) || has(self.name)",message="either an id or name must be specified" +type VPCSecurityGroup struct { + // id of the Security Group. + // +optional + ID *string `json:"id,omitempty"` + + // name of the Security Group. + // +optional + Name *string `json:"name,omitempty"` + + // rules are the Security Group Rules for the Security Group. + // +optional + Rules []*VPCSecurityGroupRule `json:"rules,omitempty"` + + // tags are tags to add to the Security Group. + // +optional + Tags []*string `json:"tags,omitempty"` +} + +// VPCSecurityGroupRule defines a VPC Security Group Rule for a specified Security Group. +// +kubebuilder:validation:XValidation:rule="(has(self.destination) && !has(self.source)) || (!has(self.destination) && has(self.source))",message="both destination and source cannot be provided" +// +kubebuilder:validation:XValidation:rule="self.direction == 'inbound' ? has(self.source) : true",message="source must be set for VPCSecurityGroupRuleDirectionInbound direction" +// +kubebuilder:validation:XValidation:rule="self.direction == 'inbound' ? !has(self.destination) : true",message="destination is not valid for VPCSecurityGroupRuleDirectionInbound direction" +// +kubebuilder:validation:XValidation:rule="self.direction == 'outbound' ? has(self.destination) : true",message="destination must be set for VPCSecurityGroupRuleDirectionOutbound direction" +// +kubebuilder:validation:XValidation:rule="self.direction == 'outbound' ? !has(self.source) : true",message="source is not valid for VPCSecurityGroupRuleDirectionOutbound direction" +type VPCSecurityGroupRule struct { + // action defines whether to allow or deny traffic defined by the Security Group Rule. + // +required + Action VPCSecurityGroupRuleAction `json:"action"` + + // destination is a VPCSecurityGroupRulePrototype which defines the destination of outbound traffic for the Security Group Rule. + // Only used when direction is VPCSecurityGroupRuleDirectionOutbound. + // +optional + Destination *VPCSecurityGroupRulePrototype `json:"destination,omitempty"` + + // direction defines whether the traffic is inbound or outbound for the Security Group Rule. + // +required + Direction VPCSecurityGroupRuleDirection `json:"direction"` + + // securityGroupID is the ID of the Security Group for the Security Group Rule. + // +optional + SecurityGroupID *string `json:"securityGroupID,omitempty"` + + // source is a VPCSecurityGroupRulePrototype which defines the source of inbound traffic for the Security Group Rule. + // Only used when direction is VPCSecurityGroupRuleDirectionInbound. + // +optional + Source *VPCSecurityGroupRulePrototype `json:"source,omitempty"` +} + +// VPCSecurityGroupRuleRemote defines a VPC Security Group Rule's remote details. +// The type of remote defines the additional remote details where are used for defining the remote. +// +kubebuilder:validation:XValidation:rule="self.remoteType == 'any' ? (!has(self.cidrSubnetName) && !has(self.address) && !has(self.securityGroupName)) : true",message="cidrSubnetName, addresss, and securityGroupName are not valid for VPCSecurityGroupRuleRemoteTypeAny remoteType" +// +kubebuilder:validation:XValidation:rule="self.remoteType == 'cidr' ? (has(self.cidrSubnetName) && !has(self.address) && !has(self.securityGroupName)) : true",message="only cidrSubnetName is valid for VPCSecurityGroupRuleRemoteTypeCIDR remoteType" +// +kubebuilder:validation:XValidation:rule="self.remoteType == 'address' ? (has(self.address) && !has(self.cidrSubnetName) && !has(self.securityGroupName)) : true",message="only address is valid for VPCSecurityGroupRuleRemoteTypeIP remoteType" +// +kubebuilder:validation:XValidation:rule="self.remoteType == 'sg' ? (has(self.securityGroupName) && !has(self.cidrSubnetName) && !has(self.address)) : true",message="only securityGroupName is valid for VPCSecurityGroupRuleRemoteTypeSG remoteType" +type VPCSecurityGroupRuleRemote struct { + // cidrSubnetName is the name of the VPC Subnet to retrieve the CIDR from, to use for the remote's destination/source. + // Only used when remoteType is VPCSecurityGroupRuleRemoteTypeCIDR. + // +optional + CIDRSubnetName *string `json:"cidrSubnetName,omitempty"` + + // address is the address to use for the remote's destination/source. + // Only used when remoteType is VPCSecurityGroupRuleRemoteTypeAddress. + // +optional + Address *string `json:"address,omitempty"` + + // remoteType defines the type of filter to define for the remote's destination/source. + // +required + RemoteType VPCSecurityGroupRuleRemoteType `json:"remoteType"` + + // securityGroupName is the name of the VPC Security Group to use for the remote's destination/source. + // Only used when remoteType is VPCSecurityGroupRuleRemoteTypeSG + // +optional + SecurityGroupName *string `json:"securityGroupName,omitempty"` +} + +// VPCSecurityGroupRulePrototype defines a VPC Security Group Rule's traffic specifics for a series of remotes (destinations or sources). +// +kubebuilder:validation:XValidation:rule="self.protocol != 'icmp' ? (!has(self.icmpCode) && !has(self.icmpType)) : true",message="icmpCode and icmpType are only supported for VPCSecurityGroupRuleProtocolIcmp protocol" +// +kubebuilder:validation:XValidation:rule="self.protocol == 'all' ? !has(self.portRange) : true",message="portRange is not valid for VPCSecurityGroupRuleProtocolAll protocol" +// +kubebuilder:validation:XValidation:rule="self.protocol == 'icmp' ? !has(self.portRange) : true",message="portRange is not valid for VPCSecurityGroupRuleProtocolIcmp protocol" +type VPCSecurityGroupRulePrototype struct { + // icmpCode is the ICMP code for the Rule. + // Only used when Protocol is VPCSecurityGroupRuleProtocolIcmp. + // +optional + ICMPCode *int64 `json:"icmpCode,omitempty"` + + // icmpType is the ICMP type for the Rule. + // Only used when Protocol is VPCSecurityGroupRuleProtocolIcmp. + // +optional + ICMPType *int64 `json:"icmpType,omitempty"` + + // portRange is a range of ports allowed for the Rule's remote. + // +optional + PortRange *VPCSecurityGroupPortRange `json:"portRange,omitempty"` + + // protocol defines the traffic protocol used for the Security Group Rule. + // +required + Protocol VPCSecurityGroupRuleProtocol `json:"protocol"` + + // remotes is a set of VPCSecurityGroupRuleRemote's that define the traffic allowed by the Rule's remote. + // Specifying multiple VPCSecurityGroupRuleRemote's creates a unique Security Group Rule with the shared Protocol, PortRange, etc. + // This allows for easier management of Security Group Rule's for sets of CIDR's, IP's, etc. + Remotes []VPCSecurityGroupRuleRemote `json:"remotes"` +} + +// Subnet describes a subnet. +type Subnet struct { + Ipv4CidrBlock *string `json:"cidr,omitempty"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=63 + // +kubebuilder:validation:Pattern=`^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$` + Name *string `json:"name,omitempty"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength:=64 + // +kubebuilder:validation:Pattern=`^[-0-9a-z_]+$` + ID *string `json:"id,omitempty"` + Zone *string `json:"zone,omitempty"` +} + +// VPCEndpoint describes a VPCEndpoint. +type VPCEndpoint struct { + Address *string `json:"address"` + // +optional + // Deprecated: This field has no function and is going to be removed in the next release. + FIPID *string `json:"floatingIPID,omitempty"` + // +optional + LBID *string `json:"loadBalancerIPID,omitempty"` +} + +// ResourceStatus identifies a resource by id (and name) and whether it is ready. +type ResourceStatus struct { + // id defines the Id of the IBM Cloud resource status. + // +required + ID string `json:"id"` + + // name defines the name of the IBM Cloud resource status. + // +optional + Name *string `json:"name,omitempty"` + + // ready defines whether the IBM Cloud resource is ready. + // +required + Ready bool `json:"ready"` +} + +// Set sets the ResourceStatus fields. +func (s *ResourceStatus) Set(resource ResourceStatus) { + s.ID = resource.ID + // Set the name if it hasn't been, or the incoming name won't remove it (nil). + if s.Name == nil && resource.Name != nil { + s.Name = resource.Name + } + s.Ready = resource.Ready +} + +// VPCResource represents a VPC resource. +// +kubebuilder:validation:XValidation:rule="has(self.id) || has(self.name)",message="an id or name must be provided" +type VPCResource struct { + // id of the resource. + // +kubebuilder:validation:MinLength=1 + // +optional + ID *string `json:"id,omitempty"` + + // name of the resource. + // +kubebuilder:validation:MinLength=1 + // +optional + Name *string `json:"name,omitempty"` +} diff --git a/pkg/capi/ibmcloud/api/v1beta2/zz_generated.deepcopy.go b/pkg/capi/ibmcloud/api/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 000000000000..8f453b4f584d --- /dev/null +++ b/pkg/capi/ibmcloud/api/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,2409 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalListenerSpec) DeepCopyInto(out *AdditionalListenerSpec) { + *out = *in + if in.DefaultPoolName != nil { + in, out := &in.DefaultPoolName, &out.DefaultPoolName + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(VPCLoadBalancerListenerProtocol) + **out = **in + } + in.Selector.DeepCopyInto(&out.Selector) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalListenerSpec. +func (in *AdditionalListenerSpec) DeepCopy() *AdditionalListenerSpec { + if in == nil { + return nil + } + out := new(AdditionalListenerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CosInstance) DeepCopyInto(out *CosInstance) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosInstance. +func (in *CosInstance) DeepCopy() *CosInstance { + if in == nil { + return nil + } + out := new(CosInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DHCPServer) DeepCopyInto(out *DHCPServer) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.DNSServer != nil { + in, out := &in.DNSServer, &out.DNSServer + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Snat != nil { + in, out := &in.Snat, &out.Snat + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DHCPServer. +func (in *DHCPServer) DeepCopy() *DHCPServer { + if in == nil { + return nil + } + out := new(DHCPServer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMCloudCatalogOffering) DeepCopyInto(out *IBMCloudCatalogOffering) { + *out = *in + if in.OfferingCRN != nil { + in, out := &in.OfferingCRN, &out.OfferingCRN + *out = new(string) + **out = **in + } + if in.PlanCRN != nil { + in, out := &in.PlanCRN, &out.PlanCRN + *out = new(string) + **out = **in + } + if in.VersionCRN != nil { + in, out := &in.VersionCRN, &out.VersionCRN + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMCloudCatalogOffering. +func (in *IBMCloudCatalogOffering) DeepCopy() *IBMCloudCatalogOffering { + if in == nil { + return nil + } + out := new(IBMCloudCatalogOffering) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMCloudResourceReference) DeepCopyInto(out *IBMCloudResourceReference) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMCloudResourceReference. +func (in *IBMCloudResourceReference) DeepCopy() *IBMCloudResourceReference { + if in == nil { + return nil + } + out := new(IBMCloudResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSCluster) DeepCopyInto(out *IBMPowerVSCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSCluster. +func (in *IBMPowerVSCluster) DeepCopy() *IBMPowerVSCluster { + if in == nil { + return nil + } + out := new(IBMPowerVSCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterList) DeepCopyInto(out *IBMPowerVSClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMPowerVSCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterList. +func (in *IBMPowerVSClusterList) DeepCopy() *IBMPowerVSClusterList { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterSpec) DeepCopyInto(out *IBMPowerVSClusterSpec) { + *out = *in + in.Network.DeepCopyInto(&out.Network) + if in.DHCPServer != nil { + in, out := &in.DHCPServer, &out.DHCPServer + *out = new(DHCPServer) + (*in).DeepCopyInto(*out) + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.ServiceInstance != nil { + in, out := &in.ServiceInstance, &out.ServiceInstance + *out = new(IBMPowerVSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(IBMPowerVSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(VPCResourceReference) + (*in).DeepCopyInto(*out) + } + if in.VPCSubnets != nil { + in, out := &in.VPCSubnets, &out.VPCSubnets + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VPCSecurityGroups != nil { + in, out := &in.VPCSecurityGroups, &out.VPCSecurityGroups + *out = make([]VPCSecurityGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TransitGateway != nil { + in, out := &in.TransitGateway, &out.TransitGateway + *out = new(TransitGateway) + (*in).DeepCopyInto(*out) + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make([]VPCLoadBalancerSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CosInstance != nil { + in, out := &in.CosInstance, &out.CosInstance + *out = new(CosInstance) + **out = **in + } + if in.Ignition != nil { + in, out := &in.Ignition, &out.Ignition + *out = new(Ignition) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterSpec. +func (in *IBMPowerVSClusterSpec) DeepCopy() *IBMPowerVSClusterSpec { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterStatus) DeepCopyInto(out *IBMPowerVSClusterStatus) { + *out = *in + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.ServiceInstance != nil { + in, out := &in.ServiceInstance, &out.ServiceInstance + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.DHCPServer != nil { + in, out := &in.DHCPServer, &out.DHCPServer + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.VPCSubnet != nil { + in, out := &in.VPCSubnet, &out.VPCSubnet + *out = make(map[string]ResourceReference, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.VPCSecurityGroups != nil { + in, out := &in.VPCSecurityGroups, &out.VPCSecurityGroups + *out = make(map[string]VPCSecurityGroupStatus, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.TransitGateway != nil { + in, out := &in.TransitGateway, &out.TransitGateway + *out = new(TransitGatewayStatus) + (*in).DeepCopyInto(*out) + } + if in.COSInstance != nil { + in, out := &in.COSInstance, &out.COSInstance + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make(map[string]VPCLoadBalancerStatus, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(IBMPowerVSClusterV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterStatus. +func (in *IBMPowerVSClusterStatus) DeepCopy() *IBMPowerVSClusterStatus { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterTemplate) DeepCopyInto(out *IBMPowerVSClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterTemplate. +func (in *IBMPowerVSClusterTemplate) DeepCopy() *IBMPowerVSClusterTemplate { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterTemplateList) DeepCopyInto(out *IBMPowerVSClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMPowerVSClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterTemplateList. +func (in *IBMPowerVSClusterTemplateList) DeepCopy() *IBMPowerVSClusterTemplateList { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterTemplateResource) DeepCopyInto(out *IBMPowerVSClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterTemplateResource. +func (in *IBMPowerVSClusterTemplateResource) DeepCopy() *IBMPowerVSClusterTemplateResource { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterTemplateSpec) DeepCopyInto(out *IBMPowerVSClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterTemplateSpec. +func (in *IBMPowerVSClusterTemplateSpec) DeepCopy() *IBMPowerVSClusterTemplateSpec { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSClusterV1Beta2Status) DeepCopyInto(out *IBMPowerVSClusterV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSClusterV1Beta2Status. +func (in *IBMPowerVSClusterV1Beta2Status) DeepCopy() *IBMPowerVSClusterV1Beta2Status { + if in == nil { + return nil + } + out := new(IBMPowerVSClusterV1Beta2Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSImage) DeepCopyInto(out *IBMPowerVSImage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSImage. +func (in *IBMPowerVSImage) DeepCopy() *IBMPowerVSImage { + if in == nil { + return nil + } + out := new(IBMPowerVSImage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSImage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSImageList) DeepCopyInto(out *IBMPowerVSImageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMPowerVSImage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSImageList. +func (in *IBMPowerVSImageList) DeepCopy() *IBMPowerVSImageList { + if in == nil { + return nil + } + out := new(IBMPowerVSImageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSImageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSImageSpec) DeepCopyInto(out *IBMPowerVSImageSpec) { + *out = *in + if in.ServiceInstance != nil { + in, out := &in.ServiceInstance, &out.ServiceInstance + *out = new(IBMPowerVSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.Bucket != nil { + in, out := &in.Bucket, &out.Bucket + *out = new(string) + **out = **in + } + if in.Object != nil { + in, out := &in.Object, &out.Object + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSImageSpec. +func (in *IBMPowerVSImageSpec) DeepCopy() *IBMPowerVSImageSpec { + if in == nil { + return nil + } + out := new(IBMPowerVSImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSImageStatus) DeepCopyInto(out *IBMPowerVSImageStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(IBMPowerVSImageV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSImageStatus. +func (in *IBMPowerVSImageStatus) DeepCopy() *IBMPowerVSImageStatus { + if in == nil { + return nil + } + out := new(IBMPowerVSImageStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSImageV1Beta2Status) DeepCopyInto(out *IBMPowerVSImageV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSImageV1Beta2Status. +func (in *IBMPowerVSImageV1Beta2Status) DeepCopy() *IBMPowerVSImageV1Beta2Status { + if in == nil { + return nil + } + out := new(IBMPowerVSImageV1Beta2Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachine) DeepCopyInto(out *IBMPowerVSMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachine. +func (in *IBMPowerVSMachine) DeepCopy() *IBMPowerVSMachine { + if in == nil { + return nil + } + out := new(IBMPowerVSMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineList) DeepCopyInto(out *IBMPowerVSMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMPowerVSMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineList. +func (in *IBMPowerVSMachineList) DeepCopy() *IBMPowerVSMachineList { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineSpec) DeepCopyInto(out *IBMPowerVSMachineSpec) { + *out = *in + if in.ServiceInstance != nil { + in, out := &in.ServiceInstance, &out.ServiceInstance + *out = new(IBMPowerVSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(IBMPowerVSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.ImageRef != nil { + in, out := &in.ImageRef, &out.ImageRef + *out = new(corev1.LocalObjectReference) + **out = **in + } + out.Processors = in.Processors + in.Network.DeepCopyInto(&out.Network) + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineSpec. +func (in *IBMPowerVSMachineSpec) DeepCopy() *IBMPowerVSMachineSpec { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineStatus) DeepCopyInto(out *IBMPowerVSMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]corev1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(IBMPowerVSMachineV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineStatus. +func (in *IBMPowerVSMachineStatus) DeepCopy() *IBMPowerVSMachineStatus { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineTemplate) DeepCopyInto(out *IBMPowerVSMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineTemplate. +func (in *IBMPowerVSMachineTemplate) DeepCopy() *IBMPowerVSMachineTemplate { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineTemplateList) DeepCopyInto(out *IBMPowerVSMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMPowerVSMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineTemplateList. +func (in *IBMPowerVSMachineTemplateList) DeepCopy() *IBMPowerVSMachineTemplateList { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMPowerVSMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineTemplateResource) DeepCopyInto(out *IBMPowerVSMachineTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineTemplateResource. +func (in *IBMPowerVSMachineTemplateResource) DeepCopy() *IBMPowerVSMachineTemplateResource { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineTemplateSpec) DeepCopyInto(out *IBMPowerVSMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineTemplateSpec. +func (in *IBMPowerVSMachineTemplateSpec) DeepCopy() *IBMPowerVSMachineTemplateSpec { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineTemplateStatus) DeepCopyInto(out *IBMPowerVSMachineTemplateStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineTemplateStatus. +func (in *IBMPowerVSMachineTemplateStatus) DeepCopy() *IBMPowerVSMachineTemplateStatus { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSMachineV1Beta2Status) DeepCopyInto(out *IBMPowerVSMachineV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSMachineV1Beta2Status. +func (in *IBMPowerVSMachineV1Beta2Status) DeepCopy() *IBMPowerVSMachineV1Beta2Status { + if in == nil { + return nil + } + out := new(IBMPowerVSMachineV1Beta2Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMPowerVSResourceReference) DeepCopyInto(out *IBMPowerVSResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RegEx != nil { + in, out := &in.RegEx, &out.RegEx + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMPowerVSResourceReference. +func (in *IBMPowerVSResourceReference) DeepCopy() *IBMPowerVSResourceReference { + if in == nil { + return nil + } + out := new(IBMPowerVSResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCCluster) DeepCopyInto(out *IBMVPCCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCCluster. +func (in *IBMVPCCluster) DeepCopy() *IBMVPCCluster { + if in == nil { + return nil + } + out := new(IBMVPCCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterList) DeepCopyInto(out *IBMVPCClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMVPCCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterList. +func (in *IBMVPCClusterList) DeepCopy() *IBMVPCClusterList { + if in == nil { + return nil + } + out := new(IBMVPCClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterSpec) DeepCopyInto(out *IBMVPCClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.ControlPlaneLoadBalancer != nil { + in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer + *out = new(VPCLoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageSpec) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(VPCNetworkSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterSpec. +func (in *IBMVPCClusterSpec) DeepCopy() *IBMVPCClusterSpec { + if in == nil { + return nil + } + out := new(IBMVPCClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterStatus) DeepCopyInto(out *IBMVPCClusterStatus) { + *out = *in + out.VPC = in.VPC + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(VPCNetworkStatus) + (*in).DeepCopyInto(*out) + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + in.Subnet.DeepCopyInto(&out.Subnet) + in.VPCEndpoint.DeepCopyInto(&out.VPCEndpoint) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(IBMVPCClusterV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterStatus. +func (in *IBMVPCClusterStatus) DeepCopy() *IBMVPCClusterStatus { + if in == nil { + return nil + } + out := new(IBMVPCClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterTemplate) DeepCopyInto(out *IBMVPCClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterTemplate. +func (in *IBMVPCClusterTemplate) DeepCopy() *IBMVPCClusterTemplate { + if in == nil { + return nil + } + out := new(IBMVPCClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterTemplateList) DeepCopyInto(out *IBMVPCClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMVPCClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterTemplateList. +func (in *IBMVPCClusterTemplateList) DeepCopy() *IBMVPCClusterTemplateList { + if in == nil { + return nil + } + out := new(IBMVPCClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterTemplateResource) DeepCopyInto(out *IBMVPCClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterTemplateResource. +func (in *IBMVPCClusterTemplateResource) DeepCopy() *IBMVPCClusterTemplateResource { + if in == nil { + return nil + } + out := new(IBMVPCClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterTemplateSpec) DeepCopyInto(out *IBMVPCClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterTemplateSpec. +func (in *IBMVPCClusterTemplateSpec) DeepCopy() *IBMVPCClusterTemplateSpec { + if in == nil { + return nil + } + out := new(IBMVPCClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCClusterV1Beta2Status) DeepCopyInto(out *IBMVPCClusterV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterV1Beta2Status. +func (in *IBMVPCClusterV1Beta2Status) DeepCopy() *IBMVPCClusterV1Beta2Status { + if in == nil { + return nil + } + out := new(IBMVPCClusterV1Beta2Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachine) DeepCopyInto(out *IBMVPCMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachine. +func (in *IBMVPCMachine) DeepCopy() *IBMVPCMachine { + if in == nil { + return nil + } + out := new(IBMVPCMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineList) DeepCopyInto(out *IBMVPCMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMVPCMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineList. +func (in *IBMVPCMachineList) DeepCopy() *IBMVPCMachineList { + if in == nil { + return nil + } + out := new(IBMVPCMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineSpec) DeepCopyInto(out *IBMVPCMachineSpec) { + *out = *in + if in.CatalogOffering != nil { + in, out := &in.CatalogOffering, &out.CatalogOffering + *out = new(IBMCloudCatalogOffering) + (*in).DeepCopyInto(*out) + } + if in.PlacementTarget != nil { + in, out := &in.PlacementTarget, &out.PlacementTarget + *out = new(VPCMachinePlacementTarget) + (*in).DeepCopyInto(*out) + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(IBMVPCResourceReference) + (*in).DeepCopyInto(*out) + } + if in.LoadBalancerPoolMembers != nil { + in, out := &in.LoadBalancerPoolMembers, &out.LoadBalancerPoolMembers + *out = make([]VPCLoadBalancerBackendPoolMember, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BootVolume != nil { + in, out := &in.BootVolume, &out.BootVolume + *out = new(VPCVolume) + **out = **in + } + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + in.PrimaryNetworkInterface.DeepCopyInto(&out.PrimaryNetworkInterface) + if in.SSHKeys != nil { + in, out := &in.SSHKeys, &out.SSHKeys + *out = make([]*IBMVPCResourceReference, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(IBMVPCResourceReference) + (*in).DeepCopyInto(*out) + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineSpec. +func (in *IBMVPCMachineSpec) DeepCopy() *IBMVPCMachineSpec { + if in == nil { + return nil + } + out := new(IBMVPCMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineStatus) DeepCopyInto(out *IBMVPCMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]corev1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(string) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.LoadBalancerPoolMembers != nil { + in, out := &in.LoadBalancerPoolMembers, &out.LoadBalancerPoolMembers + *out = make([]VPCLoadBalancerBackendPoolMember, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(IBMVPCMachineV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineStatus. +func (in *IBMVPCMachineStatus) DeepCopy() *IBMVPCMachineStatus { + if in == nil { + return nil + } + out := new(IBMVPCMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineTemplate) DeepCopyInto(out *IBMVPCMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineTemplate. +func (in *IBMVPCMachineTemplate) DeepCopy() *IBMVPCMachineTemplate { + if in == nil { + return nil + } + out := new(IBMVPCMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineTemplateList) DeepCopyInto(out *IBMVPCMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IBMVPCMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineTemplateList. +func (in *IBMVPCMachineTemplateList) DeepCopy() *IBMVPCMachineTemplateList { + if in == nil { + return nil + } + out := new(IBMVPCMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IBMVPCMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineTemplateResource) DeepCopyInto(out *IBMVPCMachineTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineTemplateResource. +func (in *IBMVPCMachineTemplateResource) DeepCopy() *IBMVPCMachineTemplateResource { + if in == nil { + return nil + } + out := new(IBMVPCMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineTemplateSpec) DeepCopyInto(out *IBMVPCMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineTemplateSpec. +func (in *IBMVPCMachineTemplateSpec) DeepCopy() *IBMVPCMachineTemplateSpec { + if in == nil { + return nil + } + out := new(IBMVPCMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineTemplateStatus) DeepCopyInto(out *IBMVPCMachineTemplateStatus) { + *out = *in + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineTemplateStatus. +func (in *IBMVPCMachineTemplateStatus) DeepCopy() *IBMVPCMachineTemplateStatus { + if in == nil { + return nil + } + out := new(IBMVPCMachineTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCMachineV1Beta2Status) DeepCopyInto(out *IBMVPCMachineV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCMachineV1Beta2Status. +func (in *IBMVPCMachineV1Beta2Status) DeepCopy() *IBMVPCMachineV1Beta2Status { + if in == nil { + return nil + } + out := new(IBMVPCMachineV1Beta2Status) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IBMVPCResourceReference) DeepCopyInto(out *IBMVPCResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCResourceReference. +func (in *IBMVPCResourceReference) DeepCopy() *IBMVPCResourceReference { + if in == nil { + return nil + } + out := new(IBMVPCResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Ignition) DeepCopyInto(out *Ignition) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ignition. +func (in *Ignition) DeepCopy() *Ignition { + if in == nil { + return nil + } + out := new(Ignition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageSpec) DeepCopyInto(out *ImageSpec) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.CRN != nil { + in, out := &in.CRN, &out.CRN + *out = new(string) + **out = **in + } + if in.COSInstance != nil { + in, out := &in.COSInstance, &out.COSInstance + *out = new(string) + **out = **in + } + if in.COSBucket != nil { + in, out := &in.COSBucket, &out.COSBucket + *out = new(string) + **out = **in + } + if in.COSBucketRegion != nil { + in, out := &in.COSBucketRegion, &out.COSBucketRegion + *out = new(string) + **out = **in + } + if in.COSObject != nil { + in, out := &in.COSObject, &out.COSObject + *out = new(string) + **out = **in + } + if in.OperatingSystem != nil { + in, out := &in.OperatingSystem, &out.OperatingSystem + *out = new(string) + **out = **in + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(IBMCloudResourceReference) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec. +func (in *ImageSpec) DeepCopy() *ImageSpec { + if in == nil { + return nil + } + out := new(ImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkInterface) DeepCopyInto(out *NetworkInterface) { + *out = *in + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]VPCResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkInterface. +func (in *NetworkInterface) DeepCopy() *NetworkInterface { + if in == nil { + return nil + } + out := new(NetworkInterface) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceReference) DeepCopyInto(out *ResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ControllerCreated != nil { + in, out := &in.ControllerCreated, &out.ControllerCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. +func (in *ResourceReference) DeepCopy() *ResourceReference { + if in == nil { + return nil + } + out := new(ResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus. +func (in *ResourceStatus) DeepCopy() *ResourceStatus { + if in == nil { + return nil + } + out := new(ResourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subnet) DeepCopyInto(out *Subnet) { + *out = *in + if in.Ipv4CidrBlock != nil { + in, out := &in.Ipv4CidrBlock, &out.Ipv4CidrBlock + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. +func (in *Subnet) DeepCopy() *Subnet { + if in == nil { + return nil + } + out := new(Subnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TransitGateway) DeepCopyInto(out *TransitGateway) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.GlobalRouting != nil { + in, out := &in.GlobalRouting, &out.GlobalRouting + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TransitGateway. +func (in *TransitGateway) DeepCopy() *TransitGateway { + if in == nil { + return nil + } + out := new(TransitGateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TransitGatewayStatus) DeepCopyInto(out *TransitGatewayStatus) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ControllerCreated != nil { + in, out := &in.ControllerCreated, &out.ControllerCreated + *out = new(bool) + **out = **in + } + if in.VPCConnection != nil { + in, out := &in.VPCConnection, &out.VPCConnection + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } + if in.PowerVSConnection != nil { + in, out := &in.PowerVSConnection, &out.PowerVSConnection + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TransitGatewayStatus. +func (in *TransitGatewayStatus) DeepCopy() *TransitGatewayStatus { + if in == nil { + return nil + } + out := new(TransitGatewayStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPC) DeepCopyInto(out *VPC) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPC. +func (in *VPC) DeepCopy() *VPC { + if in == nil { + return nil + } + out := new(VPC) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCEndpoint) DeepCopyInto(out *VPCEndpoint) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.FIPID != nil { + in, out := &in.FIPID, &out.FIPID + *out = new(string) + **out = **in + } + if in.LBID != nil { + in, out := &in.LBID, &out.LBID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCEndpoint. +func (in *VPCEndpoint) DeepCopy() *VPCEndpoint { + if in == nil { + return nil + } + out := new(VPCEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCLoadBalancerBackendPoolMember) DeepCopyInto(out *VPCLoadBalancerBackendPoolMember) { + *out = *in + in.LoadBalancer.DeepCopyInto(&out.LoadBalancer) + in.Pool.DeepCopyInto(&out.Pool) + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCLoadBalancerBackendPoolMember. +func (in *VPCLoadBalancerBackendPoolMember) DeepCopy() *VPCLoadBalancerBackendPoolMember { + if in == nil { + return nil + } + out := new(VPCLoadBalancerBackendPoolMember) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCLoadBalancerBackendPoolSpec) DeepCopyInto(out *VPCLoadBalancerBackendPoolSpec) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + in.HealthMonitor.DeepCopyInto(&out.HealthMonitor) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCLoadBalancerBackendPoolSpec. +func (in *VPCLoadBalancerBackendPoolSpec) DeepCopy() *VPCLoadBalancerBackendPoolSpec { + if in == nil { + return nil + } + out := new(VPCLoadBalancerBackendPoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCLoadBalancerHealthMonitorSpec) DeepCopyInto(out *VPCLoadBalancerHealthMonitorSpec) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int64) + **out = **in + } + if in.URLPath != nil { + in, out := &in.URLPath, &out.URLPath + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCLoadBalancerHealthMonitorSpec. +func (in *VPCLoadBalancerHealthMonitorSpec) DeepCopy() *VPCLoadBalancerHealthMonitorSpec { + if in == nil { + return nil + } + out := new(VPCLoadBalancerHealthMonitorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCLoadBalancerSpec) DeepCopyInto(out *VPCLoadBalancerSpec) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.AdditionalListeners != nil { + in, out := &in.AdditionalListeners, &out.AdditionalListeners + *out = make([]AdditionalListenerSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BackendPools != nil { + in, out := &in.BackendPools, &out.BackendPools + *out = make([]VPCLoadBalancerBackendPoolSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]VPCResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]VPCResource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCLoadBalancerSpec. +func (in *VPCLoadBalancerSpec) DeepCopy() *VPCLoadBalancerSpec { + if in == nil { + return nil + } + out := new(VPCLoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCLoadBalancerStatus) DeepCopyInto(out *VPCLoadBalancerStatus) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.ControllerCreated != nil { + in, out := &in.ControllerCreated, &out.ControllerCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCLoadBalancerStatus. +func (in *VPCLoadBalancerStatus) DeepCopy() *VPCLoadBalancerStatus { + if in == nil { + return nil + } + out := new(VPCLoadBalancerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCMachinePlacementTarget) DeepCopyInto(out *VPCMachinePlacementTarget) { + *out = *in + if in.DedicatedHost != nil { + in, out := &in.DedicatedHost, &out.DedicatedHost + *out = new(VPCResource) + (*in).DeepCopyInto(*out) + } + if in.DedicatedHostGroup != nil { + in, out := &in.DedicatedHostGroup, &out.DedicatedHostGroup + *out = new(VPCResource) + (*in).DeepCopyInto(*out) + } + if in.PlacementGroup != nil { + in, out := &in.PlacementGroup, &out.PlacementGroup + *out = new(VPCResource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCMachinePlacementTarget. +func (in *VPCMachinePlacementTarget) DeepCopy() *VPCMachinePlacementTarget { + if in == nil { + return nil + } + out := new(VPCMachinePlacementTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNetworkSpec) DeepCopyInto(out *VPCNetworkSpec) { + *out = *in + if in.ControlPlaneSubnets != nil { + in, out := &in.ControlPlaneSubnets, &out.ControlPlaneSubnets + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make([]VPCLoadBalancerSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(IBMCloudResourceReference) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]VPCSecurityGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.WorkerSubnets != nil { + in, out := &in.WorkerSubnets, &out.WorkerSubnets + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(VPCResource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNetworkSpec. +func (in *VPCNetworkSpec) DeepCopy() *VPCNetworkSpec { + if in == nil { + return nil + } + out := new(VPCNetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNetworkStatus) DeepCopyInto(out *VPCNetworkStatus) { + *out = *in + if in.ControlPlaneSubnets != nil { + in, out := &in.ControlPlaneSubnets, &out.ControlPlaneSubnets + *out = make(map[string]*ResourceStatus, len(*in)) + for key, val := range *in { + var outVal *ResourceStatus + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.LoadBalancers != nil { + in, out := &in.LoadBalancers, &out.LoadBalancers + *out = make(map[string]*VPCLoadBalancerStatus, len(*in)) + for key, val := range *in { + var outVal *VPCLoadBalancerStatus + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(VPCLoadBalancerStatus) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.PublicGateways != nil { + in, out := &in.PublicGateways, &out.PublicGateways + *out = make(map[string]*ResourceStatus, len(*in)) + for key, val := range *in { + var outVal *ResourceStatus + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.ResourceGroup != nil { + in, out := &in.ResourceGroup, &out.ResourceGroup + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make(map[string]*ResourceStatus, len(*in)) + for key, val := range *in { + var outVal *ResourceStatus + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.WorkerSubnets != nil { + in, out := &in.WorkerSubnets, &out.WorkerSubnets + *out = make(map[string]*ResourceStatus, len(*in)) + for key, val := range *in { + var outVal *ResourceStatus + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(ResourceStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNetworkStatus. +func (in *VPCNetworkStatus) DeepCopy() *VPCNetworkStatus { + if in == nil { + return nil + } + out := new(VPCNetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCResource) DeepCopyInto(out *VPCResource) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCResource. +func (in *VPCResource) DeepCopy() *VPCResource { + if in == nil { + return nil + } + out := new(VPCResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCResourceReference) DeepCopyInto(out *VPCResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCResourceReference. +func (in *VPCResourceReference) DeepCopy() *VPCResourceReference { + if in == nil { + return nil + } + out := new(VPCResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroup) DeepCopyInto(out *VPCSecurityGroup) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]*VPCSecurityGroupRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(VPCSecurityGroupRule) + (*in).DeepCopyInto(*out) + } + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroup. +func (in *VPCSecurityGroup) DeepCopy() *VPCSecurityGroup { + if in == nil { + return nil + } + out := new(VPCSecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroupPortRange) DeepCopyInto(out *VPCSecurityGroupPortRange) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroupPortRange. +func (in *VPCSecurityGroupPortRange) DeepCopy() *VPCSecurityGroupPortRange { + if in == nil { + return nil + } + out := new(VPCSecurityGroupPortRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroupRule) DeepCopyInto(out *VPCSecurityGroupRule) { + *out = *in + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(VPCSecurityGroupRulePrototype) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroupID != nil { + in, out := &in.SecurityGroupID, &out.SecurityGroupID + *out = new(string) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(VPCSecurityGroupRulePrototype) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroupRule. +func (in *VPCSecurityGroupRule) DeepCopy() *VPCSecurityGroupRule { + if in == nil { + return nil + } + out := new(VPCSecurityGroupRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroupRulePrototype) DeepCopyInto(out *VPCSecurityGroupRulePrototype) { + *out = *in + if in.ICMPCode != nil { + in, out := &in.ICMPCode, &out.ICMPCode + *out = new(int64) + **out = **in + } + if in.ICMPType != nil { + in, out := &in.ICMPType, &out.ICMPType + *out = new(int64) + **out = **in + } + if in.PortRange != nil { + in, out := &in.PortRange, &out.PortRange + *out = new(VPCSecurityGroupPortRange) + **out = **in + } + if in.Remotes != nil { + in, out := &in.Remotes, &out.Remotes + *out = make([]VPCSecurityGroupRuleRemote, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroupRulePrototype. +func (in *VPCSecurityGroupRulePrototype) DeepCopy() *VPCSecurityGroupRulePrototype { + if in == nil { + return nil + } + out := new(VPCSecurityGroupRulePrototype) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroupRuleRemote) DeepCopyInto(out *VPCSecurityGroupRuleRemote) { + *out = *in + if in.CIDRSubnetName != nil { + in, out := &in.CIDRSubnetName, &out.CIDRSubnetName + *out = new(string) + **out = **in + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.SecurityGroupName != nil { + in, out := &in.SecurityGroupName, &out.SecurityGroupName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroupRuleRemote. +func (in *VPCSecurityGroupRuleRemote) DeepCopy() *VPCSecurityGroupRuleRemote { + if in == nil { + return nil + } + out := new(VPCSecurityGroupRuleRemote) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSecurityGroupStatus) DeepCopyInto(out *VPCSecurityGroupStatus) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.RuleIDs != nil { + in, out := &in.RuleIDs, &out.RuleIDs + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ControllerCreated != nil { + in, out := &in.ControllerCreated, &out.ControllerCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSecurityGroupStatus. +func (in *VPCSecurityGroupStatus) DeepCopy() *VPCSecurityGroupStatus { + if in == nil { + return nil + } + out := new(VPCSecurityGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCVolume) DeepCopyInto(out *VPCVolume) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCVolume. +func (in *VPCVolume) DeepCopy() *VPCVolume { + if in == nil { + return nil + } + out := new(VPCVolume) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/ibmcloud/go.mod b/pkg/capi/ibmcloud/go.mod new file mode 100644 index 000000000000..60c2201892e5 --- /dev/null +++ b/pkg/capi/ibmcloud/go.mod @@ -0,0 +1,56 @@ +module sigs.k8s.io/cluster-api-provider-ibmcloud + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/pkg/capi/kubevirt/api/v1alpha1/condition_consts.go b/pkg/capi/kubevirt/api/v1alpha1/condition_consts.go new file mode 100644 index 000000000000..7848d632821c --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/condition_consts.go @@ -0,0 +1,72 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019 + +// Conditions and condition Reasons for the KubevirtMachine object + +const ( + // VMProvisionedCondition documents the status of the provisioning of the VM + // generated by a KubevirtMachine. + VMProvisionedCondition clusterv1.ConditionType = "VMProvisioned" + + // WaitingForClusterInfrastructureReason (Severity=Info) documents a KubevirtMachine waiting for the cluster + // infrastructure to be ready before starting to create the container that provides the KubevirtMachine + // infrastructure. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + + // WaitingForBootstrapDataReason (Severity=Info) documents a KubevirtMachine waiting for the bootstrap + // script to be ready before starting to create the VM that provides the KubevirtMachine infrastructure. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" + + // VMCreateFailed (Severity=Error) documents a KubevirtMachine that is unable to create the + // corresponding VM object. + VMCreateFailedReason = "VMCreateFailed" + + // VMLiveMigratableCondition documents whether the VM is live-migratable or not + VMLiveMigratableCondition clusterv1.ConditionType = "VMLiveMigratable" +) + +const ( + // BootstrapExecSucceededCondition provides an observation of the KubevirtMachine bootstrap process. + // It is set based on successful execution of bootstrap commands and on the existence of + // the /run/cluster-api/bootstrap-success.complete file. + // The condition gets generated after VMProvisionedCondition is True. + BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded" + + // BootstrappingReason documents (Severity=Info) a KubevirtMachine currently executing the bootstrap + // script that creates the Kubernetes node on the newly provisioned machine infrastructure. + BootstrappingReason = "Bootstrapping" + + // BootstrapFailedReason documents (Severity=Warning) a KubevirtMachine controller detecting an error while + // bootstrapping the Kubernetes node on the machine just provisioned; those kind of errors are usually + // transient and failed bootstrap are automatically re-tried by the controller. + BootstrapFailedReason = "BootstrapFailed" +) + +// Conditions and condition Reasons for the KubevirtCluster object + +const ( + // LoadBalancerAvailableCondition documents the availability of the service that implements the cluster load balancer. + LoadBalancerAvailableCondition clusterv1.ConditionType = "LoadBalancerAvailable" + + // LoadBalancerProvisioningFailedReason (Severity=Warning) documents a KubevirtCluster controller detecting + // an error while provisioning the service that provides the cluster load balancer; those kind of + // errors are usually transient and failed provisioning are automatically re-tried by the controller. + LoadBalancerProvisioningFailedReason = "LoadBalancerProvisioningFailed" +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_conversion.go b/pkg/capi/kubevirt/api/v1alpha1/doc.go similarity index 76% rename from vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_conversion.go rename to pkg/capi/kubevirt/api/v1alpha1/doc.go index 78006525fbf3..fb95f0676289 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_conversion.go +++ b/pkg/capi/kubevirt/api/v1alpha1/doc.go @@ -14,10 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 - -// Hub marks AzureMachine as a conversion hub. -func (*AzureMachine) Hub() {} - -// Hub marks AzureMachineList as a conversion hub. -func (*AzureMachineList) Hub() {} +package v1alpha1 diff --git a/pkg/capi/kubevirt/api/v1alpha1/groupversion_info.go b/pkg/capi/kubevirt/api/v1alpha1/groupversion_info.go new file mode 100644 index 000000000000..4850cf9d163a --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the infrastructure v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/capi/kubevirt/api/v1alpha1/kubevirtcluster_types.go b/pkg/capi/kubevirt/api/v1alpha1/kubevirtcluster_types.go new file mode 100644 index 000000000000..618b7b103df5 --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/kubevirtcluster_types.go @@ -0,0 +1,162 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019 +) + +const ( + // ClusterFinalizer allows KubevirtClusterReconciler to clean up resources associated with KubevirtCluster before + // removing it from the apiserver. + ClusterFinalizer = "kubevirtcluster.infrastructure.cluster.x-k8s.io" +) + +const ( // labels + KubevirtMachineNameLabel = "capk.cluster.x-k8s.io/kubevirt-machine-name" + KubevirtMachineNamespaceLabel = "capk.cluster.x-k8s.io/kubevirt-machine-namespace" + + KubevirtMachineVMTerminalLabel = "capk.cluster.x-k8s.io/vm-is-terminal" +) + +const ( // annotations + VmiDeletionGraceTime = "capk.cluster.x-k8s.io/vmi-deletion-grace-time" + VmiDeletionGraceTimeEscape = "capk.cluster.x-k8s.io~1vmi-deletion-grace-time" +) + +// KubevirtClusterSpec defines the desired state of KubevirtCluster. +type KubevirtClusterSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint,omitempty"` + + // ControlPlaneServiceTemplate can be used to modify service that fronts the control plane nodes to handle the + // api-server traffic (port 6443). This field is optional, by default control plane nodes will use a service + // of type ClusterIP, which will make workload cluster only accessible within the same cluster. Note, this does + // not aim to expose the entire Service spec to users, but only provides capability to modify the service metadata + // and the service type. + // +optional + ControlPlaneServiceTemplate ControlPlaneServiceTemplate `json:"controlPlaneServiceTemplate,omitempty"` + + // SSHKeys is a reference to a local struct for SSH keys persistence. + // +optional + SshKeys SSHKeys `json:"sshKeys,omitempty"` + + // InfraClusterSecretRef is a reference to a secret with a kubeconfig for external cluster used for infra. + // +optional + InfraClusterSecretRef *corev1.ObjectReference `json:"infraClusterSecretRef,omitempty"` +} + +// KubevirtClusterStatus defines the observed state of KubevirtCluster. +type KubevirtClusterStatus struct { + // Ready denotes that the infrastructure is ready. + // +kubebuilder:default:=false + Ready bool `json:"ready"` + + // FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API + // will use this if we populate it. + FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + + // Conditions defines current service state of the KubevirtCluster. + // +optional + Conditions []clusterv1.Condition `json:"conditions,omitempty"` +} + +// APIEndpoint represents a reachable Kubernetes API endpoint. +type APIEndpoint struct { + // Host is the hostname on which the API server is serving. + Host string `json:"host"` + + // Port is the port on which the API server is serving. + Port int `json:"port"` +} + +// SSHKeys encapsulates fields for SSH keys persistence. +type SSHKeys struct { + // ConfigRef is a reference to a resource containing the keys. + // The reference is optional to allow users/operators to specify + // Bootstrap.DataSecretName without the need of a controller. + // +optional + ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"` + + // DataSecretName is the name of the secret that stores ssh keys. + // +optional + DataSecretName *string `json:"dataSecretName,omitempty"` +} + +// ControlPlaneServiceTemplate describes the template for the control plane service. +type ControlPlaneServiceTemplate struct { + // Service metadata allows to set labels, annotations and namespace for the service. + // When infraClusterSecretRef is used, ControlPlaneService take the kubeconfig namespace by default if metadata.namespace is not specified. + // This field is optional. + // +kubebuilder:pruning:PreserveUnknownFields + // +nullable + ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"` + // Service specification allows to override some fields in the service spec. + // Note, it does not aim cover all fields of the service spec. + // +optional + Spec ServiceSpecTemplate `json:"spec,omitempty"` +} + +// ServiceSpecTemplate describes the service spec template. +type ServiceSpecTemplate struct { + // Type determines how the Service is exposed. Defaults to ClusterIP. Valid + // options are ExternalName, ClusterIP, NodePort, and LoadBalancer. + // More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + // +optional + Type corev1.ServiceType `json:"type,omitempty"` +} + +// +kubebuilder:resource:path=kubevirtclusters,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:object:root=true + +// KubevirtCluster is the Schema for the kubevirtclusters API. +type KubevirtCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec KubevirtClusterSpec `json:"spec,omitempty"` + Status KubevirtClusterStatus `json:"status,omitempty"` +} + +func (c *KubevirtCluster) GetConditions() clusterv1.Conditions { + return c.Status.Conditions +} + +func (c *KubevirtCluster) SetConditions(conditions clusterv1.Conditions) { + c.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// KubevirtClusterList contains a list of KubevirtCluster. +type KubevirtClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []KubevirtCluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&KubevirtCluster{}, &KubevirtClusterList{}) +} diff --git a/pkg/capi/kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go b/pkg/capi/kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go new file mode 100644 index 000000000000..d66883d42417 --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019 +) + +// KubevirtClusterTemplateResource describes the data needed to create a KubevirtCluster from a template. +type KubevirtClusterTemplateResource struct { + ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` + Spec KubevirtClusterSpec `json:"spec"` +} + +// KubevirtClusterTemplateSpec defines the desired state of KubevirtClusterTemplate. +type KubevirtClusterTemplateSpec struct { + Template KubevirtClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=kubevirtclustertemplates,scope=Namespaced,categories=cluster-api,shortName=kct + +// KubevirtClusterTemplate is the Schema for the kubevirtclustertemplates API. +type KubevirtClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="KubevirtClusterTemplate Spec is immutable" + Spec KubevirtClusterTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// KubevirtClusterTemplateList contains a list of KubevirtClusterTemplates. +type KubevirtClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []KubevirtClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&KubevirtClusterTemplate{}, &KubevirtClusterTemplateList{}) +} diff --git a/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachine_types.go b/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachine_types.go new file mode 100644 index 000000000000..e419b429ab6d --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachine_types.go @@ -0,0 +1,168 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kubevirtv1 "kubevirt.io/api/core/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019 + "sigs.k8s.io/cluster-api/errors" //nolint SA1019 +) + +const ( + // MachineFinalizer allows ReconcileKubevirtMachine to clean up resources associated with machine before + // removing it from the apiserver. + MachineFinalizer = "kubevirtmachine.infrastructure.cluster.x-k8s.io" +) + +// VirtualMachineTemplateSpec defines the desired state of the kubevirt VM. +type VirtualMachineTemplateSpec struct { + // +kubebuilder:pruning:PreserveUnknownFields + // +nullable + ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"` + // VirtualMachineSpec contains the VirtualMachine specification. + Spec kubevirtv1.VirtualMachineSpec `json:"spec,omitempty" valid:"required"` +} + +// KubevirtMachineSpec defines the desired state of KubevirtMachine. +type KubevirtMachineSpec struct { + VirtualMachineTemplate VirtualMachineTemplateSpec `json:"virtualMachineTemplate,omitempty"` + + // ProviderID TBD what to use for Kubevirt + // +optional + ProviderID *string `json:"providerID,omitempty"` + + // BootstrapCheckSpec defines how the CAPK controller is checking CAPI Sentinel file inside the VM. + // +optional + BootstrapCheckSpec VirtualMachineBootstrapCheckSpec `json:"virtualMachineBootstrapCheck,omitempty"` + + // InfraClusterSecretRef is a reference to a secret with a kubeconfig for external cluster used for infra. + // When nil, this defaults to the value present in the KubevirtCluster object's spec associated with this machine. + // +optional + InfraClusterSecretRef *corev1.ObjectReference `json:"infraClusterSecretRef,omitempty"` +} + +// VirtualMachineBootstrapCheckSpec defines how the controller will remotely check CAPI Sentinel file content. +type VirtualMachineBootstrapCheckSpec struct { + // CheckStrategy describes how CAPK controller will validate a successful CAPI bootstrap. + // Following specified method, CAPK will try to retrieve the state of the CAPI Sentinel file from the VM. + // Possible values are: "none" or "ssh" (default is "ssh") and this value is validated by apiserver. + // +optional + // +kubebuilder:validation:Enum=none;ssh + // +kubebuilder:default:=ssh + CheckStrategy string `json:"checkStrategy,omitempty"` +} + +// KubevirtMachineStatus defines the observed state of KubevirtMachine. +type KubevirtMachineStatus struct { + // Ready denotes that the machine is ready + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // LoadBalancerConfigured denotes that the machine has been + // added to the load balancer + // +optional + LoadBalancerConfigured bool `json:"loadBalancerConfigured,omitempty"` + + // Addresses contains the associated addresses for the machine. + // +optional + Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + + // Conditions defines current service state of the KubevirtMachine. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` + + // NodeUpdated denotes that the ProviderID is updated on Node of this KubevirtMachine + // +optional + NodeUpdated bool `json:"nodeupdated"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// +kubebuilder:resource:path=kubevirtmachines,scope=Namespaced,categories=cluster-api +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready",description="Is machine ready" + +// KubevirtMachine is the Schema for the kubevirtmachines API. +type KubevirtMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec KubevirtMachineSpec `json:"spec,omitempty"` + Status KubevirtMachineStatus `json:"status,omitempty"` +} + +func (c *KubevirtMachine) GetConditions() clusterv1.Conditions { + return c.Status.Conditions +} + +func (c *KubevirtMachine) SetConditions(conditions clusterv1.Conditions) { + c.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// KubevirtMachineList contains a list of KubevirtMachine. +type KubevirtMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []KubevirtMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&KubevirtMachine{}, &KubevirtMachineList{}) +} diff --git a/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go b/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go new file mode 100644 index 000000000000..49a269ed7abb --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// KubevirtMachineTemplateSpec defines the desired state of KubevirtMachineTemplate. +type KubevirtMachineTemplateSpec struct { + Template KubevirtMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=kubevirtmachinetemplates,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion + +// KubevirtMachineTemplate is the Schema for the kubevirtmachinetemplates API. +type KubevirtMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec KubevirtMachineTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// KubevirtMachineTemplateList contains a list of KubevirtMachineTemplate. +type KubevirtMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []KubevirtMachineTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&KubevirtMachineTemplate{}, &KubevirtMachineTemplateList{}) +} + +// KubevirtMachineTemplateResource describes the data needed to create a KubevirtMachine from a template. +type KubevirtMachineTemplateResource struct { + // Spec is the specification of the desired behavior of the machine. + Spec KubevirtMachineSpec `json:"spec"` +} diff --git a/pkg/capi/kubevirt/api/v1alpha1/zz_generated.deepcopy.go b/pkg/capi/kubevirt/api/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..bd377db7a03c --- /dev/null +++ b/pkg/capi/kubevirt/api/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,547 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/api/core/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. +func (in *APIEndpoint) DeepCopy() *APIEndpoint { + if in == nil { + return nil + } + out := new(APIEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneServiceTemplate) DeepCopyInto(out *ControlPlaneServiceTemplate) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneServiceTemplate. +func (in *ControlPlaneServiceTemplate) DeepCopy() *ControlPlaneServiceTemplate { + if in == nil { + return nil + } + out := new(ControlPlaneServiceTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtCluster) DeepCopyInto(out *KubevirtCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtCluster. +func (in *KubevirtCluster) DeepCopy() *KubevirtCluster { + if in == nil { + return nil + } + out := new(KubevirtCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterList) DeepCopyInto(out *KubevirtClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KubevirtCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterList. +func (in *KubevirtClusterList) DeepCopy() *KubevirtClusterList { + if in == nil { + return nil + } + out := new(KubevirtClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterSpec) DeepCopyInto(out *KubevirtClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + in.ControlPlaneServiceTemplate.DeepCopyInto(&out.ControlPlaneServiceTemplate) + in.SshKeys.DeepCopyInto(&out.SshKeys) + if in.InfraClusterSecretRef != nil { + in, out := &in.InfraClusterSecretRef, &out.InfraClusterSecretRef + *out = new(v1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterSpec. +func (in *KubevirtClusterSpec) DeepCopy() *KubevirtClusterSpec { + if in == nil { + return nil + } + out := new(KubevirtClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterStatus) DeepCopyInto(out *KubevirtClusterStatus) { + *out = *in + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(v1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1beta1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterStatus. +func (in *KubevirtClusterStatus) DeepCopy() *KubevirtClusterStatus { + if in == nil { + return nil + } + out := new(KubevirtClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterTemplate) DeepCopyInto(out *KubevirtClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterTemplate. +func (in *KubevirtClusterTemplate) DeepCopy() *KubevirtClusterTemplate { + if in == nil { + return nil + } + out := new(KubevirtClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterTemplateList) DeepCopyInto(out *KubevirtClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KubevirtClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterTemplateList. +func (in *KubevirtClusterTemplateList) DeepCopy() *KubevirtClusterTemplateList { + if in == nil { + return nil + } + out := new(KubevirtClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterTemplateResource) DeepCopyInto(out *KubevirtClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterTemplateResource. +func (in *KubevirtClusterTemplateResource) DeepCopy() *KubevirtClusterTemplateResource { + if in == nil { + return nil + } + out := new(KubevirtClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtClusterTemplateSpec) DeepCopyInto(out *KubevirtClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtClusterTemplateSpec. +func (in *KubevirtClusterTemplateSpec) DeepCopy() *KubevirtClusterTemplateSpec { + if in == nil { + return nil + } + out := new(KubevirtClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachine) DeepCopyInto(out *KubevirtMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachine. +func (in *KubevirtMachine) DeepCopy() *KubevirtMachine { + if in == nil { + return nil + } + out := new(KubevirtMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineList) DeepCopyInto(out *KubevirtMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KubevirtMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineList. +func (in *KubevirtMachineList) DeepCopy() *KubevirtMachineList { + if in == nil { + return nil + } + out := new(KubevirtMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineSpec) DeepCopyInto(out *KubevirtMachineSpec) { + *out = *in + in.VirtualMachineTemplate.DeepCopyInto(&out.VirtualMachineTemplate) + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + out.BootstrapCheckSpec = in.BootstrapCheckSpec + if in.InfraClusterSecretRef != nil { + in, out := &in.InfraClusterSecretRef, &out.InfraClusterSecretRef + *out = new(v1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineSpec. +func (in *KubevirtMachineSpec) DeepCopy() *KubevirtMachineSpec { + if in == nil { + return nil + } + out := new(KubevirtMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineStatus) DeepCopyInto(out *KubevirtMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(v1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineStatus. +func (in *KubevirtMachineStatus) DeepCopy() *KubevirtMachineStatus { + if in == nil { + return nil + } + out := new(KubevirtMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineTemplate) DeepCopyInto(out *KubevirtMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineTemplate. +func (in *KubevirtMachineTemplate) DeepCopy() *KubevirtMachineTemplate { + if in == nil { + return nil + } + out := new(KubevirtMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineTemplateList) DeepCopyInto(out *KubevirtMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KubevirtMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineTemplateList. +func (in *KubevirtMachineTemplateList) DeepCopy() *KubevirtMachineTemplateList { + if in == nil { + return nil + } + out := new(KubevirtMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubevirtMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineTemplateResource) DeepCopyInto(out *KubevirtMachineTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineTemplateResource. +func (in *KubevirtMachineTemplateResource) DeepCopy() *KubevirtMachineTemplateResource { + if in == nil { + return nil + } + out := new(KubevirtMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtMachineTemplateSpec) DeepCopyInto(out *KubevirtMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineTemplateSpec. +func (in *KubevirtMachineTemplateSpec) DeepCopy() *KubevirtMachineTemplateSpec { + if in == nil { + return nil + } + out := new(KubevirtMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSHKeys) DeepCopyInto(out *SSHKeys) { + *out = *in + if in.ConfigRef != nil { + in, out := &in.ConfigRef, &out.ConfigRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.DataSecretName != nil { + in, out := &in.DataSecretName, &out.DataSecretName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSHKeys. +func (in *SSHKeys) DeepCopy() *SSHKeys { + if in == nil { + return nil + } + out := new(SSHKeys) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceSpecTemplate) DeepCopyInto(out *ServiceSpecTemplate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceSpecTemplate. +func (in *ServiceSpecTemplate) DeepCopy() *ServiceSpecTemplate { + if in == nil { + return nil + } + out := new(ServiceSpecTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineBootstrapCheckSpec) DeepCopyInto(out *VirtualMachineBootstrapCheckSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineBootstrapCheckSpec. +func (in *VirtualMachineBootstrapCheckSpec) DeepCopy() *VirtualMachineBootstrapCheckSpec { + if in == nil { + return nil + } + out := new(VirtualMachineBootstrapCheckSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineTemplateSpec) DeepCopyInto(out *VirtualMachineTemplateSpec) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineTemplateSpec. +func (in *VirtualMachineTemplateSpec) DeepCopy() *VirtualMachineTemplateSpec { + if in == nil { + return nil + } + out := new(VirtualMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/kubevirt/go.mod b/pkg/capi/kubevirt/go.mod new file mode 100644 index 000000000000..355049ec93b9 --- /dev/null +++ b/pkg/capi/kubevirt/go.mod @@ -0,0 +1,59 @@ +module sigs.k8s.io/cluster-api-provider-kubevirt + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + kubevirt.io/api v1.8.2 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + k8s.io/utils v0.0.0-20260108192941-914a6e750570 // indirect + kubevirt.io/containerized-data-importer-api v1.65.0 // indirect + kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/pkg/capi/openstack/api/v1alpha1/conditions_consts.go b/pkg/capi/openstack/api/v1alpha1/conditions_consts.go new file mode 100644 index 000000000000..018e580ad23d --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/conditions_consts.go @@ -0,0 +1,32 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +type ServerStatusError string + +const ( + // OpenstackFloatingIPPoolReadyCondition reports on the current status of the floating ip pool. Ready indicates that the pool is ready to be used. + OpenstackFloatingIPPoolReadyCondition = "OpenstackFloatingIPPoolReadyCondition" + + // MaxIPsReachedReason is set when the maximum number of floating IPs has been reached. + MaxIPsReachedReason = "MaxIPsReached" + + // UnableToFindFloatingIPNetworkReason is used when the floating ip network is not found. + UnableToFindNetwork = "UnableToFindNetwork" + + CreateServerError ServerStatusError = "CreateError" +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_conversion.go b/pkg/capi/openstack/api/v1alpha1/doc.go similarity index 65% rename from vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_conversion.go rename to pkg/capi/openstack/api/v1alpha1/doc.go index 9953b5e3a32c..bd75f07a39ba 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_conversion.go +++ b/pkg/capi/openstack/api/v1alpha1/doc.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 - -// Hub marks AzureManagedMachinePool as a conversion hub. -func (*AzureManagedMachinePool) Hub() {} - -// Hub marks AzureManagedMachinePoolList as a conversion hub. -func (*AzureManagedMachinePoolList) Hub() {} +// package v1alpha1 contains API Schema definitions for the infrastructure v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +// +k8s:openapi-gen=true +package v1alpha1 diff --git a/pkg/capi/openstack/api/v1alpha1/groupversion_info.go b/pkg/capi/openstack/api/v1alpha1/groupversion_info.go new file mode 100644 index 000000000000..c048d2b4e40f --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/groupversion_info.go @@ -0,0 +1,44 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package v1alpha1 contains API Schema definitions for the infrastructure v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// GroupName is the group name use in this package. +const GroupName = "infrastructure.cluster.x-k8s.io" + +// SchemeGroupVersion is group version used to register these objects. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/pkg/capi/openstack/api/v1alpha1/openstackfloatingippool_types.go b/pkg/capi/openstack/api/v1alpha1/openstackfloatingippool_types.go new file mode 100644 index 000000000000..4b7588fbd1b0 --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/openstackfloatingippool_types.go @@ -0,0 +1,139 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" +) + +const ( + // OpenStackFloatingIPPoolFinalizer allows ReconcileOpenStackFloatingIPPool to clean up resources associated with OpenStackFloatingIPPool before + // removing it from the apiserver. + OpenStackFloatingIPPoolFinalizer = "openstackfloatingippool.infrastructure.cluster.x-k8s.io" + + OpenStackFloatingIPPoolNameIndex = "spec.poolRef.name" + + // OpenStackFloatingIPPoolIP. + DeleteFloatingIPFinalizer = "openstackfloatingippool.infrastructure.cluster.x-k8s.io/delete-floating-ip" +) + +// ReclaimPolicy is a string type alias to represent reclaim policies for floating ips. +type ReclaimPolicy string + +const ( + // ReclaimDelete is the reclaim policy for floating ips. + ReclaimDelete ReclaimPolicy = "Delete" + // ReclaimRetain is the reclaim policy for floating ips. + ReclaimRetain ReclaimPolicy = "Retain" +) + +// OpenStackFloatingIPPoolSpec defines the desired state of OpenStackFloatingIPPool. +type OpenStackFloatingIPPoolSpec struct { + // PreAllocatedFloatingIPs is a list of floating IPs precreated in OpenStack that should be used by this pool. + // These are used before allocating new ones and are not deleted from OpenStack when the pool is deleted. + PreAllocatedFloatingIPs []string `json:"preAllocatedFloatingIPs,omitempty"` + + // MaxIPs is the maximum number of floating ips that can be allocated from this pool, if nil there is no limit. + // If set, the pool will stop allocating floating ips when it reaches this number of ClaimedIPs. + // +optional + MaxIPs *int `json:"maxIPs,omitempty"` + + // IdentityRef is a reference to a identity to be used when reconciling this pool. + // +kubebuilder:validation:Required + IdentityRef infrav1.OpenStackIdentityReference `json:"identityRef"` + + // FloatingIPNetwork is the external network to use for floating ips, if there's only one external network it will be used by default + // +optional + FloatingIPNetwork *infrav1.NetworkParam `json:"floatingIPNetwork"` + + // The stratergy to use for reclaiming floating ips when they are released from a machine + // +kubebuilder:validation:Enum=Retain;Delete + ReclaimPolicy ReclaimPolicy `json:"reclaimPolicy"` +} + +// OpenStackFloatingIPPoolStatus defines the observed state of OpenStackFloatingIPPool. +type OpenStackFloatingIPPoolStatus struct { + // +kubebuilder:default={} + // +optional + ClaimedIPs []string `json:"claimedIPs"` + + // +kubebuilder:default={} + // +optional + AvailableIPs []string `json:"availableIPs"` + + // FailedIPs contains a list of floating ips that failed to be allocated + // +optional + FailedIPs []string `json:"failedIPs,omitempty"` + + // floatingIPNetwork contains information about the network used for floating ips + // +optional + FloatingIPNetwork *infrav1.NetworkStatus `json:"floatingIPNetwork,omitempty"` + + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +//+kubebuilder:object:root=true +// +kubebuilder:storageversion +//+kubebuilder:subresource:status + +// OpenStackFloatingIPPool is the Schema for the openstackfloatingippools API. +type OpenStackFloatingIPPool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackFloatingIPPoolSpec `json:"spec,omitempty"` + Status OpenStackFloatingIPPoolStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// OpenStackFloatingIPPoolList contains a list of OpenStackFloatingIPPool. +type OpenStackFloatingIPPoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackFloatingIPPool `json:"items"` +} + +// GetConditions returns the observations of the operational state of the OpenStackFloatingIPPool resource. +func (r *OpenStackFloatingIPPool) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the OpenStackFloatingIPPool to the predescribed clusterv1.Conditions. +func (r *OpenStackFloatingIPPool) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +func (r *OpenStackFloatingIPPool) GetFloatingIPTag() string { + return fmt.Sprintf("cluster-api-provider-openstack-fip-pool-%s", r.Name) +} + +var _ infrav1.IdentityRefProvider = &OpenStackFloatingIPPool{} + +// GetIdentifyRef returns the FloatingIPPool's namespace and IdentityRef. +func (r *OpenStackFloatingIPPool) GetIdentityRef() (*string, *infrav1.OpenStackIdentityReference) { + return &r.Namespace, &r.Spec.IdentityRef +} + +func init() { + SchemeBuilder.Register(&OpenStackFloatingIPPool{}, &OpenStackFloatingIPPoolList{}) +} diff --git a/pkg/capi/openstack/api/v1alpha1/openstackserver_types.go b/pkg/capi/openstack/api/v1alpha1/openstackserver_types.go new file mode 100644 index 000000000000..8172658dac74 --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/openstackserver_types.go @@ -0,0 +1,216 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + runtime "k8s.io/apimachinery/pkg/runtime" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional" +) + +const ( + // OpenStackServerFinalizer allows ReconcileOpenStackServer to clean up resources associated with OpenStackServer before + // removing it from the apiserver. + OpenStackServerFinalizer = "openstackserver.infrastructure.cluster.x-k8s.io" +) + +// OpenStackServerSpec defines the desired state of OpenStackServer. +// +kubebuilder:validation:XValidation:message="at least one of flavor or flavorID must be set",rule=(has(self.flavor) || has(self.flavorID)) +type OpenStackServerSpec struct { + // AdditionalBlockDevices is a list of specifications for additional block devices to attach to the server instance. + // +listType=map + // +listMapKey=name + // +optional + AdditionalBlockDevices []infrav1.AdditionalBlockDevice `json:"additionalBlockDevices,omitempty"` + + // AvailabilityZone is the availability zone in which to create the server instance. + //+optional + AvailabilityZone optional.String `json:"availabilityZone,omitempty"` + + // ConfigDrive is a flag to enable config drive for the server instance. + // +optional + ConfigDrive optional.Bool `json:"configDrive,omitempty"` + + // The flavor reference for the flavor for the server instance. + // +optional + // +kubebuilder:validation:MinLength=1 + Flavor *string `json:"flavor,omitempty"` + + // FlavorID allows flavors to be specified by ID. This field takes precedence + // over Flavor. + // +optional + // +kubebuilder:validation:MinLength=1 + FlavorID *string `json:"flavorID,omitempty"` + + // FloatingIPPoolRef is a reference to a FloatingIPPool to allocate a floating IP from. + // +optional + FloatingIPPoolRef *corev1.TypedLocalObjectReference `json:"floatingIPPoolRef,omitempty"` + + // IdentityRef is a reference to a secret holding OpenStack credentials. + // +required + IdentityRef infrav1.OpenStackIdentityReference `json:"identityRef"` + + // The image to use for the server instance. + // +required + Image infrav1.ImageParam `json:"image"` + + // Ports to be attached to the server instance. + // +required + Ports []infrav1.PortOpts `json:"ports"` + + // RootVolume is the specification for the root volume of the server instance. + // +optional + RootVolume *infrav1.RootVolume `json:"rootVolume,omitempty"` + + // SSHKeyName is the name of the SSH key to inject in the instance. + // +required + SSHKeyName string `json:"sshKeyName"` + + // SecurityGroups is a list of security groups names to assign to the instance. + // +optional + SecurityGroups []infrav1.SecurityGroupParam `json:"securityGroups,omitempty"` + + // ServerGroup is the server group to which the server instance belongs. + // +optional + ServerGroup *infrav1.ServerGroupParam `json:"serverGroup,omitempty"` + + // ServerMetadata is a map of key value pairs to add to the server instance. + // +listType=map + // +listMapKey=key + // +optional + ServerMetadata []infrav1.ServerMetadata `json:"serverMetadata,omitempty"` + + // Tags which will be added to the machine and all dependent resources + // which support them. These are in addition to Tags defined on the + // cluster. + // Requires Nova api 2.52 minimum! + // +listType=set + Tags []string `json:"tags,omitempty"` + + // Trunk is a flag to indicate if the server instance is created on a trunk port or not. + // +optional + Trunk optional.Bool `json:"trunk,omitempty"` + + // UserDataRef is a reference to a secret containing the user data to + // be injected into the server instance. + // +optional + UserDataRef *corev1.LocalObjectReference `json:"userDataRef,omitempty"` + + // SchedulerHintAdditionalProperties are arbitrary key/value pairs that provide additional hints + // to the OpenStack scheduler. These hints can influence how instances are placed on the infrastructure, + // such as specifying certain host aggregates or availability zones. + // +optional + // +listType=map + // +listMapKey=name + SchedulerHintAdditionalProperties []infrav1.SchedulerHintAdditionalProperty `json:"schedulerHintAdditionalProperties,omitempty"` +} + +// OpenStackServerStatus defines the observed state of OpenStackServer. +type OpenStackServerStatus struct { + // Ready is true when the OpenStack server is ready. + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // InstanceID is the ID of the server instance. + // +optional + InstanceID optional.String `json:"instanceID,omitempty"` + + // InstanceState is the state of the server instance. + // +optional + InstanceState *infrav1.InstanceState `json:"instanceState,omitempty"` + + // Addresses is the list of addresses of the server instance. + // +optional + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // Resolved contains parts of the machine spec with all external + // references fully resolved. + // +optional + Resolved *ResolvedServerSpec `json:"resolved,omitempty"` + + // Resources contains references to OpenStack resources created for the machine. + // +optional + Resources *ServerResources `json:"resources,omitempty"` + + // Conditions defines current service state of the OpenStackServer. + // +optional + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:resource:path=openstackservers,scope=Namespaced,categories=cluster-api,shortName=oss +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="InstanceState",type="string",JSONPath=".status.instanceState",description="OpenStack instance state" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="OpenStack instance ready status" +// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".status.instanceID",description="OpenStack instance ID" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStack instance" + +// OpenStackServer is the Schema for the openstackservers API. +type OpenStackServer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackServerSpec `json:"spec,omitempty"` + Status OpenStackServerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// OpenStackServerList contains a list of OpenStackServer. +type OpenStackServerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackServer `json:"items"` +} + +// GetConditions returns the observations of the operational state of the OpenStackServer resource. +func (r *OpenStackServer) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the OpenStackServer to the predescribed clusterv1.Conditions. +func (r *OpenStackServer) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +var _ infrav1.IdentityRefProvider = &OpenStackFloatingIPPool{} + +// GetIdentifyRef returns the Server's namespace and IdentityRef. +func (r *OpenStackServer) GetIdentityRef() (*string, *infrav1.OpenStackIdentityReference) { + return &r.Namespace, &r.Spec.IdentityRef +} + +func (r *OpenStackServer) ToUnstructured() (*unstructured.Unstructured, error) { + rawMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + return nil, err + } + u := &unstructured.Unstructured{Object: rawMap} + u.SetGroupVersionKind(infrav1.SchemeGroupVersion.WithKind("OpenStackServer")) + return u, nil +} + +func init() { + SchemeBuilder.Register(&OpenStackServer{}, &OpenStackServerList{}) +} diff --git a/pkg/capi/openstack/api/v1alpha1/types.go b/pkg/capi/openstack/api/v1alpha1/types.go new file mode 100644 index 000000000000..77ec07f7bc6b --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/types.go @@ -0,0 +1,47 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" +) + +// ResolvedServerSpec contains resolved references to resources required by the server. +type ResolvedServerSpec struct { + // ServerGroupID is the ID of the server group the server should be added to and is calculated based on ServerGroupFilter. + // +optional + ServerGroupID string `json:"serverGroupID,omitempty"` + + // ImageID is the ID of the image to use for the server and is calculated based on ImageFilter. + // +optional + ImageID string `json:"imageID,omitempty"` + + // FlavorID is the ID of the flavor to use. + // +optional + FlavorID string `json:"flavorID,omitempty"` + + // Ports is the fully resolved list of ports to create for the server. + // +optional + Ports []infrav1.ResolvedPortSpec `json:"ports,omitempty"` +} + +// ServerResources contains references to OpenStack resources created for the server. +type ServerResources struct { + // Ports is the status of the ports created for the server. + // +optional + Ports []infrav1.PortStatus `json:"ports,omitempty"` +} diff --git a/pkg/capi/openstack/api/v1alpha1/zz_generated.deepcopy.go b/pkg/capi/openstack/api/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..54ef8283bcb7 --- /dev/null +++ b/pkg/capi/openstack/api/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,408 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackFloatingIPPool) DeepCopyInto(out *OpenStackFloatingIPPool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackFloatingIPPool. +func (in *OpenStackFloatingIPPool) DeepCopy() *OpenStackFloatingIPPool { + if in == nil { + return nil + } + out := new(OpenStackFloatingIPPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackFloatingIPPool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackFloatingIPPoolList) DeepCopyInto(out *OpenStackFloatingIPPoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackFloatingIPPool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackFloatingIPPoolList. +func (in *OpenStackFloatingIPPoolList) DeepCopy() *OpenStackFloatingIPPoolList { + if in == nil { + return nil + } + out := new(OpenStackFloatingIPPoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackFloatingIPPoolList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackFloatingIPPoolSpec) DeepCopyInto(out *OpenStackFloatingIPPoolSpec) { + *out = *in + if in.PreAllocatedFloatingIPs != nil { + in, out := &in.PreAllocatedFloatingIPs, &out.PreAllocatedFloatingIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.MaxIPs != nil { + in, out := &in.MaxIPs, &out.MaxIPs + *out = new(int) + **out = **in + } + out.IdentityRef = in.IdentityRef + if in.FloatingIPNetwork != nil { + in, out := &in.FloatingIPNetwork, &out.FloatingIPNetwork + *out = new(v1beta1.NetworkParam) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackFloatingIPPoolSpec. +func (in *OpenStackFloatingIPPoolSpec) DeepCopy() *OpenStackFloatingIPPoolSpec { + if in == nil { + return nil + } + out := new(OpenStackFloatingIPPoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackFloatingIPPoolStatus) DeepCopyInto(out *OpenStackFloatingIPPoolStatus) { + *out = *in + if in.ClaimedIPs != nil { + in, out := &in.ClaimedIPs, &out.ClaimedIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AvailableIPs != nil { + in, out := &in.AvailableIPs, &out.AvailableIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FailedIPs != nil { + in, out := &in.FailedIPs, &out.FailedIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FloatingIPNetwork != nil { + in, out := &in.FloatingIPNetwork, &out.FloatingIPNetwork + *out = new(v1beta1.NetworkStatus) + (*in).DeepCopyInto(*out) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackFloatingIPPoolStatus. +func (in *OpenStackFloatingIPPoolStatus) DeepCopy() *OpenStackFloatingIPPoolStatus { + if in == nil { + return nil + } + out := new(OpenStackFloatingIPPoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackServer) DeepCopyInto(out *OpenStackServer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackServer. +func (in *OpenStackServer) DeepCopy() *OpenStackServer { + if in == nil { + return nil + } + out := new(OpenStackServer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackServer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackServerList) DeepCopyInto(out *OpenStackServerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackServer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackServerList. +func (in *OpenStackServerList) DeepCopy() *OpenStackServerList { + if in == nil { + return nil + } + out := new(OpenStackServerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackServerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackServerSpec) DeepCopyInto(out *OpenStackServerSpec) { + *out = *in + if in.AdditionalBlockDevices != nil { + in, out := &in.AdditionalBlockDevices, &out.AdditionalBlockDevices + *out = make([]v1beta1.AdditionalBlockDevice, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AvailabilityZone != nil { + in, out := &in.AvailabilityZone, &out.AvailabilityZone + *out = new(string) + **out = **in + } + if in.ConfigDrive != nil { + in, out := &in.ConfigDrive, &out.ConfigDrive + *out = new(bool) + **out = **in + } + if in.Flavor != nil { + in, out := &in.Flavor, &out.Flavor + *out = new(string) + **out = **in + } + if in.FlavorID != nil { + in, out := &in.FlavorID, &out.FlavorID + *out = new(string) + **out = **in + } + if in.FloatingIPPoolRef != nil { + in, out := &in.FloatingIPPoolRef, &out.FloatingIPPoolRef + *out = new(v1.TypedLocalObjectReference) + (*in).DeepCopyInto(*out) + } + out.IdentityRef = in.IdentityRef + in.Image.DeepCopyInto(&out.Image) + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1beta1.PortOpts, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(v1beta1.RootVolume) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]v1beta1.SecurityGroupParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServerGroup != nil { + in, out := &in.ServerGroup, &out.ServerGroup + *out = new(v1beta1.ServerGroupParam) + (*in).DeepCopyInto(*out) + } + if in.ServerMetadata != nil { + in, out := &in.ServerMetadata, &out.ServerMetadata + *out = make([]v1beta1.ServerMetadata, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Trunk != nil { + in, out := &in.Trunk, &out.Trunk + *out = new(bool) + **out = **in + } + if in.UserDataRef != nil { + in, out := &in.UserDataRef, &out.UserDataRef + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.SchedulerHintAdditionalProperties != nil { + in, out := &in.SchedulerHintAdditionalProperties, &out.SchedulerHintAdditionalProperties + *out = make([]v1beta1.SchedulerHintAdditionalProperty, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackServerSpec. +func (in *OpenStackServerSpec) DeepCopy() *OpenStackServerSpec { + if in == nil { + return nil + } + out := new(OpenStackServerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackServerStatus) DeepCopyInto(out *OpenStackServerStatus) { + *out = *in + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(v1beta1.InstanceState) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.Resolved != nil { + in, out := &in.Resolved, &out.Resolved + *out = new(ResolvedServerSpec) + (*in).DeepCopyInto(*out) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(ServerResources) + (*in).DeepCopyInto(*out) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackServerStatus. +func (in *OpenStackServerStatus) DeepCopy() *OpenStackServerStatus { + if in == nil { + return nil + } + out := new(OpenStackServerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResolvedServerSpec) DeepCopyInto(out *ResolvedServerSpec) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1beta1.ResolvedPortSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedServerSpec. +func (in *ResolvedServerSpec) DeepCopy() *ResolvedServerSpec { + if in == nil { + return nil + } + out := new(ResolvedServerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerResources) DeepCopyInto(out *ServerResources) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1beta1.PortStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerResources. +func (in *ServerResources) DeepCopy() *ServerResources { + if in == nil { + return nil + } + out := new(ServerResources) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/openstack/api/v1beta1/conditions_consts.go b/pkg/capi/openstack/api/v1beta1/conditions_consts.go new file mode 100644 index 000000000000..d84500772f12 --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/conditions_consts.go @@ -0,0 +1,71 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + +const ( + // InstanceReadyCondition reports on current status of the OpenStack instance. Ready indicates the instance is in a Running state. + InstanceReadyCondition clusterv1beta1.ConditionType = "InstanceReady" + + // WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + // WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" + // InvalidMachineSpecReason used when the machine spec is invalid. + InvalidMachineSpecReason = "InvalidMachineSpec" + // InstanceCreateFailedReason used when creating the instance failed. + InstanceCreateFailedReason = "InstanceCreateFailed" + // InstanceNotFoundReason used when the instance couldn't be retrieved. + InstanceNotFoundReason = "InstanceNotFound" + // InstanceStateErrorReason used when the instance is in error state. + InstanceStateErrorReason = "InstanceStateError" + // InstanceDeletedReason used when the instance is in a deleted state. + InstanceDeletedReason = "InstanceDeleted" + // InstanceNotReadyReason used when the instance is in a pending state. + InstanceNotReadyReason = "InstanceNotReady" + // InstanceDeleteFailedReason used when deleting the instance failed. + InstanceDeleteFailedReason = "InstanceDeleteFailed" + // OpenstackErrorReason used when there is an error communicating with OpenStack. + OpenStackErrorReason = "OpenStackError" + // DependencyFailedReason indicates that a dependent object failed. + DependencyFailedReason = "DependencyFailed" + + // ServerUnexpectedDeletedMessage is the message used when the server is unexpectedly deleted via an external agent. + ServerUnexpectedDeletedMessage = "The server was unexpectedly deleted" +) + +const ( + // APIServerIngressReadyCondition reports on the current status of the network ingress (Loadbalancer, Floating IP) for Control Plane machines. Ready indicates that the instance can receive requests. + APIServerIngressReadyCondition clusterv1beta1.ConditionType = "APIServerIngressReadyCondition" + + // LoadBalancerMemberErrorReason used when the instance could not be added as a loadbalancer member. + LoadBalancerMemberErrorReason = "LoadBalancerMemberError" + // FloatingIPErrorReason used when the floating ip could not be created or attached. + FloatingIPErrorReason = "FloatingIPError" +) + +const ( + // FloatingAddressFromPoolReadyCondition reports on the current status of the Floating IPs from ipam pool. + FloatingAddressFromPoolReadyCondition clusterv1beta1.ConditionType = "FloatingAddressFromPoolReady" + // WaitingForIpamProviderReason used when machine is waiting for ipam provider to be ready before proceeding. + FloatingAddressFromPoolWaitingForIpamProviderReason = "WaitingForIPAMProvider" + // FloatingAddressFromPoolErrorReason is used when there is an error attaching an IP from the pool to an machine. + FloatingAddressFromPoolErrorReason = "FloatingIPError" + // UnableToFindFloatingIPNetworkReason is used when the floating ip network is not found. + UnableToFindFloatingIPNetworkReason = "UnableToFindFloatingIPNetwork" +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_conversion.go b/pkg/capi/openstack/api/v1beta1/doc.go similarity index 68% rename from vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_conversion.go rename to pkg/capi/openstack/api/v1beta1/doc.go index 318d54221bc1..d52e35d0eb7b 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_conversion.go +++ b/pkg/capi/openstack/api/v1beta1/doc.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group. +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +// +k8s:openapi-gen=true package v1beta1 - -// Hub marks AzureManagedCluster as a conversion hub. -func (*AzureManagedCluster) Hub() {} - -// Hub marks AzureManagedClusterList as a conversion hub. -func (*AzureManagedClusterList) Hub() {} diff --git a/pkg/capi/openstack/api/v1beta1/groupversion_info.go b/pkg/capi/openstack/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..d4ed85c0f5f6 --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/groupversion_info.go @@ -0,0 +1,53 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package. +const GroupName = "infrastructure.cluster.x-k8s.io" + +// SchemeGroupVersion is group version used to register these objects. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // schemeBuilder is used to add go types to the GroupVersionKind scheme. + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = schemeBuilder.AddToScheme + + objectTypes = []runtime.Object{} +) + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, objectTypes...) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/capi/openstack/api/v1beta1/identity_types.go b/pkg/capi/openstack/api/v1beta1/identity_types.go new file mode 100644 index 000000000000..41a74bf6866e --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/identity_types.go @@ -0,0 +1,45 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// OpenStackIdentityReference is a reference to an infrastructure +// provider identity to be used to provision cluster resources. +// +kubebuilder:validation:XValidation:rule="(!has(self.region) && !has(oldSelf.region)) || self.region == oldSelf.region",message="region is immutable" +type OpenStackIdentityReference struct { + // Name is the name of a secret in the same namespace as the resource being provisioned. + // The secret must contain a key named `clouds.yaml` which contains an OpenStack clouds.yaml file. + // The secret may optionally contain a key named `cacert` containing a PEM-encoded CA certificate. + // +kubebuilder:validation:Required + Name string `json:"name"` + + // CloudName specifies the name of the entry in the clouds.yaml file to use. + // +kubebuilder:validation:Required + CloudName string `json:"cloudName"` + + // Region specifies an OpenStack region to use. If specified, it overrides + // any value in clouds.yaml. If specified for an OpenStackMachine, its + // value will be included in providerID. + // +optional + Region string `json:"region,omitempty"` +} + +// IdentityRefProvider is an interface for obtaining OpenStack credentials from an API object +// +kubebuilder:object:generate:=false +type IdentityRefProvider interface { + // GetIdentifyRef returns the object's namespace and IdentityRef if it has an IdentityRef, or nulls if it does not + GetIdentityRef() (*string, *OpenStackIdentityReference) +} diff --git a/pkg/capi/openstack/api/v1beta1/openstackcluster_types.go b/pkg/capi/openstack/api/v1beta1/openstackcluster_types.go new file mode 100644 index 000000000000..02833b1ea22d --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/openstackcluster_types.go @@ -0,0 +1,354 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + + capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" + "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional" +) + +const ( + // ClusterFinalizer allows ReconcileOpenStackCluster to clean up OpenStack resources associated with OpenStackCluster before + // removing it from the apiserver. + ClusterFinalizer = "openstackcluster.infrastructure.cluster.x-k8s.io" +) + +// OpenStackClusterSpec defines the desired state of OpenStackCluster. +// +kubebuilder:validation:XValidation:rule="has(self.disableExternalNetwork) && self.disableExternalNetwork ? !has(self.bastion) || !has(self.bastion.floatingIP) : true",message="bastion floating IP cannot be set when disableExternalNetwork is true" +// +kubebuilder:validation:XValidation:rule="has(self.disableExternalNetwork) && self.disableExternalNetwork ? has(self.disableAPIServerFloatingIP) && self.disableAPIServerFloatingIP : true",message="disableAPIServerFloatingIP cannot be false when disableExternalNetwork is true" +type OpenStackClusterSpec struct { + // ManagedSubnets describe OpenStack Subnets to be created. Cluster actuator will create a network, + // subnets with the defined CIDR, and a router connected to these subnets. Currently only one IPv4 + // subnet is supported. If you leave this empty, no network will be created. + // +kubebuilder:validation:MaxItems=1 + // +listType=atomic + // +optional + ManagedSubnets []SubnetSpec `json:"managedSubnets,omitempty"` + + // Router specifies an existing router to be used if ManagedSubnets are + // specified. If specified, no new router will be created. + // +optional + Router *RouterParam `json:"router,omitempty"` + + // Network specifies an existing network to use if no ManagedSubnets + // are specified. + // +optional + Network *NetworkParam `json:"network,omitempty"` + + // Subnets specifies existing subnets to use if not ManagedSubnets are + // specified. All subnets must be in the network specified by Network. + // There can be zero, one, or two subnets. If no subnets are specified, + // all subnets in Network will be used. If 2 subnets are specified, one + // must be IPv4 and the other IPv6. + // +kubebuilder:validation:MaxItems=2 + // +listType=atomic + // +optional + Subnets []SubnetParam `json:"subnets,omitempty"` + + // NetworkMTU sets the maximum transmission unit (MTU) value to address fragmentation for the private network ID. + // This value will be used only if the Cluster actuator creates the network. + // If left empty, the network will have the default MTU defined in Openstack network service. + // To use this field, the Openstack installation requires the net-mtu neutron API extension. + // +optional + NetworkMTU optional.Int `json:"networkMTU,omitempty"` + + // ExternalRouterIPs is an array of externalIPs on the respective subnets. + // This is necessary if the router needs a fixed ip in a specific subnet. + // +listType=atomic + // +optional + ExternalRouterIPs []ExternalRouterIPParam `json:"externalRouterIPs,omitempty"` + + // ExternalNetwork is the OpenStack Network to be used to get public internet to the VMs. + // This option is ignored if DisableExternalNetwork is set to true. + // + // If ExternalNetwork is defined it must refer to exactly one external network. + // + // If ExternalNetwork is not defined or is empty the controller will use any + // existing external network as long as there is only one. It is an + // error if ExternalNetwork is not defined and there are multiple + // external networks unless DisableExternalNetwork is also set. + // + // If ExternalNetwork is not defined and there are no external networks + // the controller will proceed as though DisableExternalNetwork was set. + // +optional + ExternalNetwork *NetworkParam `json:"externalNetwork,omitempty"` + + // DisableExternalNetwork specifies whether or not to attempt to connect the cluster + // to an external network. This allows for the creation of clusters when connecting + // to an external network is not possible or desirable, e.g. if using a provider network. + // +optional + DisableExternalNetwork optional.Bool `json:"disableExternalNetwork,omitempty"` + + // APIServerLoadBalancer configures the optional LoadBalancer for the APIServer. + // If not specified, no load balancer will be created for the API server. + // +optional + APIServerLoadBalancer *APIServerLoadBalancer `json:"apiServerLoadBalancer,omitempty"` + + // DisableAPIServerFloatingIP determines whether or not to attempt to attach a floating + // IP to the API server. This allows for the creation of clusters when attaching a floating + // IP to the API server (and hence, in many cases, exposing the API server to the internet) + // is not possible or desirable, e.g. if using a shared VLAN for communication between + // management and workload clusters or when the management cluster is inside the + // project network. + // This option requires that the API server use a VIP on the cluster network so that the + // underlying machines can change without changing ControlPlaneEndpoint.Host. + // When using a managed load balancer, this VIP will be managed automatically. + // If not using a managed load balancer, cluster configuration will fail without additional + // configuration to manage the VIP on the control plane machines, which falls outside of + // the scope of this controller. + // +optional + DisableAPIServerFloatingIP optional.Bool `json:"disableAPIServerFloatingIP,omitempty"` + + // APIServerFloatingIP is the floatingIP which will be associated with the API server. + // The floatingIP will be created if it does not already exist. + // If not specified, a new floatingIP is allocated. + // This field is not used if DisableAPIServerFloatingIP is set to true. + // +optional + APIServerFloatingIP optional.String `json:"apiServerFloatingIP,omitempty"` + + // APIServerFixedIP is the fixed IP which will be associated with the API server. + // In the case where the API server has a floating IP but not a managed load balancer, + // this field is not used. + // If a managed load balancer is used and this field is not specified, a fixed IP will + // be dynamically allocated for the load balancer. + // If a managed load balancer is not used AND the API server floating IP is disabled, + // this field MUST be specified and should correspond to a pre-allocated port that + // holds the fixed IP to be used as a VIP. + // +optional + APIServerFixedIP optional.String `json:"apiServerFixedIP,omitempty"` + + // APIServerPort is the port on which the listener on the APIServer + // will be created. If specified, it must be an integer between 0 and 65535. + // +optional + APIServerPort optional.UInt16 `json:"apiServerPort,omitempty"` + + // ManagedSecurityGroups determines whether OpenStack security groups for the cluster + // will be managed by the OpenStack provider or whether pre-existing security groups will + // be specified as part of the configuration. + // By default, the managed security groups have rules that allow the Kubelet, etcd, and the + // Kubernetes API server to function correctly. + // It's possible to add additional rules to the managed security groups. + // When defined to an empty struct, the managed security groups will be created with the default rules. + // +optional + ManagedSecurityGroups *ManagedSecurityGroups `json:"managedSecurityGroups,omitempty"` + + // DisablePortSecurity disables the port security of the network created for the + // Kubernetes cluster, which also disables SecurityGroups + // +optional + DisablePortSecurity optional.Bool `json:"disablePortSecurity,omitempty"` + + // Tags to set on all resources in cluster which support tags + // +listType=set + // +optional + Tags []string `json:"tags,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // It is normally populated automatically by the OpenStackCluster + // controller during cluster provisioning. If it is set on creation the + // control plane endpoint will use the values set here in preference to + // values set elsewhere. + // ControlPlaneEndpoint cannot be modified after ControlPlaneEndpoint.Host has been set. + // +optional + ControlPlaneEndpoint *clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"` + + // ControlPlaneAvailabilityZones is the set of availability zones which + // control plane machines may be deployed to. + // +listType=set + // +optional + ControlPlaneAvailabilityZones []string `json:"controlPlaneAvailabilityZones,omitempty"` + + // ControlPlaneOmitAvailabilityZone causes availability zone to be + // omitted when creating control plane nodes, allowing the Nova + // scheduler to make a decision on which availability zone to use based + // on other scheduling constraints + // +optional + ControlPlaneOmitAvailabilityZone optional.Bool `json:"controlPlaneOmitAvailabilityZone,omitempty"` + + // Bastion is the OpenStack instance to login the nodes + // + // As a rolling update is not ideal during a bastion host session, we + // prevent changes to a running bastion configuration. To make changes, it's required + // to first set `enabled: false` which will remove the bastion and then changes can be made. + //+optional + Bastion *Bastion `json:"bastion,omitempty"` + + // IdentityRef is a reference to a secret holding OpenStack credentials + // to be used when reconciling this cluster. It is also to reconcile + // machines unless overridden in the machine spec. + // +kubebuilder:validation:Required + IdentityRef OpenStackIdentityReference `json:"identityRef"` +} + +// OpenStackClusterStatus defines the observed state of OpenStackCluster. +type OpenStackClusterStatus struct { + // Ready is true when the cluster infrastructure is ready. + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // Network contains information about the created OpenStack Network. + // +optional + Network *NetworkStatusWithSubnets `json:"network,omitempty"` + + // ExternalNetwork contains information about the external network used for default ingress and egress traffic. + // +optional + ExternalNetwork *NetworkStatus `json:"externalNetwork,omitempty"` + + // Router describes the default cluster router + // +optional + Router *Router `json:"router,omitempty"` + + // APIServerLoadBalancer describes the api server load balancer if one exists + // +optional + APIServerLoadBalancer *LoadBalancer `json:"apiServerLoadBalancer,omitempty"` + + // FailureDomains represent OpenStack availability zones + FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` + + // ControlPlaneSecurityGroup contains the information about the + // OpenStack Security Group that needs to be applied to control plane + // nodes. + // +optional + ControlPlaneSecurityGroup *SecurityGroupStatus `json:"controlPlaneSecurityGroup,omitempty"` + + // WorkerSecurityGroup contains the information about the OpenStack + // Security Group that needs to be applied to worker nodes. + // +optional + WorkerSecurityGroup *SecurityGroupStatus `json:"workerSecurityGroup,omitempty"` + + // BastionSecurityGroup contains the information about the OpenStack + // Security Group that needs to be applied to worker nodes. + // +optional + BastionSecurityGroup *SecurityGroupStatus `json:"bastionSecurityGroup,omitempty"` + + // Bastion contains the information about the deployed bastion host + // +optional + Bastion *BastionStatus `json:"bastion,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the OpenStackCluster and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the OpenStackCluster's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of + // OpenStackClusters can be added as events to the OpenStackCluster object + // and/or logged in the controller's output. + // +optional + FailureReason *capoerrors.DeprecatedCAPIClusterStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the OpenStackCluster and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the OpenStackCluster's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of + // OpenStackClusters can be added as events to the OpenStackCluster object + // and/or logged in the controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for OpenStack instances" +// +kubebuilder:printcolumn:name="Network",type="string",JSONPath=".status.network.id",description="Network the cluster is using" +// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1 +// +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.floatingIP",description="Bastion address for breakglass access" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackCluster" + +// OpenStackCluster is the Schema for the openstackclusters API. +type OpenStackCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackClusterSpec `json:"spec,omitempty"` + Status OpenStackClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// OpenStackClusterList contains a list of OpenStackCluster. +type OpenStackClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackCluster `json:"items"` +} + +// ManagedSecurityGroups defines the desired state of security groups and rules for the cluster. +type ManagedSecurityGroups struct { + // allNodesSecurityGroupRules defines the rules that should be applied to all nodes. + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +optional + AllNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"allNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + + // controlPlaneNodesSecurityGroupRules defines the rules that should be applied to control plane nodes. + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +optional + ControlPlaneNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"controlPlaneNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + + // workerNodesSecurityGroupRules defines the rules that should be applied to worker nodes. + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +optional + WorkerNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"workerNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"` + + // AllowAllInClusterTraffic allows all ingress and egress traffic between cluster nodes when set to true. + // +kubebuilder:default=false + // +kubebuilder:validation:Required + AllowAllInClusterTraffic bool `json:"allowAllInClusterTraffic"` +} + +var _ IdentityRefProvider = &OpenStackCluster{} + +// GetIdentifyRef returns the cluster's namespace and IdentityRef. +func (c *OpenStackCluster) GetIdentityRef() (*string, *OpenStackIdentityReference) { + return &c.Namespace, &c.Spec.IdentityRef +} + +func init() { + objectTypes = append(objectTypes, &OpenStackCluster{}, &OpenStackClusterList{}) +} diff --git a/pkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.go b/pkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.go new file mode 100644 index 000000000000..6c78cfea391f --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.go @@ -0,0 +1,57 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OpenStackClusterTemplateResource describes the data needed to create a OpenStackCluster from a template. +type OpenStackClusterTemplateResource struct { + Spec OpenStackClusterSpec `json:"spec"` +} + +// OpenStackClusterTemplateSpec defines the desired state of OpenStackClusterTemplate. +type OpenStackClusterTemplateSpec struct { + Template OpenStackClusterTemplateResource `json:"template"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:resource:path=openstackclustertemplates,scope=Namespaced,categories=cluster-api,shortName=osct + +// OpenStackClusterTemplate is the Schema for the openstackclustertemplates API. +type OpenStackClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// OpenStackClusterTemplateList contains a list of OpenStackClusterTemplate. +type OpenStackClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackClusterTemplate `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &OpenStackClusterTemplate{}, &OpenStackClusterTemplateList{}) +} diff --git a/pkg/capi/openstack/api/v1beta1/openstackmachine_types.go b/pkg/capi/openstack/api/v1beta1/openstackmachine_types.go new file mode 100644 index 000000000000..8b52e62a49b3 --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/openstackmachine_types.go @@ -0,0 +1,297 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + + capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" + "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional" +) + +const ( + // MachineFinalizer allows ReconcileOpenStackMachine to clean up OpenStack resources associated with OpenStackMachine before + // removing it from the apiserver. + MachineFinalizer = "openstackmachine.infrastructure.cluster.x-k8s.io" + IPClaimMachineFinalizer = "openstackmachine.infrastructure.cluster.x-k8s.io/ip-claim" +) + +// SchedulerHintValueType is the type that represents allowed values for the Type field. +// +kubebuilder:validation:Enum=Bool;String;Number +type SchedulerHintValueType string + +// Constants representing the allowed types for SchedulerHintAdditionalValue. +const ( + SchedulerHintTypeBool SchedulerHintValueType = "Bool" + SchedulerHintTypeString SchedulerHintValueType = "String" + SchedulerHintTypeNumber SchedulerHintValueType = "Number" +) + +// SchedulerHintAdditionalValue represents the value of a scheduler hint property. +// The value can be of various types: Bool, String, or Number. +// The Type field indicates the type of the value being used. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Bool' ? has(self.bool) : !has(self.bool)",message="bool is required when type is Bool, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Number' ? has(self.number) : !has(self.number)",message="number is required when type is Number, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'String' ? has(self.string) : !has(self.string)",message="string is required when type is String, and forbidden otherwise" +// +union. +type SchedulerHintAdditionalValue struct { + // Type represents the type of the value. + // Valid values are Bool, String, and Number. + // +kubebuilder:validation:Required + // +unionDiscriminator + Type SchedulerHintValueType `json:"type"` + + // Bool is the boolean value of the scheduler hint, used when Type is "Bool". + // This field is required if type is 'Bool', and must not be set otherwise. + // +unionMember,optional + Bool *bool `json:"bool,omitempty"` + + // Number is the integer value of the scheduler hint, used when Type is "Number". + // This field is required if type is 'Number', and must not be set otherwise. + // +unionMember,optional + Number *int `json:"number,omitempty"` + + // String is the string value of the scheduler hint, used when Type is "String". + // This field is required if type is 'String', and must not be set otherwise. + // +unionMember,optional + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:MaxLength:=255 + String *string `json:"string,omitempty"` +} + +// SchedulerHintAdditionalProperty represents a single additional property for a scheduler hint. +// It includes a Name to identify the property and a Value that can be of various types. +type SchedulerHintAdditionalProperty struct { + // Name is the name of the scheduler hint property. + // It is a unique identifier for the property. + // +kubebuilder:validation:MinLength:=1 + // +kubebuilder:validation:Required + Name string `json:"name"` + + // Value is the value of the scheduler hint property, which can be of various types + // (e.g., bool, string, int). The type is indicated by the Value.Type field. + // +kubebuilder:validation:Required + Value SchedulerHintAdditionalValue `json:"value"` +} + +// OpenStackMachineSpec defines the desired state of OpenStackMachine. +// +kubebuilder:validation:XValidation:message="at least one of flavor or flavorID must be set",rule=(has(self.flavor) || has(self.flavorID)) +type OpenStackMachineSpec struct { + // ProviderID is the unique identifier as specified by the cloud provider. + ProviderID *string `json:"providerID,omitempty"` + + // The flavor reference for the flavor for your server instance. + // +kubebuilder:validation:MinLength=1 + Flavor *string `json:"flavor,omitempty"` + + // FlavorID allows flavors to be specified by ID. This field takes precedence + // over Flavor. + // +kubebuilder:validation:MinLength=1 + FlavorID *string `json:"flavorID,omitempty"` + + // The image to use for your server instance. + // If the rootVolume is specified, this will be used when creating the root volume. + // +required + Image ImageParam `json:"image"` + + // The ssh key to inject in the instance + SSHKeyName string `json:"sshKeyName,omitempty"` + + // Ports to be attached to the server instance. They are created if a port with the given name does not already exist. + // If not specified a default port will be added for the default cluster network. + Ports []PortOpts `json:"ports,omitempty"` + + // The names of the security groups to assign to the instance + SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"` + + // Whether the server instance is created on a trunk port or not. + Trunk bool `json:"trunk,omitempty"` + + // Tags which will be added to the machine and all dependent resources + // which support them. These are in addition to Tags defined on the + // cluster. + // Requires Nova api 2.52 minimum! + // +listType=set + Tags []string `json:"tags,omitempty"` + + // Metadata mapping. Allows you to create a map of key value pairs to add to the server instance. + // +listType=map + // +listMapKey=key + ServerMetadata []ServerMetadata `json:"serverMetadata,omitempty"` + + // Config Drive support + ConfigDrive *bool `json:"configDrive,omitempty"` + + // The volume metadata to boot from + RootVolume *RootVolume `json:"rootVolume,omitempty"` + + // AdditionalBlockDevices is a list of specifications for additional block devices to attach to the server instance + // +listType=map + // +listMapKey=name + // +optional + AdditionalBlockDevices []AdditionalBlockDevice `json:"additionalBlockDevices,omitempty"` + + // The server group to assign the machine to. + // +optional + ServerGroup *ServerGroupParam `json:"serverGroup,omitempty"` + + // IdentityRef is a reference to a secret holding OpenStack credentials + // to be used when reconciling this machine. If not specified, the + // credentials specified in the cluster will be used. + // +optional + IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"` + + // floatingIPPoolRef is a reference to a IPPool that will be assigned + // to an IPAddressClaim. Once the IPAddressClaim is fulfilled, the FloatingIP + // will be assigned to the OpenStackMachine. + // +optional + FloatingIPPoolRef *corev1.TypedLocalObjectReference `json:"floatingIPPoolRef,omitempty"` + + // SchedulerHintAdditionalProperties are arbitrary key/value pairs that provide additional hints + // to the OpenStack scheduler. These hints can influence how instances are placed on the infrastructure, + // such as specifying certain host aggregates or availability zones. + // +optional + // +listType=map + // +listMapKey=name + SchedulerHintAdditionalProperties []SchedulerHintAdditionalProperty `json:"schedulerHintAdditionalProperties,omitempty"` +} + +type ServerMetadata struct { + // Key is the server metadata key + // +kubebuilder:validation:MaxLength:=255 + // +kubebuilder:validation:Required + Key string `json:"key"` + + // Value is the server metadata value + // +kubebuilder:validation:MaxLength:=255 + // +kubebuilder:validation:Required + Value string `json:"value"` +} + +// OpenStackMachineStatus defines the observed state of OpenStackMachine. +type OpenStackMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // InstanceID is the OpenStack instance ID for this machine. + // +optional + InstanceID optional.String `json:"instanceID,omitempty"` + + // Addresses contains the OpenStack instance associated addresses. + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // InstanceState is the state of the OpenStack instance for this machine. + // This field is not set anymore by the OpenStackMachine controller. + // Instead, it's set by the OpenStackServer controller. + // +optional + InstanceState *InstanceState `json:"instanceState,omitempty"` + + // Resolved contains parts of the machine spec with all external + // references fully resolved. + // +optional + Resolved *ResolvedMachineSpec `json:"resolved,omitempty"` + + // Resources contains references to OpenStack resources created for the machine. + // +optional + Resources *MachineResources `json:"resources,omitempty"` + + FailureReason *capoerrors.DeprecatedCAPIMachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackMachine belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" +// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="OpenStack instance ID" +// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this OpenStackMachine" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackMachine" + +// OpenStackMachine is the Schema for the openstackmachines API. +type OpenStackMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackMachineSpec `json:"spec,omitempty"` + Status OpenStackMachineStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// OpenStackMachineList contains a list of OpenStackMachine. +type OpenStackMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackMachine `json:"items"` +} + +// GetConditions returns the observations of the operational state of the OpenStackMachine resource. +func (r *OpenStackMachine) GetConditions() clusterv1beta1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the OpenStackMachine to the predescribed clusterv1.Conditions. +func (r *OpenStackMachine) SetConditions(conditions clusterv1beta1.Conditions) { + r.Status.Conditions = conditions +} + +// SetFailure sets the OpenStackMachine status failure reason and failure message. +func (r *OpenStackMachine) SetFailure(failureReason capoerrors.DeprecatedCAPIMachineStatusError, failureMessage error) { + r.Status.FailureReason = &failureReason + r.Status.FailureMessage = ptr.To(failureMessage.Error()) +} + +var _ IdentityRefProvider = &OpenStackMachine{} + +// GetIdentifyRef returns the object's namespace and IdentityRef if it has an IdentityRef, or nulls if it does not. +func (r *OpenStackMachine) GetIdentityRef() (*string, *OpenStackIdentityReference) { + if r.Spec.IdentityRef != nil { + return &r.Namespace, r.Spec.IdentityRef + } + return nil, nil +} + +func init() { + objectTypes = append(objectTypes, &OpenStackMachine{}, &OpenStackMachineList{}) +} diff --git a/pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go b/pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go new file mode 100644 index 000000000000..a02f02102542 --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go @@ -0,0 +1,52 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OpenStackMachineTemplateSpec defines the desired state of OpenStackMachineTemplate. +type OpenStackMachineTemplateSpec struct { + Template OpenStackMachineTemplateResource `json:"template"` +} + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt + +// OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API. +type OpenStackMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackMachineTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// OpenStackMachineTemplateList contains a list of OpenStackMachineTemplate. +type OpenStackMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackMachineTemplate `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &OpenStackMachineTemplate{}, &OpenStackMachineTemplateList{}) +} diff --git a/pkg/capi/openstack/api/v1beta1/types.go b/pkg/capi/openstack/api/v1beta1/types.go new file mode 100644 index 000000000000..5cb066219e7a --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/types.go @@ -0,0 +1,963 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "k8s.io/utils/ptr" + + "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional" +) + +// OpenStackMachineTemplateResource describes the data needed to create a OpenStackMachine from a template. +type OpenStackMachineTemplateResource struct { + // Spec is the specification of the desired behavior of the machine. + Spec OpenStackMachineSpec `json:"spec"` +} + +type ResourceReference struct { + // Name is the name of the referenced resource + Name string `json:"name"` +} + +// ImageParam describes a glance image. It can be specified by ID, filter, or a +// reference to an ORC Image. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type ImageParam struct { + // ID is the uuid of the image. ID will not be validated before use. + // +kubebuilder:validation:Format:=uuid + // +optional + ID optional.String `json:"id,omitempty"` + + // Filter describes a query for an image. If specified, the combination + // of name and tags must return a single matching image or an error will + // be raised. + // +optional + Filter *ImageFilter `json:"filter,omitempty"` + + // ImageRef is a reference to an ORC Image in the same namespace as the + // referring object. + // +optional + ImageRef *ResourceReference `json:"imageRef,omitempty"` +} + +// ImageFilter describes a query for an image. +// +kubebuilder:validation:MinProperties:=1 +type ImageFilter struct { + // The name of the desired image. If specified, the combination of name and tags must return a single matching image or an error will be raised. + // +optional + Name optional.String `json:"name,omitempty"` + + // The tags associated with the desired image. If specified, the combination of name and tags must return a single matching image or an error will be raised. + // +listType=set + // +optional + Tags []string `json:"tags,omitempty"` +} + +func (f *ImageFilter) IsZero() bool { + if f == nil { + return true + } + return f.Name == nil && len(f.Tags) == 0 +} + +type ExternalRouterIPParam struct { + // The FixedIP in the corresponding subnet + FixedIP string `json:"fixedIP,omitempty"` + // The subnet in which the FixedIP is used for the Gateway of this router + Subnet SubnetParam `json:"subnet"` +} + +// NeutronTag represents a tag on a Neutron resource. +// It may not be empty and may not contain commas. +// +kubebuilder:validation:Pattern:="^[^,]+$" +// +kubebuilder:validation:MinLength:=1 +type NeutronTag string + +type FilterByNeutronTags struct { + // Tags is a list of tags to filter by. If specified, the resource must + // have all of the tags specified to be included in the result. + // +listType=set + // +optional + Tags []NeutronTag `json:"tags,omitempty"` + + // TagsAny is a list of tags to filter by. If specified, the resource + // must have at least one of the tags specified to be included in the + // result. + // +listType=set + // +optional + TagsAny []NeutronTag `json:"tagsAny,omitempty"` + + // NotTags is a list of tags to filter by. If specified, resources which + // contain all of the given tags will be excluded from the result. + // +listType=set + // +optional + NotTags []NeutronTag `json:"notTags,omitempty"` + + // NotTagsAny is a list of tags to filter by. If specified, resources + // which contain any of the given tags will be excluded from the result. + // +listType=set + // +optional + NotTagsAny []NeutronTag `json:"notTagsAny,omitempty"` +} + +func (f *FilterByNeutronTags) IsZero() bool { + return f == nil || (len(f.Tags) == 0 && len(f.TagsAny) == 0 && len(f.NotTags) == 0 && len(f.NotTagsAny) == 0) +} + +// SecurityGroupParam specifies an OpenStack security group. It may be specified by ID or filter, but not both. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type SecurityGroupParam struct { + // ID is the ID of the security group to use. If ID is provided, the other filters cannot be provided. Must be in UUID format. + // +kubebuilder:validation:Format:=uuid + // +optional + ID optional.String `json:"id,omitempty"` + + // Filter specifies a query to select an OpenStack security group. If provided, cannot be empty. + // +optional + Filter *SecurityGroupFilter `json:"filter,omitempty"` +} + +// SecurityGroupFilter specifies a query to select an OpenStack security group. At least one property must be set. +// +kubebuilder:validation:MinProperties:=1 +type SecurityGroupFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ProjectID string `json:"projectID,omitempty"` + + FilterByNeutronTags `json:",inline"` +} + +func (f *SecurityGroupFilter) IsZero() bool { + if f == nil { + return true + } + return f.Name == "" && + f.Description == "" && + f.ProjectID == "" && + f.FilterByNeutronTags.IsZero() +} + +// NetworkParam specifies an OpenStack network. It may be specified by either ID or Filter, but not both. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type NetworkParam struct { + // ID is the ID of the network to use. If ID is provided, the other filters cannot be provided. Must be in UUID format. + // +kubebuilder:validation:Format:=uuid + // +optional + ID optional.String `json:"id,omitempty"` + + // Filter specifies a filter to select an OpenStack network. If provided, cannot be empty. + // +optional + Filter *NetworkFilter `json:"filter,omitempty"` +} + +// NetworkFilter specifies a query to select an OpenStack network. At least one property must be set. +// +kubebuilder:validation:MinProperties:=1 +type NetworkFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ProjectID string `json:"projectID,omitempty"` + + FilterByNeutronTags `json:",inline"` +} + +func (networkFilter *NetworkFilter) IsZero() bool { + if networkFilter == nil { + return true + } + return networkFilter.Name == "" && + networkFilter.Description == "" && + networkFilter.ProjectID == "" && + networkFilter.FilterByNeutronTags.IsZero() +} + +// SubnetParam specifies an OpenStack subnet to use. It may be specified by either ID or filter, but not both. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type SubnetParam struct { + // ID is the uuid of the subnet. It will not be validated. + // +kubebuilder:validation:Format:=uuid + // +optional + ID optional.String `json:"id,omitempty"` + + // Filter specifies a filter to select the subnet. It must match exactly one subnet. + // +optional + Filter *SubnetFilter `json:"filter,omitempty"` +} + +// SubnetFilter specifies a filter to select a subnet. At least one parameter must be specified. +// +kubebuilder:validation:MinProperties:=1 +type SubnetFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ProjectID string `json:"projectID,omitempty"` + IPVersion int `json:"ipVersion,omitempty"` + GatewayIP string `json:"gatewayIP,omitempty"` + CIDR string `json:"cidr,omitempty"` + IPv6AddressMode string `json:"ipv6AddressMode,omitempty"` + IPv6RAMode string `json:"ipv6RAMode,omitempty"` + + FilterByNeutronTags `json:",inline"` +} + +func (subnetFilter *SubnetFilter) IsZero() bool { + if subnetFilter == nil { + return true + } + return subnetFilter.Name == "" && + subnetFilter.Description == "" && + subnetFilter.ProjectID == "" && + subnetFilter.IPVersion == 0 && + subnetFilter.GatewayIP == "" && + subnetFilter.CIDR == "" && + subnetFilter.IPv6AddressMode == "" && + subnetFilter.IPv6RAMode == "" && + subnetFilter.FilterByNeutronTags.IsZero() +} + +// RouterParam specifies an OpenStack router to use. It may be specified by either ID or filter, but not both. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type RouterParam struct { + // ID is the ID of the router to use. If ID is provided, the other filters cannot be provided. Must be in UUID format. + // +kubebuilder:validation:Format:=uuid + // +optional + ID optional.String `json:"id,omitempty"` + + // Filter specifies a filter to select an OpenStack router. If provided, cannot be empty. + Filter *RouterFilter `json:"filter,omitempty"` +} + +// RouterFilter specifies a query to select an OpenStack router. At least one property must be set. +// +kubebuilder:validation:MinProperties:=1 +type RouterFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ProjectID string `json:"projectID,omitempty"` + + FilterByNeutronTags `json:",inline"` +} + +func (f *RouterFilter) IsZero() bool { + if f == nil { + return true + } + return f.Name == "" && + f.Description == "" && + f.ProjectID == "" && + f.FilterByNeutronTags.IsZero() +} + +type SubnetSpec struct { + // CIDR is representing the IP address range used to create the subnet, e.g. 10.0.0.0/24. + // This field is required when defining a subnet. + // +required + CIDR string `json:"cidr"` + + // DNSNameservers holds a list of DNS server addresses that will be provided when creating + // the subnet. These addresses need to have the same IP version as CIDR. + DNSNameservers []string `json:"dnsNameservers,omitempty"` + + // AllocationPools is an array of AllocationPool objects that will be applied to OpenStack Subnet being created. + // If set, OpenStack will only allocate these IPs for Machines. It will still be possible to create ports from + // outside of these ranges manually. + AllocationPools []AllocationPool `json:"allocationPools,omitempty"` +} + +type AllocationPool struct { + // Start represents the start of the AllocationPool, that is the lowest IP of the pool. + // +required + Start string `json:"start"` + + // End represents the end of the AlloctionPool, that is the highest IP of the pool. + // +required + End string `json:"end"` +} + +type PortOpts struct { + // Network is a query for an openstack network that the port will be created or discovered on. + // This will fail if the query returns more than one network. + // +optional + Network *NetworkParam `json:"network,omitempty"` + + // Description is a human-readable description for the port. + // +optional + Description optional.String `json:"description,omitempty"` + + // NameSuffix will be appended to the name of the port if specified. If unspecified, instead the 0-based index of the port in the list is used. + // +optional + NameSuffix optional.String `json:"nameSuffix,omitempty"` + + // FixedIPs is a list of pairs of subnet and/or IP address to assign to the port. If specified, these must be subnets of the port's network. + // +optional + // +listType=atomic + FixedIPs []FixedIP `json:"fixedIPs,omitempty"` + + // SecurityGroups is a list of the names, uuids, filters or any combination these of the security groups to assign to the instance. + // +optional + // +listType=atomic + SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"` + + // Tags applied to the port (and corresponding trunk, if a trunk is configured.) + // These tags are applied in addition to the instance's tags, which will also be applied to the port. + // +listType=set + // +optional + Tags []string `json:"tags,omitempty"` + + // Trunk specifies whether trunking is enabled at the port level. If not + // provided the value is inherited from the machine, or false for a + // bastion host. + // +optional + Trunk *bool `json:"trunk,omitempty"` + + ResolvedPortSpecFields `json:",inline"` +} + +// ResolvePortSpecFields is a convenience struct containing all fields of a +// PortOpts which don't contain references which need to be resolved, and can +// therefore be shared with ResolvedPortSpec. +type ResolvedPortSpecFields struct { + // AdminStateUp specifies whether the port should be created in the up (true) or down (false) state. The default is up. + // +optional + AdminStateUp *bool `json:"adminStateUp,omitempty"` + + // MACAddress specifies the MAC address of the port. If not specified, the MAC address will be generated. + // +optional + MACAddress optional.String `json:"macAddress,omitempty"` + + // AllowedAddressPairs is a list of address pairs which Neutron will + // allow the port to send traffic from in addition to the port's + // addresses. If not specified, the MAC Address will be the MAC Address + // of the port. Depending on the configuration of Neutron, it may be + // supported to specify a CIDR instead of a specific IP address. + // +optional + AllowedAddressPairs []AddressPair `json:"allowedAddressPairs,omitempty"` + + // HostID specifies the ID of the host where the port resides. + // +optional + HostID optional.String `json:"hostID,omitempty"` + + // VNICType specifies the type of vNIC which this port should be + // attached to. This is used to determine which mechanism driver(s) to + // be used to bind the port. The valid values are normal, macvtap, + // direct, baremetal, direct-physical, virtio-forwarder, smart-nic and + // remote-managed, although these values will not be validated in this + // API to ensure compatibility with future neutron changes or custom + // implementations. What type of vNIC is actually available depends on + // deployments. If not specified, the Neutron default value is used. + // +optional + VNICType optional.String `json:"vnicType,omitempty"` + + // Profile is a set of key-value pairs that are used for binding + // details. We intentionally don't expose this as a map[string]string + // because we only want to enable the users to set the values of the + // keys that are known to work in OpenStack Networking API. See + // https://docs.openstack.org/api-ref/network/v2/index.html?expanded=create-port-detail#create-port + // To set profiles, your tenant needs permissions rule:create_port, and + // rule:create_port:binding:profile + // +optional + Profile *BindingProfile `json:"profile,omitempty"` + + // DisablePortSecurity enables or disables the port security when set. + // When not set, it takes the value of the corresponding field at the network level. + // +optional + DisablePortSecurity *bool `json:"disablePortSecurity,omitempty"` + + // PropageteUplinkStatus enables or disables the propagate uplink status on the port. + // +optional + PropagateUplinkStatus *bool `json:"propagateUplinkStatus,omitempty"` + + // Value specs are extra parameters to include in the API request with OpenStack. + // This is an extension point for the API, so what they do and if they are supported, + // depends on the specific OpenStack implementation. + // +optional + // +listType=map + // +listMapKey=name + ValueSpecs []ValueSpec `json:"valueSpecs,omitempty"` +} + +// ResolvedPortSpec is a PortOpts with all contained references fully resolved. +type ResolvedPortSpec struct { + // Name is the name of the port. + Name string `json:"name"` + + // Description is a human-readable description for the port. + Description string `json:"description"` + + // NetworkID is the ID of the network the port will be created in. + NetworkID string `json:"networkID"` + + // Tags applied to the port (and corresponding trunk, if a trunk is configured.) + // +listType=set + // +optional + Tags []string `json:"tags,omitempty"` + + // Trunk specifies whether trunking is enabled at the port level. + // +optional + Trunk optional.Bool `json:"trunk,omitempty"` + + // FixedIPs is a list of pairs of subnet and/or IP address to assign to the port. If specified, these must be subnets of the port's network. + // +optional + // +listType=atomic + FixedIPs []ResolvedFixedIP `json:"fixedIPs,omitempty"` + + // SecurityGroups is a list of security group IDs to assign to the port. + // +optional + // +listType=atomic + SecurityGroups []string `json:"securityGroups,omitempty"` + + ResolvedPortSpecFields `json:",inline"` +} + +type PortStatus struct { + // ID is the unique identifier of the port. + // +required + ID string `json:"id"` +} + +type BindingProfile struct { + // OVSHWOffload enables or disables the OVS hardware offload feature. + // This flag is not required on OpenStack clouds since Yoga as Nova will set it automatically when the port is attached. + // See: https://bugs.launchpad.net/nova/+bug/2020813 + // +optional + OVSHWOffload *bool `json:"ovsHWOffload,omitempty"` + + // TrustedVF enables or disables the “trusted mode” for the VF. + // +optional + TrustedVF *bool `json:"trustedVF,omitempty"` +} + +type FixedIP struct { + // Subnet is an openstack subnet query that will return the id of a subnet to create + // the fixed IP of a port in. This query must not return more than one subnet. + // +optional + Subnet *SubnetParam `json:"subnet,omitempty"` + + // IPAddress is a specific IP address to assign to the port. If Subnet + // is also specified, IPAddress must be a valid IP address in the + // subnet. If Subnet is not specified, IPAddress must be a valid IP + // address in any subnet of the port's network. + // +optional + IPAddress optional.String `json:"ipAddress,omitempty"` +} + +// ResolvedFixedIP is a FixedIP with the Subnet resolved to an ID. +type ResolvedFixedIP struct { + // SubnetID is the id of a subnet to create the fixed IP of a port in. + // +optional + SubnetID optional.String `json:"subnet,omitempty"` + + // IPAddress is a specific IP address to assign to the port. If SubnetID + // is also specified, IPAddress must be a valid IP address in the + // subnet. If Subnet is not specified, IPAddress must be a valid IP + // address in any subnet of the port's network. + // +optional + IPAddress optional.String `json:"ipAddress,omitempty"` +} + +type AddressPair struct { + // IPAddress is the IP address of the allowed address pair. Depending on + // the configuration of Neutron, it may be supported to specify a CIDR + // instead of a specific IP address. + // +kubebuilder:validation:Required + IPAddress string `json:"ipAddress"` + + // MACAddress is the MAC address of the allowed address pair. If not + // specified, the MAC address will be the MAC address of the port. + // +optional + MACAddress optional.String `json:"macAddress,omitempty"` +} + +type BastionStatus struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + SSHKeyName string `json:"sshKeyName,omitempty"` + State InstanceState `json:"state,omitempty"` + IP string `json:"ip,omitempty"` + FloatingIP string `json:"floatingIP,omitempty"` + + // Resolved contains parts of the bastion's machine spec with all + // external references fully resolved. + // +optional + Resolved *ResolvedMachineSpec `json:"resolved,omitempty"` + + // Resources contains references to OpenStack resources created for the bastion. + // +optional + Resources *MachineResources `json:"resources,omitempty"` +} + +type RootVolume struct { + // SizeGiB is the size of the block device in gibibytes (GiB). + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum:=1 + SizeGiB int `json:"sizeGiB"` + + BlockDeviceVolume `json:",inline"` +} + +// BlockDeviceStorage is the storage type of a block device to create and +// contains additional storage options. +// +union +// +//nolint:godot +type BlockDeviceStorage struct { + // Type is the type of block device to create. + // This can be either "Volume" or "Local". + // +unionDiscriminator + Type BlockDeviceType `json:"type"` + + // Volume contains additional storage options for a volume block device. + // +optional + // +unionMember,optional + Volume *BlockDeviceVolume `json:"volume,omitempty"` +} + +// BlockDeviceVolume contains additional storage options for a volume block device. +type BlockDeviceVolume struct { + // Type is the Cinder volume type of the volume. + // If omitted, the default Cinder volume type that is configured in the OpenStack cloud + // will be used. + // +optional + Type string `json:"type,omitempty"` + + // AvailabilityZone is the volume availability zone to create the volume + // in. If not specified, the volume will be created without an explicit + // availability zone. + // +optional + AvailabilityZone *VolumeAvailabilityZone `json:"availabilityZone,omitempty"` +} + +// VolumeAZSource specifies where to obtain the availability zone for a volume. +// +kubebuilder:validation:Enum=Name;Machine +type VolumeAZSource string + +const ( + VolumeAZFromName VolumeAZSource = "Name" + VolumeAZFromMachine VolumeAZSource = "Machine" +) + +// VolumeAZName is the name of a volume availability zone. It may not contain spaces. +// +kubebuilder:validation:Pattern:="^[^ ]+$" +// +kubebuilder:validation:MinLength:=1 +type VolumeAZName string + +// VolumeAvailabilityZone specifies the availability zone for a volume. +// +kubebuilder:validation:XValidation:rule="!has(self.from) || self.from == 'Name' ? has(self.name) : !has(self.name)",message="name is required when from is 'Name' or default" +type VolumeAvailabilityZone struct { + // From specifies where we will obtain the availability zone for the + // volume. The options are "Name" and "Machine". If "Name" is specified + // then the Name field must also be specified. If "Machine" is specified + // the volume will use the value of FailureDomain, if any, from the + // associated Machine. + // +kubebuilder:default:=Name + // +optional + From VolumeAZSource `json:"from,omitempty"` + + // Name is the name of a volume availability zone to use. It is required + // if From is "Name". The volume availability zone name may not contain + // spaces. + // +optional + Name *VolumeAZName `json:"name,omitempty"` +} + +// AdditionalBlockDevice is a block device to attach to the server. +type AdditionalBlockDevice struct { + // Name of the block device in the context of a machine. + // If the block device is a volume, the Cinder volume will be named + // as a combination of the machine name and this name. + // Also, this name will be used for tagging the block device. + // Information about the block device tag can be obtained from the OpenStack + // metadata API or the config drive. + // Name cannot be 'root', which is reserved for the root volume. + // +kubebuilder:validation:Required + Name string `json:"name"` + + // SizeGiB is the size of the block device in gibibytes (GiB). + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum:=1 + SizeGiB int `json:"sizeGiB"` + + // Storage specifies the storage type of the block device and + // additional storage options. + Storage BlockDeviceStorage `json:"storage"` +} + +// ServerGroupParam specifies an OpenStack server group. It may be specified by ID or filter, but not both. +// +kubebuilder:validation:MaxProperties:=1 +// +kubebuilder:validation:MinProperties:=1 +type ServerGroupParam struct { + // ID is the ID of the server group to use. + // +kubebuilder:validation:Format:=uuid + ID optional.String `json:"id,omitempty"` + + // Filter specifies a query to select an OpenStack server group. If provided, it cannot be empty. + Filter *ServerGroupFilter `json:"filter,omitempty"` +} + +// ServerGroupFilter specifies a query to select an OpenStack server group. At least one property must be set. +// +kubebuilder:validation:MinProperties:=1 +type ServerGroupFilter struct { + // Name is the name of a server group to look for. + Name optional.String `json:"name,omitempty"` +} + +func (f *ServerGroupFilter) IsZero() bool { + if f == nil { + return true + } + return f.Name == nil +} + +// BlockDeviceType defines the type of block device to create. +type BlockDeviceType string + +const ( + // LocalBlockDevice is an ephemeral block device attached to the server. + LocalBlockDevice BlockDeviceType = "Local" + + // VolumeBlockDevice is a volume block device attached to the server. + VolumeBlockDevice BlockDeviceType = "Volume" +) + +// NetworkStatus contains basic information about an existing neutron network. +type NetworkStatus struct { + Name string `json:"name"` + ID string `json:"id"` + + //+optional + Tags []string `json:"tags,omitempty"` +} + +// NetworkStatusWithSubnets represents basic information about an existing neutron network and an associated set of subnets. +type NetworkStatusWithSubnets struct { + NetworkStatus `json:",inline"` + + // Subnets is a list of subnets associated with the default cluster network. Machines which use the default cluster network will get an address from all of these subnets. + Subnets []Subnet `json:"subnets,omitempty"` +} + +// Subnet represents basic information about the associated OpenStack Neutron Subnet. +type Subnet struct { + Name string `json:"name"` + ID string `json:"id"` + + CIDR string `json:"cidr"` + + //+optional + Tags []string `json:"tags,omitempty"` +} + +// Router represents basic information about the associated OpenStack Neutron Router. +type Router struct { + Name string `json:"name"` + ID string `json:"id"` + //+optional + Tags []string `json:"tags,omitempty"` + //+optional + IPs []string `json:"ips,omitempty"` +} + +// LoadBalancer represents basic information about the associated OpenStack LoadBalancer. +type LoadBalancer struct { + Name string `json:"name"` + ID string `json:"id"` + IP string `json:"ip"` + InternalIP string `json:"internalIP"` + //+optional + AllowedCIDRs []string `json:"allowedCIDRs,omitempty"` + //+optional + Tags []string `json:"tags,omitempty"` + // LoadBalancerNetwork contains information about network and/or subnets which the + // loadbalancer is allocated on. + // If subnets are specified within the LoadBalancerNetwork currently only the first + // subnet in the list is taken into account. + // +optional + LoadBalancerNetwork *NetworkStatusWithSubnets `json:"loadBalancerNetwork,omitempty"` +} + +// SecurityGroupStatus represents the basic information of the associated +// OpenStack Neutron Security Group. +type SecurityGroupStatus struct { + // name of the security group + // +kubebuilder:validation:Required + Name string `json:"name"` + + // id of the security group + // +kubebuilder:validation:Required + ID string `json:"id"` +} + +// SecurityGroupRuleSpec represent the basic information of the associated OpenStack +// Security Group Role. +// For now this is only used for the allNodesSecurityGroupRules but when we add +// other security groups, we'll need to add a validation because +// Remote* fields are mutually exclusive. +type SecurityGroupRuleSpec struct { + // name of the security group rule. + // It's used to identify the rule so it can be patched and will not be sent to the OpenStack API. + // +kubebuilder:validation:Required + Name string `json:"name"` + + // description of the security group rule. + // +optional + Description *string `json:"description,omitempty"` + + // direction in which the security group rule is applied. The only values + // allowed are "ingress" or "egress". For a compute instance, an ingress + // security group rule is applied to incoming (ingress) traffic for that + // instance. An egress rule is applied to traffic leaving the instance. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=ingress;egress + Direction string `json:"direction"` + + // etherType must be IPv4 or IPv6, and addresses represented in CIDR must match the + // ingress or egress rules. + // +kubebuilder:validation:Enum=IPv4;IPv6 + // +optional + EtherType *string `json:"etherType,omitempty"` + + // portRangeMin is a number in the range that is matched by the security group + // rule. If the protocol is TCP or UDP, this value must be less than or equal + // to the value of the portRangeMax attribute. + // +optional + PortRangeMin *int `json:"portRangeMin,omitempty"` + + // portRangeMax is a number in the range that is matched by the security group + // rule. The portRangeMin attribute constrains the portRangeMax attribute. + // +optional + PortRangeMax *int `json:"portRangeMax,omitempty"` + + // protocol is the protocol that is matched by the security group rule. + // +optional + Protocol *string `json:"protocol,omitempty"` + + // remoteGroupID is the remote group ID to be associated with this security group rule. + // You can specify either remoteGroupID or remoteIPPrefix or remoteManagedGroups. + // +optional + RemoteGroupID *string `json:"remoteGroupID,omitempty"` + + // remoteIPPrefix is the remote IP prefix to be associated with this security group rule. + // You can specify either remoteGroupID or remoteIPPrefix or remoteManagedGroups. + // +optional + RemoteIPPrefix *string `json:"remoteIPPrefix,omitempty"` + + // remoteManagedGroups is the remote managed groups to be associated with this security group rule. + // You can specify either remoteGroupID or remoteIPPrefix or remoteManagedGroups. + // +optional + RemoteManagedGroups []ManagedSecurityGroupName `json:"remoteManagedGroups,omitempty"` +} + +// +kubebuilder:validation:Enum=bastion;controlplane;worker +type ManagedSecurityGroupName string + +func (m ManagedSecurityGroupName) String() string { + return string(m) +} + +// InstanceState describes the state of an OpenStack instance. +type InstanceState string + +var ( + // InstanceStateBuild is the string representing an instance in a build state. + InstanceStateBuild = InstanceState("BUILD") + + // InstanceStateActive is the string representing an instance in an active state. + InstanceStateActive = InstanceState("ACTIVE") + + // InstanceStateError is the string representing an instance in an error state. + InstanceStateError = InstanceState("ERROR") + + // InstanceStateStopped is the string representing an instance in a stopped state. + InstanceStateStopped = InstanceState("STOPPED") + + // InstanceStateShutoff is the string representing an instance in a shutoff state. + InstanceStateShutoff = InstanceState("SHUTOFF") + + // InstanceStateDeleted is the string representing an instance in a deleted state. + InstanceStateDeleted = InstanceState("DELETED") + + // InstanceStateUndefined is the string representing an undefined instance state. + InstanceStateUndefined = InstanceState("") +) + +// Bastion represents basic information about the bastion node. If you enable bastion, the spec has to be specified. +// +kubebuilder:validation:XValidation:rule="!self.enabled || has(self.spec)",message="spec is required if bastion is enabled" +type Bastion struct { + // Enabled means that bastion is enabled. The bastion is enabled by + // default if this field is not specified. Set this field to false to disable the + // bastion. + // + // It is not currently possible to remove the bastion from the cluster + // spec without first disabling it by setting this field to false and + // waiting until the bastion has been deleted. + // +kubebuilder:default:=true + // +optional + Enabled *bool `json:"enabled,omitempty"` + + // Spec for the bastion itself + Spec *OpenStackMachineSpec `json:"spec,omitempty"` + + // AvailabilityZone is the failure domain that will be used to create the Bastion Spec. + //+optional + AvailabilityZone optional.String `json:"availabilityZone,omitempty"` + + // FloatingIP which will be associated to the bastion machine. It's the IP address, not UUID. + // The floating IP should already exist and should not be associated with a port. If FIP of this address does not + // exist, CAPO will try to create it, but by default only OpenStack administrators have privileges to do so. + //+optional + //+kubebuilder:validation:Format:=ipv4 + FloatingIP optional.String `json:"floatingIP,omitempty"` +} + +func (b *Bastion) IsEnabled() bool { + if b == nil { + return false + } + return b.Enabled == nil || *b.Enabled +} + +type APIServerLoadBalancer struct { + // Enabled defines whether a load balancer should be created. This value + // defaults to true if an APIServerLoadBalancer is given. + // + // There is no reason to set this to false. To disable creation of the + // API server loadbalancer, omit the APIServerLoadBalancer field in the + // cluster spec instead. + // + // +kubebuilder:validation:Required + // +kubebuilder:default:=true + Enabled *bool `json:"enabled"` + + // AdditionalPorts adds additional tcp ports to the load balancer. + // +optional + // +listType=set + AdditionalPorts []int `json:"additionalPorts,omitempty"` + + // AllowedCIDRs restrict access to all API-Server listeners to the given address CIDRs. + // +optional + // +listType=set + AllowedCIDRs []string `json:"allowedCIDRs,omitempty"` + + // Provider specifies name of a specific Octavia provider to use for the + // API load balancer. The Octavia default will be used if it is not + // specified. + // +optional + Provider optional.String `json:"provider,omitempty"` + + // Network defines which network should the load balancer be allocated on. + //+optional + Network *NetworkParam `json:"network,omitempty"` + + // Subnets define which subnets should the load balancer be allocated on. + // It is expected that subnets are located on the network specified in this resource. + // Only the first element is taken into account. + // +optional + // +listType=atomic + // kubebuilder:validation:MaxLength:=2 + Subnets []SubnetParam `json:"subnets,omitempty"` + + // AvailabilityZone is the failure domain that will be used to create the APIServerLoadBalancer Spec. + //+optional + AvailabilityZone optional.String `json:"availabilityZone,omitempty"` + + // Flavor is the flavor name that will be used to create the APIServerLoadBalancer Spec. + //+optional + Flavor optional.String `json:"flavor,omitempty"` + + // Monitor contains configuration for the load balancer health monitor. + //+optional + Monitor *APIServerLoadBalancerMonitor `json:"monitor,omitempty"` +} + +// APIServerLoadBalancerMonitor contains configuration for the load balancer health monitor. +type APIServerLoadBalancerMonitor struct { + // Delay is the time in seconds between sending probes to members. + //+optional + //+kubebuilder:validation:Minimum=0 + //+kubebuilder:default:10 + Delay int `json:"delay,omitempty"` + + // Timeout is the maximum time in seconds for a monitor to wait for a connection to be established before it times out. + //+optional + //+kubebuilder:validation:Minimum=0 + //+kubebuilder:default:5 + Timeout int `json:"timeout,omitempty"` + + // MaxRetries is the number of successful checks before changing the operating status of the member to ONLINE. + //+optional + //+kubebuilder:validation:Minimum=0 + //+kubebuilder:validation:Maximum=10 + //+kubebuilder:default:5 + MaxRetries int `json:"maxRetries,omitempty"` + + // MaxRetriesDown is the number of allowed check failures before changing the operating status of the member to ERROR. + //+optional + //+kubebuilder:validation:Minimum=1 + //+kubebuilder:validation:Maximum=10 + //+kubebuilder:default:3 + MaxRetriesDown int `json:"maxRetriesDown,omitempty"` +} + +func (s *APIServerLoadBalancer) IsZero() bool { + return s == nil || ((s.Enabled == nil || !*s.Enabled) && len(s.AdditionalPorts) == 0 && len(s.AllowedCIDRs) == 0 && ptr.Deref(s.Provider, "") == "") +} + +func (s *APIServerLoadBalancer) IsEnabled() bool { + // The CRD default value for Enabled is true, so if the field is nil, it should be considered as true. + return s != nil && (s.Enabled == nil || *s.Enabled) +} + +// ResolvedMachineSpec contains resolved references to resources required by the machine. +type ResolvedMachineSpec struct { + // ServerGroupID is the ID of the server group the machine should be added to and is calculated based on ServerGroupFilter. + // +optional + ServerGroupID string `json:"serverGroupID,omitempty"` + + // ImageID is the ID of the image to use for the machine and is calculated based on ImageFilter. + // +optional + ImageID string `json:"imageID,omitempty"` + + // FlavorID is the ID of the flavor to use. + // +optional + FlavorID string `json:"flavorID,omitempty"` + + // Ports is the fully resolved list of ports to create for the machine. + // +optional + Ports []ResolvedPortSpec `json:"ports,omitempty"` +} + +type MachineResources struct { + // Ports is the status of the ports created for the machine. + // +optional + Ports []PortStatus `json:"ports,omitempty"` +} + +// ValueSpec represents a single value_spec key-value pair. +type ValueSpec struct { + // Name is the name of the key-value pair. + // This is just for identifying the pair and will not be sent to the OpenStack API. + // +kubebuilder:validation:Required + Name string `json:"name"` + // Key is the key in the key-value pair. + // +kubebuilder:validation:Required + Key string `json:"key"` + // Value is the value in the key-value pair. + // +kubebuilder:validation:Required + Value string `json:"value"` +} diff --git a/pkg/capi/openstack/api/v1beta1/zz_generated.deepcopy.go b/pkg/capi/openstack/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..41256111f450 --- /dev/null +++ b/pkg/capi/openstack/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,1892 @@ +//go:build !ignore_autogenerated + +/* + + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerLoadBalancer) DeepCopyInto(out *APIServerLoadBalancer) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.AdditionalPorts != nil { + in, out := &in.AdditionalPorts, &out.AdditionalPorts + *out = make([]int, len(*in)) + copy(*out, *in) + } + if in.AllowedCIDRs != nil { + in, out := &in.AllowedCIDRs, &out.AllowedCIDRs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Provider != nil { + in, out := &in.Provider, &out.Provider + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(NetworkParam) + (*in).DeepCopyInto(*out) + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]SubnetParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AvailabilityZone != nil { + in, out := &in.AvailabilityZone, &out.AvailabilityZone + *out = new(string) + **out = **in + } + if in.Flavor != nil { + in, out := &in.Flavor, &out.Flavor + *out = new(string) + **out = **in + } + if in.Monitor != nil { + in, out := &in.Monitor, &out.Monitor + *out = new(APIServerLoadBalancerMonitor) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerLoadBalancer. +func (in *APIServerLoadBalancer) DeepCopy() *APIServerLoadBalancer { + if in == nil { + return nil + } + out := new(APIServerLoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerLoadBalancerMonitor) DeepCopyInto(out *APIServerLoadBalancerMonitor) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerLoadBalancerMonitor. +func (in *APIServerLoadBalancerMonitor) DeepCopy() *APIServerLoadBalancerMonitor { + if in == nil { + return nil + } + out := new(APIServerLoadBalancerMonitor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdditionalBlockDevice) DeepCopyInto(out *AdditionalBlockDevice) { + *out = *in + in.Storage.DeepCopyInto(&out.Storage) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdditionalBlockDevice. +func (in *AdditionalBlockDevice) DeepCopy() *AdditionalBlockDevice { + if in == nil { + return nil + } + out := new(AdditionalBlockDevice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddressPair) DeepCopyInto(out *AddressPair) { + *out = *in + if in.MACAddress != nil { + in, out := &in.MACAddress, &out.MACAddress + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressPair. +func (in *AddressPair) DeepCopy() *AddressPair { + if in == nil { + return nil + } + out := new(AddressPair) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllocationPool) DeepCopyInto(out *AllocationPool) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationPool. +func (in *AllocationPool) DeepCopy() *AllocationPool { + if in == nil { + return nil + } + out := new(AllocationPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Bastion) DeepCopyInto(out *Bastion) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(OpenStackMachineSpec) + (*in).DeepCopyInto(*out) + } + if in.AvailabilityZone != nil { + in, out := &in.AvailabilityZone, &out.AvailabilityZone + *out = new(string) + **out = **in + } + if in.FloatingIP != nil { + in, out := &in.FloatingIP, &out.FloatingIP + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bastion. +func (in *Bastion) DeepCopy() *Bastion { + if in == nil { + return nil + } + out := new(Bastion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BastionStatus) DeepCopyInto(out *BastionStatus) { + *out = *in + if in.Resolved != nil { + in, out := &in.Resolved, &out.Resolved + *out = new(ResolvedMachineSpec) + (*in).DeepCopyInto(*out) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(MachineResources) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BastionStatus. +func (in *BastionStatus) DeepCopy() *BastionStatus { + if in == nil { + return nil + } + out := new(BastionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BindingProfile) DeepCopyInto(out *BindingProfile) { + *out = *in + if in.OVSHWOffload != nil { + in, out := &in.OVSHWOffload, &out.OVSHWOffload + *out = new(bool) + **out = **in + } + if in.TrustedVF != nil { + in, out := &in.TrustedVF, &out.TrustedVF + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BindingProfile. +func (in *BindingProfile) DeepCopy() *BindingProfile { + if in == nil { + return nil + } + out := new(BindingProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceStorage) DeepCopyInto(out *BlockDeviceStorage) { + *out = *in + if in.Volume != nil { + in, out := &in.Volume, &out.Volume + *out = new(BlockDeviceVolume) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceStorage. +func (in *BlockDeviceStorage) DeepCopy() *BlockDeviceStorage { + if in == nil { + return nil + } + out := new(BlockDeviceStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceVolume) DeepCopyInto(out *BlockDeviceVolume) { + *out = *in + if in.AvailabilityZone != nil { + in, out := &in.AvailabilityZone, &out.AvailabilityZone + *out = new(VolumeAvailabilityZone) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceVolume. +func (in *BlockDeviceVolume) DeepCopy() *BlockDeviceVolume { + if in == nil { + return nil + } + out := new(BlockDeviceVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalRouterIPParam) DeepCopyInto(out *ExternalRouterIPParam) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRouterIPParam. +func (in *ExternalRouterIPParam) DeepCopy() *ExternalRouterIPParam { + if in == nil { + return nil + } + out := new(ExternalRouterIPParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FilterByNeutronTags) DeepCopyInto(out *FilterByNeutronTags) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]NeutronTag, len(*in)) + copy(*out, *in) + } + if in.TagsAny != nil { + in, out := &in.TagsAny, &out.TagsAny + *out = make([]NeutronTag, len(*in)) + copy(*out, *in) + } + if in.NotTags != nil { + in, out := &in.NotTags, &out.NotTags + *out = make([]NeutronTag, len(*in)) + copy(*out, *in) + } + if in.NotTagsAny != nil { + in, out := &in.NotTagsAny, &out.NotTagsAny + *out = make([]NeutronTag, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FilterByNeutronTags. +func (in *FilterByNeutronTags) DeepCopy() *FilterByNeutronTags { + if in == nil { + return nil + } + out := new(FilterByNeutronTags) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FixedIP) DeepCopyInto(out *FixedIP) { + *out = *in + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(SubnetParam) + (*in).DeepCopyInto(*out) + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FixedIP. +func (in *FixedIP) DeepCopy() *FixedIP { + if in == nil { + return nil + } + out := new(FixedIP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageFilter) DeepCopyInto(out *ImageFilter) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageFilter. +func (in *ImageFilter) DeepCopy() *ImageFilter { + if in == nil { + return nil + } + out := new(ImageFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageParam) DeepCopyInto(out *ImageParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(ImageFilter) + (*in).DeepCopyInto(*out) + } + if in.ImageRef != nil { + in, out := &in.ImageRef, &out.ImageRef + *out = new(ResourceReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageParam. +func (in *ImageParam) DeepCopy() *ImageParam { + if in == nil { + return nil + } + out := new(ImageParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *out = *in + if in.AllowedCIDRs != nil { + in, out := &in.AllowedCIDRs, &out.AllowedCIDRs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LoadBalancerNetwork != nil { + in, out := &in.LoadBalancerNetwork, &out.LoadBalancerNetwork + *out = new(NetworkStatusWithSubnets) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineResources) DeepCopyInto(out *MachineResources) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]PortStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineResources. +func (in *MachineResources) DeepCopy() *MachineResources { + if in == nil { + return nil + } + out := new(MachineResources) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedSecurityGroups) DeepCopyInto(out *ManagedSecurityGroups) { + *out = *in + if in.AllNodesSecurityGroupRules != nil { + in, out := &in.AllNodesSecurityGroupRules, &out.AllNodesSecurityGroupRules + *out = make([]SecurityGroupRuleSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ControlPlaneNodesSecurityGroupRules != nil { + in, out := &in.ControlPlaneNodesSecurityGroupRules, &out.ControlPlaneNodesSecurityGroupRules + *out = make([]SecurityGroupRuleSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.WorkerNodesSecurityGroupRules != nil { + in, out := &in.WorkerNodesSecurityGroupRules, &out.WorkerNodesSecurityGroupRules + *out = make([]SecurityGroupRuleSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedSecurityGroups. +func (in *ManagedSecurityGroups) DeepCopy() *ManagedSecurityGroups { + if in == nil { + return nil + } + out := new(ManagedSecurityGroups) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFilter) DeepCopyInto(out *NetworkFilter) { + *out = *in + in.FilterByNeutronTags.DeepCopyInto(&out.FilterByNeutronTags) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFilter. +func (in *NetworkFilter) DeepCopy() *NetworkFilter { + if in == nil { + return nil + } + out := new(NetworkFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkParam) DeepCopyInto(out *NetworkParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(NetworkFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkParam. +func (in *NetworkParam) DeepCopy() *NetworkParam { + if in == nil { + return nil + } + out := new(NetworkParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatusWithSubnets) DeepCopyInto(out *NetworkStatusWithSubnets) { + *out = *in + in.NetworkStatus.DeepCopyInto(&out.NetworkStatus) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]Subnet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatusWithSubnets. +func (in *NetworkStatusWithSubnets) DeepCopy() *NetworkStatusWithSubnets { + if in == nil { + return nil + } + out := new(NetworkStatusWithSubnets) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackCluster) DeepCopyInto(out *OpenStackCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackCluster. +func (in *OpenStackCluster) DeepCopy() *OpenStackCluster { + if in == nil { + return nil + } + out := new(OpenStackCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackCluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterList) DeepCopyInto(out *OpenStackClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterList. +func (in *OpenStackClusterList) DeepCopy() *OpenStackClusterList { + if in == nil { + return nil + } + out := new(OpenStackClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterSpec) DeepCopyInto(out *OpenStackClusterSpec) { + *out = *in + if in.ManagedSubnets != nil { + in, out := &in.ManagedSubnets, &out.ManagedSubnets + *out = make([]SubnetSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Router != nil { + in, out := &in.Router, &out.Router + *out = new(RouterParam) + (*in).DeepCopyInto(*out) + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(NetworkParam) + (*in).DeepCopyInto(*out) + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]SubnetParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkMTU != nil { + in, out := &in.NetworkMTU, &out.NetworkMTU + *out = new(int) + **out = **in + } + if in.ExternalRouterIPs != nil { + in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs + *out = make([]ExternalRouterIPParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ExternalNetwork != nil { + in, out := &in.ExternalNetwork, &out.ExternalNetwork + *out = new(NetworkParam) + (*in).DeepCopyInto(*out) + } + if in.DisableExternalNetwork != nil { + in, out := &in.DisableExternalNetwork, &out.DisableExternalNetwork + *out = new(bool) + **out = **in + } + if in.APIServerLoadBalancer != nil { + in, out := &in.APIServerLoadBalancer, &out.APIServerLoadBalancer + *out = new(APIServerLoadBalancer) + (*in).DeepCopyInto(*out) + } + if in.DisableAPIServerFloatingIP != nil { + in, out := &in.DisableAPIServerFloatingIP, &out.DisableAPIServerFloatingIP + *out = new(bool) + **out = **in + } + if in.APIServerFloatingIP != nil { + in, out := &in.APIServerFloatingIP, &out.APIServerFloatingIP + *out = new(string) + **out = **in + } + if in.APIServerFixedIP != nil { + in, out := &in.APIServerFixedIP, &out.APIServerFixedIP + *out = new(string) + **out = **in + } + if in.APIServerPort != nil { + in, out := &in.APIServerPort, &out.APIServerPort + *out = new(uint16) + **out = **in + } + if in.ManagedSecurityGroups != nil { + in, out := &in.ManagedSecurityGroups, &out.ManagedSecurityGroups + *out = new(ManagedSecurityGroups) + (*in).DeepCopyInto(*out) + } + if in.DisablePortSecurity != nil { + in, out := &in.DisablePortSecurity, &out.DisablePortSecurity + *out = new(bool) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ControlPlaneEndpoint != nil { + in, out := &in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint + *out = new(corev1beta1.APIEndpoint) + **out = **in + } + if in.ControlPlaneAvailabilityZones != nil { + in, out := &in.ControlPlaneAvailabilityZones, &out.ControlPlaneAvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ControlPlaneOmitAvailabilityZone != nil { + in, out := &in.ControlPlaneOmitAvailabilityZone, &out.ControlPlaneOmitAvailabilityZone + *out = new(bool) + **out = **in + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(Bastion) + (*in).DeepCopyInto(*out) + } + out.IdentityRef = in.IdentityRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterSpec. +func (in *OpenStackClusterSpec) DeepCopy() *OpenStackClusterSpec { + if in == nil { + return nil + } + out := new(OpenStackClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterStatus) DeepCopyInto(out *OpenStackClusterStatus) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(NetworkStatusWithSubnets) + (*in).DeepCopyInto(*out) + } + if in.ExternalNetwork != nil { + in, out := &in.ExternalNetwork, &out.ExternalNetwork + *out = new(NetworkStatus) + (*in).DeepCopyInto(*out) + } + if in.Router != nil { + in, out := &in.Router, &out.Router + *out = new(Router) + (*in).DeepCopyInto(*out) + } + if in.APIServerLoadBalancer != nil { + in, out := &in.APIServerLoadBalancer, &out.APIServerLoadBalancer + *out = new(LoadBalancer) + (*in).DeepCopyInto(*out) + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(corev1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.ControlPlaneSecurityGroup != nil { + in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup + *out = new(SecurityGroupStatus) + **out = **in + } + if in.WorkerSecurityGroup != nil { + in, out := &in.WorkerSecurityGroup, &out.WorkerSecurityGroup + *out = new(SecurityGroupStatus) + **out = **in + } + if in.BastionSecurityGroup != nil { + in, out := &in.BastionSecurityGroup, &out.BastionSecurityGroup + *out = new(SecurityGroupStatus) + **out = **in + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(BastionStatus) + (*in).DeepCopyInto(*out) + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.DeprecatedCAPIClusterStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterStatus. +func (in *OpenStackClusterStatus) DeepCopy() *OpenStackClusterStatus { + if in == nil { + return nil + } + out := new(OpenStackClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterTemplate) DeepCopyInto(out *OpenStackClusterTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplate. +func (in *OpenStackClusterTemplate) DeepCopy() *OpenStackClusterTemplate { + if in == nil { + return nil + } + out := new(OpenStackClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackClusterTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterTemplateList) DeepCopyInto(out *OpenStackClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateList. +func (in *OpenStackClusterTemplateList) DeepCopy() *OpenStackClusterTemplateList { + if in == nil { + return nil + } + out := new(OpenStackClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackClusterTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterTemplateResource) DeepCopyInto(out *OpenStackClusterTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateResource. +func (in *OpenStackClusterTemplateResource) DeepCopy() *OpenStackClusterTemplateResource { + if in == nil { + return nil + } + out := new(OpenStackClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackClusterTemplateSpec) DeepCopyInto(out *OpenStackClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateSpec. +func (in *OpenStackClusterTemplateSpec) DeepCopy() *OpenStackClusterTemplateSpec { + if in == nil { + return nil + } + out := new(OpenStackClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackIdentityReference) DeepCopyInto(out *OpenStackIdentityReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackIdentityReference. +func (in *OpenStackIdentityReference) DeepCopy() *OpenStackIdentityReference { + if in == nil { + return nil + } + out := new(OpenStackIdentityReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachine) DeepCopyInto(out *OpenStackMachine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachine. +func (in *OpenStackMachine) DeepCopy() *OpenStackMachine { + if in == nil { + return nil + } + out := new(OpenStackMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineList) DeepCopyInto(out *OpenStackMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineList. +func (in *OpenStackMachineList) DeepCopy() *OpenStackMachineList { + if in == nil { + return nil + } + out := new(OpenStackMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineSpec) DeepCopyInto(out *OpenStackMachineSpec) { + *out = *in + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.Flavor != nil { + in, out := &in.Flavor, &out.Flavor + *out = new(string) + **out = **in + } + if in.FlavorID != nil { + in, out := &in.FlavorID, &out.FlavorID + *out = new(string) + **out = **in + } + in.Image.DeepCopyInto(&out.Image) + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]PortOpts, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]SecurityGroupParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServerMetadata != nil { + in, out := &in.ServerMetadata, &out.ServerMetadata + *out = make([]ServerMetadata, len(*in)) + copy(*out, *in) + } + if in.ConfigDrive != nil { + in, out := &in.ConfigDrive, &out.ConfigDrive + *out = new(bool) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(RootVolume) + (*in).DeepCopyInto(*out) + } + if in.AdditionalBlockDevices != nil { + in, out := &in.AdditionalBlockDevices, &out.AdditionalBlockDevices + *out = make([]AdditionalBlockDevice, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServerGroup != nil { + in, out := &in.ServerGroup, &out.ServerGroup + *out = new(ServerGroupParam) + (*in).DeepCopyInto(*out) + } + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(OpenStackIdentityReference) + **out = **in + } + if in.FloatingIPPoolRef != nil { + in, out := &in.FloatingIPPoolRef, &out.FloatingIPPoolRef + *out = new(v1.TypedLocalObjectReference) + (*in).DeepCopyInto(*out) + } + if in.SchedulerHintAdditionalProperties != nil { + in, out := &in.SchedulerHintAdditionalProperties, &out.SchedulerHintAdditionalProperties + *out = make([]SchedulerHintAdditionalProperty, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineSpec. +func (in *OpenStackMachineSpec) DeepCopy() *OpenStackMachineSpec { + if in == nil { + return nil + } + out := new(OpenStackMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineStatus) DeepCopyInto(out *OpenStackMachineStatus) { + *out = *in + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(InstanceState) + **out = **in + } + if in.Resolved != nil { + in, out := &in.Resolved, &out.Resolved + *out = new(ResolvedMachineSpec) + (*in).DeepCopyInto(*out) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(MachineResources) + (*in).DeepCopyInto(*out) + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.DeprecatedCAPIMachineStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineStatus. +func (in *OpenStackMachineStatus) DeepCopy() *OpenStackMachineStatus { + if in == nil { + return nil + } + out := new(OpenStackMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineTemplate) DeepCopyInto(out *OpenStackMachineTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplate. +func (in *OpenStackMachineTemplate) DeepCopy() *OpenStackMachineTemplate { + if in == nil { + return nil + } + out := new(OpenStackMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachineTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineTemplateList) DeepCopyInto(out *OpenStackMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateList. +func (in *OpenStackMachineTemplateList) DeepCopy() *OpenStackMachineTemplateList { + if in == nil { + return nil + } + out := new(OpenStackMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackMachineTemplateList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineTemplateResource) DeepCopyInto(out *OpenStackMachineTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateResource. +func (in *OpenStackMachineTemplateResource) DeepCopy() *OpenStackMachineTemplateResource { + if in == nil { + return nil + } + out := new(OpenStackMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackMachineTemplateSpec) DeepCopyInto(out *OpenStackMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateSpec. +func (in *OpenStackMachineTemplateSpec) DeepCopy() *OpenStackMachineTemplateSpec { + if in == nil { + return nil + } + out := new(OpenStackMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortOpts) DeepCopyInto(out *PortOpts) { + *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(NetworkParam) + (*in).DeepCopyInto(*out) + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.NameSuffix != nil { + in, out := &in.NameSuffix, &out.NameSuffix + *out = new(string) + **out = **in + } + if in.FixedIPs != nil { + in, out := &in.FixedIPs, &out.FixedIPs + *out = make([]FixedIP, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]SecurityGroupParam, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Trunk != nil { + in, out := &in.Trunk, &out.Trunk + *out = new(bool) + **out = **in + } + in.ResolvedPortSpecFields.DeepCopyInto(&out.ResolvedPortSpecFields) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortOpts. +func (in *PortOpts) DeepCopy() *PortOpts { + if in == nil { + return nil + } + out := new(PortOpts) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortStatus) DeepCopyInto(out *PortStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortStatus. +func (in *PortStatus) DeepCopy() *PortStatus { + if in == nil { + return nil + } + out := new(PortStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResolvedFixedIP) DeepCopyInto(out *ResolvedFixedIP) { + *out = *in + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedFixedIP. +func (in *ResolvedFixedIP) DeepCopy() *ResolvedFixedIP { + if in == nil { + return nil + } + out := new(ResolvedFixedIP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResolvedMachineSpec) DeepCopyInto(out *ResolvedMachineSpec) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]ResolvedPortSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedMachineSpec. +func (in *ResolvedMachineSpec) DeepCopy() *ResolvedMachineSpec { + if in == nil { + return nil + } + out := new(ResolvedMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResolvedPortSpec) DeepCopyInto(out *ResolvedPortSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Trunk != nil { + in, out := &in.Trunk, &out.Trunk + *out = new(bool) + **out = **in + } + if in.FixedIPs != nil { + in, out := &in.FixedIPs, &out.FixedIPs + *out = make([]ResolvedFixedIP, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.ResolvedPortSpecFields.DeepCopyInto(&out.ResolvedPortSpecFields) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedPortSpec. +func (in *ResolvedPortSpec) DeepCopy() *ResolvedPortSpec { + if in == nil { + return nil + } + out := new(ResolvedPortSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResolvedPortSpecFields) DeepCopyInto(out *ResolvedPortSpecFields) { + *out = *in + if in.AdminStateUp != nil { + in, out := &in.AdminStateUp, &out.AdminStateUp + *out = new(bool) + **out = **in + } + if in.MACAddress != nil { + in, out := &in.MACAddress, &out.MACAddress + *out = new(string) + **out = **in + } + if in.AllowedAddressPairs != nil { + in, out := &in.AllowedAddressPairs, &out.AllowedAddressPairs + *out = make([]AddressPair, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HostID != nil { + in, out := &in.HostID, &out.HostID + *out = new(string) + **out = **in + } + if in.VNICType != nil { + in, out := &in.VNICType, &out.VNICType + *out = new(string) + **out = **in + } + if in.Profile != nil { + in, out := &in.Profile, &out.Profile + *out = new(BindingProfile) + (*in).DeepCopyInto(*out) + } + if in.DisablePortSecurity != nil { + in, out := &in.DisablePortSecurity, &out.DisablePortSecurity + *out = new(bool) + **out = **in + } + if in.PropagateUplinkStatus != nil { + in, out := &in.PropagateUplinkStatus, &out.PropagateUplinkStatus + *out = new(bool) + **out = **in + } + if in.ValueSpecs != nil { + in, out := &in.ValueSpecs, &out.ValueSpecs + *out = make([]ValueSpec, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolvedPortSpecFields. +func (in *ResolvedPortSpecFields) DeepCopy() *ResolvedPortSpecFields { + if in == nil { + return nil + } + out := new(ResolvedPortSpecFields) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceReference) DeepCopyInto(out *ResourceReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. +func (in *ResourceReference) DeepCopy() *ResourceReference { + if in == nil { + return nil + } + out := new(ResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RootVolume) DeepCopyInto(out *RootVolume) { + *out = *in + in.BlockDeviceVolume.DeepCopyInto(&out.BlockDeviceVolume) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootVolume. +func (in *RootVolume) DeepCopy() *RootVolume { + if in == nil { + return nil + } + out := new(RootVolume) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Router) DeepCopyInto(out *Router) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IPs != nil { + in, out := &in.IPs, &out.IPs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Router. +func (in *Router) DeepCopy() *Router { + if in == nil { + return nil + } + out := new(Router) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouterFilter) DeepCopyInto(out *RouterFilter) { + *out = *in + in.FilterByNeutronTags.DeepCopyInto(&out.FilterByNeutronTags) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouterFilter. +func (in *RouterFilter) DeepCopy() *RouterFilter { + if in == nil { + return nil + } + out := new(RouterFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouterParam) DeepCopyInto(out *RouterParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(RouterFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouterParam. +func (in *RouterParam) DeepCopy() *RouterParam { + if in == nil { + return nil + } + out := new(RouterParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchedulerHintAdditionalProperty) DeepCopyInto(out *SchedulerHintAdditionalProperty) { + *out = *in + in.Value.DeepCopyInto(&out.Value) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerHintAdditionalProperty. +func (in *SchedulerHintAdditionalProperty) DeepCopy() *SchedulerHintAdditionalProperty { + if in == nil { + return nil + } + out := new(SchedulerHintAdditionalProperty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchedulerHintAdditionalValue) DeepCopyInto(out *SchedulerHintAdditionalValue) { + *out = *in + if in.Bool != nil { + in, out := &in.Bool, &out.Bool + *out = new(bool) + **out = **in + } + if in.Number != nil { + in, out := &in.Number, &out.Number + *out = new(int) + **out = **in + } + if in.String != nil { + in, out := &in.String, &out.String + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerHintAdditionalValue. +func (in *SchedulerHintAdditionalValue) DeepCopy() *SchedulerHintAdditionalValue { + if in == nil { + return nil + } + out := new(SchedulerHintAdditionalValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupFilter) DeepCopyInto(out *SecurityGroupFilter) { + *out = *in + in.FilterByNeutronTags.DeepCopyInto(&out.FilterByNeutronTags) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupFilter. +func (in *SecurityGroupFilter) DeepCopy() *SecurityGroupFilter { + if in == nil { + return nil + } + out := new(SecurityGroupFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupParam) DeepCopyInto(out *SecurityGroupParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(SecurityGroupFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupParam. +func (in *SecurityGroupParam) DeepCopy() *SecurityGroupParam { + if in == nil { + return nil + } + out := new(SecurityGroupParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupRuleSpec) DeepCopyInto(out *SecurityGroupRuleSpec) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EtherType != nil { + in, out := &in.EtherType, &out.EtherType + *out = new(string) + **out = **in + } + if in.PortRangeMin != nil { + in, out := &in.PortRangeMin, &out.PortRangeMin + *out = new(int) + **out = **in + } + if in.PortRangeMax != nil { + in, out := &in.PortRangeMax, &out.PortRangeMax + *out = new(int) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.RemoteGroupID != nil { + in, out := &in.RemoteGroupID, &out.RemoteGroupID + *out = new(string) + **out = **in + } + if in.RemoteIPPrefix != nil { + in, out := &in.RemoteIPPrefix, &out.RemoteIPPrefix + *out = new(string) + **out = **in + } + if in.RemoteManagedGroups != nil { + in, out := &in.RemoteManagedGroups, &out.RemoteManagedGroups + *out = make([]ManagedSecurityGroupName, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupRuleSpec. +func (in *SecurityGroupRuleSpec) DeepCopy() *SecurityGroupRuleSpec { + if in == nil { + return nil + } + out := new(SecurityGroupRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroupStatus) DeepCopyInto(out *SecurityGroupStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupStatus. +func (in *SecurityGroupStatus) DeepCopy() *SecurityGroupStatus { + if in == nil { + return nil + } + out := new(SecurityGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerGroupFilter) DeepCopyInto(out *ServerGroupFilter) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerGroupFilter. +func (in *ServerGroupFilter) DeepCopy() *ServerGroupFilter { + if in == nil { + return nil + } + out := new(ServerGroupFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerGroupParam) DeepCopyInto(out *ServerGroupParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(ServerGroupFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerGroupParam. +func (in *ServerGroupParam) DeepCopy() *ServerGroupParam { + if in == nil { + return nil + } + out := new(ServerGroupParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServerMetadata) DeepCopyInto(out *ServerMetadata) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerMetadata. +func (in *ServerMetadata) DeepCopy() *ServerMetadata { + if in == nil { + return nil + } + out := new(ServerMetadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subnet) DeepCopyInto(out *Subnet) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. +func (in *Subnet) DeepCopy() *Subnet { + if in == nil { + return nil + } + out := new(Subnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetFilter) DeepCopyInto(out *SubnetFilter) { + *out = *in + in.FilterByNeutronTags.DeepCopyInto(&out.FilterByNeutronTags) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetFilter. +func (in *SubnetFilter) DeepCopy() *SubnetFilter { + if in == nil { + return nil + } + out := new(SubnetFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetParam) DeepCopyInto(out *SubnetParam) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(SubnetFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetParam. +func (in *SubnetParam) DeepCopy() *SubnetParam { + if in == nil { + return nil + } + out := new(SubnetParam) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + if in.DNSNameservers != nil { + in, out := &in.DNSNameservers, &out.DNSNameservers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllocationPools != nil { + in, out := &in.AllocationPools, &out.AllocationPools + *out = make([]AllocationPool, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValueSpec) DeepCopyInto(out *ValueSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueSpec. +func (in *ValueSpec) DeepCopy() *ValueSpec { + if in == nil { + return nil + } + out := new(ValueSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAvailabilityZone) DeepCopyInto(out *VolumeAvailabilityZone) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(VolumeAZName) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAvailabilityZone. +func (in *VolumeAvailabilityZone) DeepCopy() *VolumeAvailabilityZone { + if in == nil { + return nil + } + out := new(VolumeAvailabilityZone) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/capi/openstack/go.mod b/pkg/capi/openstack/go.mod new file mode 100644 index 000000000000..cec7b5d2091a --- /dev/null +++ b/pkg/capi/openstack/go.mod @@ -0,0 +1,56 @@ +module sigs.k8s.io/cluster-api-provider-openstack + +go 1.25.7 + +require ( + k8s.io/api v0.35.1 + k8s.io/apimachinery v0.35.1 + k8s.io/utils v0.0.0-20260108192941-914a6e750570 + sigs.k8s.io/cluster-api v1.11.7 + sigs.k8s.io/controller-runtime v0.22.4 +) + +require ( + github.com/emicklei/go-restful/v3 v3.13.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.22.4 // indirect + github.com/go-openapi/jsonreference v0.21.4 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/google/gnostic-models v0.7.1 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/onsi/ginkgo/v2 v2.28.1 // indirect + github.com/onsi/gomega v1.39.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.54.0 // indirect + golang.org/x/text v0.37.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/apiextensions-apiserver v0.35.1 // indirect + k8s.io/client-go v0.35.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect + sigs.k8s.io/yaml v1.6.0 // indirect +) diff --git a/pkg/capi/openstack/pkg/utils/errors/errors.go b/pkg/capi/openstack/pkg/utils/errors/errors.go new file mode 100644 index 000000000000..96c446a45cdf --- /dev/null +++ b/pkg/capi/openstack/pkg/utils/errors/errors.go @@ -0,0 +1,78 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package errors + +import ( + "fmt" +) + +var ( + ErrFilterMatch = fmt.Errorf("filter match error") + ErrMultipleMatches = multipleMatchesError{} + ErrNoMatches = noMatchesError{} +) + +type ( + multipleMatchesError struct{} + noMatchesError struct{} +) + +func (e multipleMatchesError) Error() string { + return "filter matched more than one resource" +} + +func (e multipleMatchesError) Is(err error) bool { + return err == ErrFilterMatch +} + +func (e noMatchesError) Error() string { + return "filter matched no resources" +} + +func (e noMatchesError) Is(err error) bool { + return err == ErrFilterMatch +} + +// Gophercloud is not consistent in how it returns 404 errors. Sometimes +// it returns a pointer to the error, sometimes it returns the error +// directly. +// Some discussion here: https://github.com/gophercloud/gophercloud/v2/issues/2279 + +// The following types and constants are imported from CAPI and will be removed at some point once we +// implement the conditions that will be required in CAPI v1beta2 +// See https://github.com/kubernetes-sigs/cluster-api/issues/10784 + +// DeprecatedCAPIMachineStatusError defines errors states for Machine objects. +type DeprecatedCAPIMachineStatusError string + +const ( + // DeprecatedCAPIUpdateMachineError indicates an error while trying to update a Node that this + // Machine represents. This may indicate a transient problem that will be + // fixed automatically with time, such as a service outage, + // + // Example: error updating load balancers. + DeprecatedCAPIUpdateMachineError DeprecatedCAPIMachineStatusError = "UpdateError" +) + +// DeprecatedCAPIClusterStatusError defines errors states for Cluster objects. +type DeprecatedCAPIClusterStatusError string + +const ( + // DeprecatedCAPOUpdateClusterError indicates that an error was encountered + // when trying to update the cluster. + DeprecatedCAPOUpdateClusterError DeprecatedCAPIClusterStatusError = "UpdateError" +) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.defaults.go b/pkg/capi/openstack/pkg/utils/errors/terminal.go similarity index 54% rename from vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.defaults.go rename to pkg/capi/openstack/pkg/utils/errors/terminal.go index b2802005bddb..4e88356d93d9 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.defaults.go +++ b/pkg/capi/openstack/pkg/utils/errors/terminal.go @@ -1,8 +1,5 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,17 +14,27 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1beta2 +package errors import ( - runtime "k8s.io/apimachinery/pkg/runtime" + goerrors "errors" ) -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - return nil +type TerminalError struct { + Reason string + Message string +} + +func (e *TerminalError) Error() string { + return "reconciliation cannot continue: " + e.Message +} + +var _ error = &TerminalError{} + +func Terminal(reason, message string, errs ...error) error { + errs = append(errs, &TerminalError{ + Reason: reason, + Message: message, + }) + return goerrors.Join(errs...) } diff --git a/pkg/capi/openstack/pkg/utils/optional/types.go b/pkg/capi/openstack/pkg/utils/optional/types.go new file mode 100644 index 000000000000..35e73d32f700 --- /dev/null +++ b/pkg/capi/openstack/pkg/utils/optional/types.go @@ -0,0 +1,42 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package optional + +// String is a string that can be unspecified. strings which are converted to +// optional.String during API conversion will be converted to nil if the value +// was previously the empty string. +// +optional. +type String *string + +// Int is an int that can be unspecified. ints which are converted to +// optional.Int during API conversion will be converted to nil if the value +// was previously 0. +// +optional. +type Int *int + +// UInt16 is a uint16 that can be unspecified. uint16s which are converted to +// optional.UInt16 during API conversion will be converted to nil if the value +// was previously 0. +// +kubebuilder:validation:Minimum:=0 +// +kubebuilder:validation:Maximum:=65535 +// +optional. +type UInt16 *uint16 + +// Bool is a bool that can be unspecified. bools which are converted to +// optional.Bool during API conversion will be converted to nil if the value +// was previously false. +type Bool *bool diff --git a/support/api/capi_types.go b/support/api/capi_types.go index 3c6e71a4bba9..a5de557baace 100644 --- a/support/api/capi_types.go +++ b/support/api/capi_types.go @@ -2,12 +2,6 @@ package api // These imports are used to explicitly declare external API dependencies import ( - _ "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1" - _ "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - _ "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1" - _ "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2" - _ "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1" - _ "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" _ "sigs.k8s.io/cluster-api/api/addons/v1beta1" _ "sigs.k8s.io/cluster-api/api/core/v1beta1" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md deleted file mode 100644 index b363a53ef61a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md +++ /dev/null @@ -1,421 +0,0 @@ -# Release History - -## 5.7.0 (2024-04-26) -### Features Added - -- New value `DiffDiskPlacementNvmeDisk` added to enum type `DiffDiskPlacement` -- New value `DiskCreateOptionTypesCopy`, `DiskCreateOptionTypesRestore` added to enum type `DiskCreateOptionTypes` -- New enum type `ResourceIDOptionsForGetCapacityReservationGroups` with values `ResourceIDOptionsForGetCapacityReservationGroupsAll`, `ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription`, `ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription` -- New struct `EventGridAndResourceGraph` -- New struct `ScheduledEventsAdditionalPublishingTargets` -- New struct `ScheduledEventsPolicy` -- New struct `UserInitiatedReboot` -- New struct `UserInitiatedRedeploy` -- New field `ResourceIDsOnly` in struct `CapacityReservationGroupsClientListBySubscriptionOptions` -- New field `SourceResource` in struct `DataDisk` -- New field `Caching`, `DeleteOption`, `DiskEncryptionSet`, `WriteAcceleratorEnabled` in struct `DataDisksToAttach` -- New field `ScheduledEventsPolicy` in struct `VirtualMachineProperties` -- New field `ScheduledEventsPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `ForceUpdateOSDiskForEphemeral` in struct `VirtualMachineScaleSetReimageParameters` -- New field `DiffDiskSettings` in struct `VirtualMachineScaleSetUpdateOSDisk` -- New field `ForceUpdateOSDiskForEphemeral` in struct `VirtualMachineScaleSetVMReimageParameters` - - -## 5.6.0 (2024-03-22) -### Features Added - -- New field `VirtualMachineID` in struct `GalleryArtifactVersionFullSource` - - -## 5.5.0 (2024-01-26) -### Features Added - -- New value `DiskSecurityTypesConfidentialVMNonPersistedTPM` added to enum type `DiskSecurityTypes` -- New enum type `ProvisionedBandwidthCopyOption` with values `ProvisionedBandwidthCopyOptionEnhanced`, `ProvisionedBandwidthCopyOptionNone` -- New field `ProvisionedBandwidthCopySpeed` in struct `CreationData` - - -## 5.4.0 (2023-12-22) -### Features Added - -- New value `ConfidentialVMEncryptionTypeNonPersistedTPM` added to enum type `ConfidentialVMEncryptionType` -- New value `ReplicationStatusTypesUefiSettings` added to enum type `ReplicationStatusTypes` -- New value `SecurityEncryptionTypesNonPersistedTPM` added to enum type `SecurityEncryptionTypes` -- New enum type `Mode` with values `ModeAudit`, `ModeEnforce` -- New enum type `SSHEncryptionTypes` with values `SSHEncryptionTypesEd25519`, `SSHEncryptionTypesRSA` -- New enum type `UefiKeyType` with values `UefiKeyTypeSHA256`, `UefiKeyTypeX509` -- New enum type `UefiSignatureTemplateName` with values `UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate`, `UefiSignatureTemplateNameMicrosoftWindowsTemplate`, `UefiSignatureTemplateNameNoSignatureTemplate` -- New function `*DedicatedHostsClient.BeginRedeploy(context.Context, string, string, string, *DedicatedHostsClientBeginRedeployOptions) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error)` -- New function `*VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], error)` -- New function `*VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks(context.Context, string, string, string, AttachDetachDataDisksRequest, *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], error)` -- New function `*VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade(context.Context, string, string, *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], error)` -- New function `*VirtualMachinesClient.BeginAttachDetachDataDisks(context.Context, string, string, AttachDetachDataDisksRequest, *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error)` -- New struct `AttachDetachDataDisksRequest` -- New struct `CommunityGalleryMetadata` -- New struct `CommunityGalleryProperties` -- New struct `DataDisksToAttach` -- New struct `DataDisksToDetach` -- New struct `EncryptionIdentity` -- New struct `GalleryImageVersionUefiSettings` -- New struct `ImageVersionSecurityProfile` -- New struct `ProxyAgentSettings` -- New struct `ResiliencyPolicy` -- New struct `ResilientVMCreationPolicy` -- New struct `ResilientVMDeletionPolicy` -- New struct `ResourceSharingProfile` -- New struct `SSHGenerateKeyPairInputParameters` -- New struct `SharedGalleryProperties` -- New struct `UefiKey` -- New struct `UefiKeySignatures` -- New field `OSRollingUpgradeDeferral` in struct `AutomaticOSUpgradePolicy` -- New field `SharedSubscriptionIDs` in struct `CapacityReservationGroupInstanceView` -- New field `SharingProfile` in struct `CapacityReservationGroupProperties` -- New field `Properties` in struct `CommunityGallery` -- New field `ArtifactTags`, `Disclaimer` in struct `CommunityGalleryImageProperties` -- New field `ArtifactTags`, `Disclaimer` in struct `CommunityGalleryImageVersionProperties` -- New field `SecurityProfile` in struct `GalleryImageVersionProperties` -- New field `DiskControllerType` in struct `RestorePointSourceVMStorageProfile` -- New field `Parameters` in struct `SSHPublicKeysClientGenerateKeyPairOptions` -- New field `EncryptionIdentity`, `ProxyAgentSettings` in struct `SecurityProfile` -- New field `Properties` in struct `SharedGallery` -- New field `ArtifactTags` in struct `SharedGalleryImageProperties` -- New field `ArtifactTags` in struct `SharedGalleryImageVersionProperties` -- New field `Etag`, `ManagedBy` in struct `VirtualMachine` -- New field `IsVMInStandbyPool` in struct `VirtualMachineInstanceView` -- New field `Etag` in struct `VirtualMachineScaleSet` -- New field `ResiliencyPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `ResiliencyPolicy` in struct `VirtualMachineScaleSetUpdateProperties` -- New field `Etag` in struct `VirtualMachineScaleSetVM` -- New field `TimeCreated` in struct `VirtualMachineScaleSetVMProfile` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetVMsClientBeginUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetsClientBeginUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachinesClientBeginCreateOrUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachinesClientBeginUpdateOptions` - - -## 5.3.0 (2023-11-24) -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - - -## 5.3.0-beta.2 (2023-10-30) - -### Other Changes - -- Updated with latest code generator to fix a few issues in fakes. - -## 5.3.0-beta.1 (2023-10-09) -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - -## 5.2.0 (2023-09-22) -### Features Added - -- New value `DiskCreateOptionCopyFromSanSnapshot` added to enum type `DiskCreateOption` -- New enum type `DomainNameLabelScopeTypes` with values `DomainNameLabelScopeTypesNoReuse`, `DomainNameLabelScopeTypesResourceGroupReuse`, `DomainNameLabelScopeTypesSubscriptionReuse`, `DomainNameLabelScopeTypesTenantReuse` -- New enum type `NetworkInterfaceAuxiliaryMode` with values `NetworkInterfaceAuxiliaryModeAcceleratedConnections`, `NetworkInterfaceAuxiliaryModeFloating`, `NetworkInterfaceAuxiliaryModeNone` -- New enum type `NetworkInterfaceAuxiliarySKU` with values `NetworkInterfaceAuxiliarySKUA1`, `NetworkInterfaceAuxiliarySKUA2`, `NetworkInterfaceAuxiliarySKUA4`, `NetworkInterfaceAuxiliarySKUA8`, `NetworkInterfaceAuxiliarySKUNone` -- New field `ElasticSanResourceID` in struct `CreationData` -- New field `LastOwnershipUpdateTime` in struct `DiskProperties` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineNetworkInterfaceConfigurationProperties` -- New field `DomainNameLabelScope` in struct `VirtualMachinePublicIPAddressDNSSettingsConfiguration` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetNetworkConfigurationProperties` -- New field `DomainNameLabelScope` in struct `VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties` -- New field `TimeCreated` in struct `VirtualMachineScaleSetVMProperties` - - -## 5.1.0 (2023-07-28) -### Features Added - -- New enum type `FileFormat` with values `FileFormatVHD`, `FileFormatVHDX` -- New field `FileFormat` in struct `GrantAccessData` - - -## 5.0.0 (2023-05-26) -### Breaking Changes - -- Type of `CommunityGalleryImageProperties.Identifier` has been changed from `*GalleryImageIdentifier` to `*CommunityGalleryImageIdentifier` -- Type of `GalleryTargetExtendedLocation.StorageAccountType` has been changed from `*StorageAccountType` to `*EdgeZoneStorageAccountType` -- Type of `RestorePointSourceVMDataDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes` -- Type of `RestorePointSourceVMOSDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes` -- `StorageAccountTypeStandardSSDLRS` from enum `StorageAccountType` has been removed -- Field `ID` of struct `VirtualMachineScaleSetIPConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetNetworkConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetUpdateIPConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetUpdateNetworkConfiguration` has been removed - -### Features Added - -- New enum type `EdgeZoneStorageAccountType` with values `EdgeZoneStorageAccountTypePremiumLRS`, `EdgeZoneStorageAccountTypeStandardLRS`, `EdgeZoneStorageAccountTypeStandardSSDLRS`, `EdgeZoneStorageAccountTypeStandardZRS` -- New enum type `ExpandTypeForListVMs` with values `ExpandTypeForListVMsInstanceView` -- New enum type `ExpandTypesForListVMs` with values `ExpandTypesForListVMsInstanceView` -- New enum type `RestorePointEncryptionType` with values `RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey` -- New function `*DedicatedHostsClient.NewListAvailableSizesPager(string, string, string, *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse]` -- New function `*VirtualMachineScaleSetsClient.BeginReapply(context.Context, string, string, *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error)` -- New struct `CommunityGalleryImageIdentifier` -- New struct `DedicatedHostSizeListResult` -- New struct `DiskRestorePointAttributes` -- New struct `RestorePointEncryption` -- New struct `RunCommandManagedIdentity` -- New struct `SecurityPostureReference` -- New field `SKU` in struct `DedicatedHostUpdate` -- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `LinuxVMGuestPatchAutomaticByPlatformSettings` -- New field `HyperVGeneration` in struct `RestorePointSourceMetadata` -- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMDataDisk` -- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMOSDisk` -- New field `ProvisionAfterExtensions` in struct `VirtualMachineExtensionProperties` -- New field `ErrorBlobManagedIdentity`, `OutputBlobManagedIdentity`, `TreatFailureAsDeploymentFailure` in struct `VirtualMachineRunCommandProperties` -- New field `ScriptURIManagedIdentity` in struct `VirtualMachineRunCommandScriptSource` -- New field `PriorityMixPolicy`, `SpotRestorePolicy` in struct `VirtualMachineScaleSetUpdateProperties` -- New field `Location` in struct `VirtualMachineScaleSetVMExtension` -- New field `SecurityPostureReference` in struct `VirtualMachineScaleSetVMProfile` -- New field `Hibernate` in struct `VirtualMachineScaleSetsClientBeginDeallocateOptions` -- New field `Expand` in struct `VirtualMachinesClientListAllOptions` -- New field `Expand` in struct `VirtualMachinesClientListOptions` -- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `WindowsVMGuestPatchAutomaticByPlatformSettings` - - -## 4.2.1 (2023-04-14) -### Bug Fixes - -- Fix serialization bug of empty value of `any` type. - - -## 4.2.0 (2023-03-27) -### Features Added - -- New struct `ClientFactory` which is a client factory used to create any client in this module -- New value `StorageAccountTypeStandardSSDLRS` added to enum type `StorageAccountType` -- New field `ComputerName` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `HyperVGeneration` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `OSName` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `OSVersion` in struct `VirtualMachineScaleSetVMInstanceView` - - -## 4.1.0 (2023-01-27) -### Features Added - -- New type alias `AlternativeType` with values `AlternativeTypeNone`, `AlternativeTypeOffer`, `AlternativeTypePlan` -- New type alias `ImageState` with values `ImageStateActive`, `ImageStateDeprecated`, `ImageStateScheduledForDeprecation` -- New struct `AlternativeOption` -- New struct `ImageDeprecationStatus` -- New struct `OSImageNotificationProfile` -- New struct `OSProfileProvisioningData` -- New struct `ServiceArtifactReference` -- New field `Zones` in struct `CloudService` -- New field `UserData` in struct `RestorePointSourceMetadata` -- New field `MaxSurge` in struct `RollingUpgradePolicy` -- New field `RollbackFailedInstancesOnPolicyBreach` in struct `RollingUpgradePolicy` -- New field `OSImageNotificationProfile` in struct `ScheduledEventsProfile` -- New field `ImageDeprecationStatus` in struct `VirtualMachineImageProperties` -- New field `ExactVersion` in struct `VirtualMachineReimageParameters` -- New field `OSProfile` in struct `VirtualMachineReimageParameters` -- New field `RequireGuestProvisionSignal` in struct `VirtualMachineScaleSetOSProfile` -- New field `ConstrainedMaximumCapacity` in struct `VirtualMachineScaleSetProperties` -- New field `ExactVersion` in struct `VirtualMachineScaleSetReimageParameters` -- New field `OSProfile` in struct `VirtualMachineScaleSetReimageParameters` -- New field `ServiceArtifactReference` in struct `VirtualMachineScaleSetVMProfile` -- New field `ExactVersion` in struct `VirtualMachineScaleSetVMReimageParameters` -- New field `OSProfile` in struct `VirtualMachineScaleSetVMReimageParameters` - - -## 4.0.0 (2022-10-04) -### Breaking Changes - -- Type of `GalleryImageVersionStorageProfile.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryArtifactVersionFullSource` -- Type of `SharingProfile.CommunityGalleryInfo` has been changed from `interface{}` to `*CommunityGalleryInfo` -- Type of `VirtualMachineExtensionUpdateProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Type of `GalleryOSDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `GalleryDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `GalleryDataDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Type of `VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Field `URI` of struct `GalleryArtifactVersionSource` has been removed - -### Features Added - -- New const `DiskControllerTypesSCSI` -- New const `PolicyViolationCategoryImageFlaggedUnsafe` -- New const `GalleryApplicationCustomActionParameterTypeConfigurationDataBlob` -- New const `PolicyViolationCategoryIPTheft` -- New const `PolicyViolationCategoryCopyrightValidation` -- New const `PolicyViolationCategoryOther` -- New const `GalleryApplicationCustomActionParameterTypeString` -- New const `DiskControllerTypesNVMe` -- New const `GalleryApplicationCustomActionParameterTypeLogOutputBlob` -- New type alias `DiskControllerTypes` -- New type alias `PolicyViolationCategory` -- New type alias `GalleryApplicationCustomActionParameterType` -- New function `PossiblePolicyViolationCategoryValues() []PolicyViolationCategory` -- New function `PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType` -- New function `PossibleDiskControllerTypesValues() []DiskControllerTypes` -- New struct `GalleryApplicationCustomAction` -- New struct `GalleryApplicationCustomActionParameter` -- New struct `GalleryApplicationVersionSafetyProfile` -- New struct `GalleryArtifactSafetyProfileBase` -- New struct `GalleryArtifactVersionFullSource` -- New struct `GalleryDiskImageSource` -- New struct `GalleryImageVersionSafetyProfile` -- New struct `LatestGalleryImageVersion` -- New struct `PolicyViolation` -- New struct `PriorityMixPolicy` -- New field `DiskControllerType` in struct `VirtualMachineScaleSetUpdateStorageProfile` -- New field `HardwareProfile` in struct `VirtualMachineScaleSetUpdateVMProfile` -- New field `CustomActions` in struct `GalleryApplicationProperties` -- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetNetworkConfigurationProperties` -- New field `DiskControllerType` in struct `StorageProfile` -- New field `OptimizedForFrequentAttach` in struct `DiskProperties` -- New field `BurstingEnabledTime` in struct `DiskProperties` -- New field `DiskControllerTypes` in struct `SupportedCapabilities` -- New field `DisableTCPStateTracking` in struct `VirtualMachineNetworkInterfaceConfigurationProperties` -- New field `EnableVMAgentPlatformUpdates` in struct `WindowsConfiguration` -- New field `PerformancePlus` in struct `CreationData` -- New field `IncrementalSnapshotFamilyID` in struct `SnapshotProperties` -- New field `OptimizedForFrequentAttach` in struct `DiskUpdateProperties` -- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties` -- New field `ExcludeFromLatest` in struct `TargetRegion` -- New field `PrivacyStatementURI` in struct `SharedGalleryImageProperties` -- New field `Eula` in struct `SharedGalleryImageProperties` -- New field `SafetyProfile` in struct `GalleryApplicationVersionProperties` -- New field `SafetyProfile` in struct `GalleryImageVersionProperties` -- New field `EnableVMAgentPlatformUpdates` in struct `LinuxConfiguration` -- New field `CurrentCapacity` in struct `CapacityReservationUtilization` -- New field `PriorityMixPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `CustomActions` in struct `GalleryApplicationVersionPublishingProfile` -- New field `PlatformFaultDomainCount` in struct `CapacityReservationProperties` -- New field `DiskControllerType` in struct `VirtualMachineScaleSetStorageProfile` - - -## 3.0.1 (2022-07-29) -### Other Changes -- Fix wrong module import for live test - -## 3.0.0 (2022-06-24) -### Breaking Changes - -- Function `*CloudServicesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, CloudService, *CloudServicesClientBeginCreateOrUpdateOptions)` -- Function `*CloudServicesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginUpdateOptions)` to `(context.Context, string, string, CloudServiceUpdate, *CloudServicesClientBeginUpdateOptions)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` parameter(s) have been changed from `(context.Context, string, string, int32, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` to `(context.Context, string, string, int32, UpdateDomain, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` -- Type of `CloudServiceExtensionProperties.Settings` has been changed from `*string` to `interface{}` -- Type of `CloudServiceExtensionProperties.ProtectedSettings` has been changed from `*string` to `interface{}` -- Field `Parameters` of struct `CloudServicesClientBeginUpdateOptions` has been removed -- Field `Parameters` of struct `CloudServicesClientBeginCreateOrUpdateOptions` has been removed -- Field `Parameters` of struct `CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions` has been removed - -### Features Added - -- New const `CloudServiceSlotTypeProduction` -- New const `CloudServiceSlotTypeStaging` -- New function `*VirtualMachineImagesClient.ListByEdgeZone(context.Context, string, string, *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error)` -- New function `PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType` -- New struct `SystemData` -- New struct `VMImagesInEdgeZoneListResult` -- New struct `VirtualMachineImagesClientListByEdgeZoneOptions` -- New struct `VirtualMachineImagesClientListByEdgeZoneResponse` -- New field `SystemData` in struct `CloudService` -- New field `SlotType` in struct `CloudServiceNetworkProfile` - - -## 2.0.0 (2022-06-02) -### Breaking Changes - -- Type of `GalleryProperties.ProvisioningState` has been changed from `*GalleryPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryImageVersionProperties.ProvisioningState` has been changed from `*GalleryImageVersionPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryImageProperties.ProvisioningState` has been changed from `*GalleryImagePropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryApplicationVersionProperties.ProvisioningState` has been changed from `*GalleryApplicationVersionPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `VirtualMachineScaleSetIdentity.UserAssignedIdentities` has been changed from `map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` to `map[string]*UserAssignedIdentitiesValue` -- Const `GalleryImagePropertiesProvisioningStateFailed` has been removed -- Const `GalleryImagePropertiesProvisioningStateMigrating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateCreating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateFailed` has been removed -- Const `GalleryPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateCreating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryImagePropertiesProvisioningStateCreating` has been removed -- Const `GalleryImagePropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryPropertiesProvisioningStateFailed` has been removed -- Const `SharingProfileGroupTypesCommunity` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateFailed` has been removed -- Const `GalleryImagePropertiesProvisioningStateDeleting` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryPropertiesProvisioningStateCreating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImagePropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryPropertiesProvisioningStateSucceeded` has been removed -- Function `PossibleGalleryPropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryImageVersionPropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryImagePropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryApplicationVersionPropertiesProvisioningStateValues` has been removed -- Struct `VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` has been removed - -### Features Added - -- New const `GallerySharingPermissionTypesCommunity` -- New const `GalleryProvisioningStateUpdating` -- New const `SharedGalleryHostCachingReadOnly` -- New const `SharedGalleryHostCachingNone` -- New const `GalleryProvisioningStateSucceeded` -- New const `GalleryProvisioningStateFailed` -- New const `SharedGalleryHostCachingReadWrite` -- New const `GalleryProvisioningStateCreating` -- New const `DiskEncryptionSetIdentityTypeUserAssigned` -- New const `GalleryProvisioningStateMigrating` -- New const `DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned` -- New const `CopyCompletionErrorReasonCopySourceNotFound` -- New const `GalleryProvisioningStateDeleting` -- New const `DiskStorageAccountTypesPremiumV2LRS` -- New function `PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason` -- New function `PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching` -- New function `PossibleGalleryProvisioningStateValues() []GalleryProvisioningState` -- New function `EncryptionSetIdentity.MarshalJSON() ([]byte, error)` -- New function `*CommunityGalleryImagesClient.NewListPager(string, string, *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse]` -- New function `*CommunityGalleryImageVersionsClient.NewListPager(string, string, string, *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]` -- New struct `CommunityGalleryImageList` -- New struct `CommunityGalleryImageVersionList` -- New struct `CommunityGalleryImageVersionsClientListOptions` -- New struct `CommunityGalleryImageVersionsClientListResponse` -- New struct `CommunityGalleryImagesClientListOptions` -- New struct `CommunityGalleryImagesClientListResponse` -- New struct `CopyCompletionError` -- New struct `SharedGalleryDataDiskImage` -- New struct `SharedGalleryDiskImage` -- New struct `SharedGalleryImageVersionStorageProfile` -- New struct `SharedGalleryOSDiskImage` -- New struct `UserArtifactSettings` -- New field `SharedGalleryImageID` in struct `ImageDiskReference` -- New field `CommunityGalleryImageID` in struct `ImageDiskReference` -- New field `AdvancedSettings` in struct `GalleryApplicationVersionPublishingProfile` -- New field `Settings` in struct `GalleryApplicationVersionPublishingProfile` -- New field `CopyCompletionError` in struct `SnapshotProperties` -- New field `ExcludeFromLatest` in struct `SharedGalleryImageVersionProperties` -- New field `StorageProfile` in struct `SharedGalleryImageVersionProperties` -- New field `ExcludeFromLatest` in struct `CommunityGalleryImageVersionProperties` -- New field `StorageProfile` in struct `CommunityGalleryImageVersionProperties` -- New field `Architecture` in struct `SharedGalleryImageProperties` -- New field `UserAssignedIdentities` in struct `EncryptionSetIdentity` -- New field `Eula` in struct `CommunityGalleryImageProperties` -- New field `PrivacyStatementURI` in struct `CommunityGalleryImageProperties` -- New field `Architecture` in struct `CommunityGalleryImageProperties` -- New field `FederatedClientID` in struct `DiskEncryptionSetUpdateProperties` -- New field `FederatedClientID` in struct `EncryptionSetProperties` -- New field `SecurityProfile` in struct `DiskRestorePointProperties` - - -## 1.0.0 (2022-05-16) - -The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. - -To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt deleted file mode 100644 index dc0c2ffb3dc1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md deleted file mode 100644 index c4bf8ab344eb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# Azure Compute Module for Go - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5) - -The `armcompute` module provides operations for working with Azure Compute. - -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/compute/armcompute) - -# Getting started - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) - -## Install the package - -This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. - -Install the Azure Compute module: - -```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 -``` - -## Authorization - -When creating a client, you will need to provide a credential for authenticating with Azure Compute. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. - -```go -cred, err := azidentity.NewDefaultAzureCredential(nil) -``` - -For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). - -## Client Factory - -Azure Compute module consists of one or more clients. We provide a client factory which could be used to create any client in this module. - -```go -clientFactory, err := armcompute.NewClientFactory(, cred, nil) -``` - -You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). - -```go -options := arm.ClientOptions { - ClientOptions: azcore.ClientOptions { - Cloud: cloud.AzureChina, - }, -} -clientFactory, err := armcompute.NewClientFactory(, cred, &options) -``` - -## Clients - -A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. - -```go -client := clientFactory.NewAvailabilitySetsClient() -``` - -## Fakes - -The fake package contains types used for constructing in-memory fake servers used in unit tests. -This allows writing tests to cover various success/error conditions without the need for connecting to a live service. - -Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. - -## More sample code - -- [Availability Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/availabilityset) -- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/compute/armcompute/fake_example_test.go) -- [Virtual Machine](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/create_vm) -- [Dedicated Host](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/dedicated_host) -- [Disk](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/disk) -- [Gallery](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/gallery) -- [Proximity Placement Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/proximity) -- [Snapshot](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/snapshot) -- [Virtual Machine Scale Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/vmscaleset) - -## Major Version Upgrade - -Go uses [semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) to ensure a good backward compatibility for modules. For Azure Go management SDK, we usually upgrade module version according to cooresponding service's API version. Regarding it could be a complicated experience for major version upgrade, we will try our best to keep the SDK API stable and release new version in backward compatible way. However, if any unavoidable breaking changes and a new major version releases for SDK modules, you could use these commands under your module folder to upgrade: - -```sh -go install github.com/icholy/gomajor@latest -gomajor get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute@latest -``` - -## Provide Feedback - -If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Compute` label. - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information, see the -[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any -additional questions or comments. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json deleted file mode 100644 index db9b10d43d85..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "go", - "TagPrefix": "go/resourcemanager/compute/armcompute", - "Tag": "go/resourcemanager/compute/armcompute_6e7bd6d107" -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md deleted file mode 100644 index 5f836a658592..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 5.7.0 -tag: package-2024-03-01 -``` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go deleted file mode 100644 index b9b8536f8638..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go +++ /dev/null @@ -1,485 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailabilitySetsClient contains the methods for the AvailabilitySets group. -// Don't use this type directly, use NewAvailabilitySetsClient() instead. -type AvailabilitySetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilitySetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AvailabilitySetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - parameters - Parameters supplied to the Create Availability Set operation. -// - options - AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AvailabilitySetsClient) createOrUpdateHandleResponse(resp *http.Response) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - result := AvailabilitySetsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (AvailabilitySetsClientDeleteResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientDeleteResponse{}, err - } - return AvailabilitySetsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (AvailabilitySetsClientGetResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (AvailabilitySetsClientGetResponse, error) { - result := AvailabilitySetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all availability sets in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager -// method. -func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListResponse]{ - More: func(page AvailabilitySetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListResponse) (AvailabilitySetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return AvailabilitySetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsClientListResponse, error) { - result := AvailabilitySetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine -// in an existing availability set. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager -// method. -func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListAvailableSizesResponse]{ - More: func(page AvailabilitySetsClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListAvailableSizesResponse) (AvailabilitySetsClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *AvailabilitySetsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *AvailabilitySetsClient) listAvailableSizesHandleResponse(resp *http.Response) (AvailabilitySetsClientListAvailableSizesResponse, error) { - result := AvailabilitySetsClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all availability sets in a subscription. -// -// Generated from API version 2024-03-01 -// - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager -// method. -func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListBySubscriptionResponse]{ - More: func(page AvailabilitySetsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListBySubscriptionResponse) (AvailabilitySetsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *http.Response) (AvailabilitySetsClientListBySubscriptionResponse, error) { - result := AvailabilitySetsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - parameters - Parameters supplied to the Update Availability Set operation. -// - options - AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (AvailabilitySetsClientUpdateResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *AvailabilitySetsClient) updateHandleResponse(resp *http.Response) (AvailabilitySetsClientUpdateResponse, error) { - result := AvailabilitySetsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go deleted file mode 100644 index f88d006f4fbb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired resourcemanager/compute/armcompute - -package armcompute diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go deleted file mode 100644 index 51a41065840b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go +++ /dev/null @@ -1,437 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group. -// Don't use this type directly, use NewCapacityReservationGroupsClient() instead. -type CapacityReservationGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CapacityReservationGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update a capacity reservation group. When updating a capacity reservation group, -// only tags and sharing profile may be modified. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - parameters - Parameters supplied to the Create capacity reservation Group. -// - options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - result := CapacityReservationGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources -// are disassociated from the reservation group and all capacity reservations under -// the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientDeleteResponse{}, err - } - return CapacityReservationGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about a capacity reservation group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Response) (CapacityReservationGroupsClientGetResponse, error) { - result := CapacityReservationGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink -// property in the response to get the next page of capacity reservation groups. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager -// method. -func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListByResourceGroupResponse]{ - More: func(page CapacityReservationGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListByResourceGroupResponse) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CapacityReservationGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *CapacityReservationGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - result := CapacityReservationGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property -// in the response to get the next page of capacity reservation groups. -// -// Generated from API version 2024-03-01 -// - options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager -// method. -func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListBySubscriptionResponse]{ - More: func(page CapacityReservationGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListBySubscriptionResponse) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CapacityReservationGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ResourceIDsOnly != nil { - reqQP.Set("resourceIdsOnly", string(*options.ResourceIDsOnly)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - result := CapacityReservationGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and -// sharing profile may be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - parameters - Parameters supplied to the Update capacity reservation Group operation. -// - options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *CapacityReservationGroupsClient) updateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientUpdateResponse, error) { - result := CapacityReservationGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go deleted file mode 100644 index aaf86c3a26a5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go +++ /dev/null @@ -1,443 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationsClient contains the methods for the CapacityReservations group. -// Don't use this type directly, use NewCapacityReservationsClient() instead. -type CapacityReservationsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCapacityReservationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CapacityReservationsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set -// only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - parameters - Parameters supplied to the Create capacity reservation. -// - options - CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set only -// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - options - CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about the capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - options - CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get -// method. -func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (CapacityReservationsClientGetResponse, error) { - var err error - const operationName = "CapacityReservationsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationsClient) getHandleResponse(resp *http.Response) (CapacityReservationsClientGetResponse, error) { - result := CapacityReservationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservation); err != nil { - return CapacityReservationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group. -// Use the nextLink property in the response to get the next page of capacity reservations. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager -// method. -func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationsClientListByCapacityReservationGroupResponse]{ - More: func(page CapacityReservationsClientListByCapacityReservationGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationsClientListByCapacityReservationGroupResponse) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationsClient.NewListByCapacityReservationGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByCapacityReservationGroupCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - }, nil) - if err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - return client.listByCapacityReservationGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByCapacityReservationGroupCreateRequest creates the ListByCapacityReservationGroup request. -func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByCapacityReservationGroupHandleResponse handles the ListByCapacityReservationGroup response. -func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleResponse(resp *http.Response) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - result := CapacityReservationsClientListByCapacityReservationGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationListResult); err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - parameters - Parameters supplied to the Update capacity reservation operation. -// - options - CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml deleted file mode 100644 index c93d36fd4ccc..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - IncludeRelease: true - ServiceDirectory: 'resourcemanager/compute/armcompute' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go deleted file mode 100644 index dab27c87cb64..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" -) - -// ClientFactory is a client factory used to create any client in this module. -// Don't use this type directly, use NewClientFactory instead. -type ClientFactory struct { - subscriptionID string - internal *arm.Client -} - -// NewClientFactory creates a new instance of ClientFactory with the specified values. -// The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - return &ClientFactory{ - subscriptionID: subscriptionID, - internal: internal, - }, nil -} - -// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient. -func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient { - return &AvailabilitySetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient. -func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient { - return &CapacityReservationGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient. -func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient { - return &CapacityReservationsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient. -func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient { - return &CloudServiceOperatingSystemsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient. -func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient { - return &CloudServiceRoleInstancesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient. -func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient { - return &CloudServiceRolesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServicesClient creates a new instance of CloudServicesClient. -func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient { - return &CloudServicesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient. -func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient { - return &CloudServicesUpdateDomainClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient. -func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient { - return &CommunityGalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient. -func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient { - return &CommunityGalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient. -func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient { - return &CommunityGalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient. -func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient { - return &DedicatedHostGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient. -func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient { - return &DedicatedHostsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskAccessesClient creates a new instance of DiskAccessesClient. -func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient { - return &DiskAccessesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient. -func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient { - return &DiskEncryptionSetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient. -func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient { - return &DiskRestorePointClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDisksClient creates a new instance of DisksClient. -func (c *ClientFactory) NewDisksClient() *DisksClient { - return &DisksClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleriesClient creates a new instance of GalleriesClient. -func (c *ClientFactory) NewGalleriesClient() *GalleriesClient { - return &GalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient. -func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient { - return &GalleryApplicationVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient. -func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient { - return &GalleryApplicationsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient. -func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient { - return &GalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryImagesClient creates a new instance of GalleryImagesClient. -func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient { - return &GalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient. -func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient { - return &GallerySharingProfileClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewImagesClient creates a new instance of ImagesClient. -func (c *ClientFactory) NewImagesClient() *ImagesClient { - return &ImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient. -func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { - return &LogAnalyticsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewOperationsClient creates a new instance of OperationsClient. -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - return &OperationsClient{ - internal: c.internal, - } -} - -// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient. -func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient { - return &ProximityPlacementGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewResourceSKUsClient creates a new instance of ResourceSKUsClient. -func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { - return &ResourceSKUsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient. -func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient { - return &RestorePointCollectionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewRestorePointsClient creates a new instance of RestorePointsClient. -func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { - return &RestorePointsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient. -func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient { - return &SSHPublicKeysClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient. -func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient { - return &SharedGalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient. -func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient { - return &SharedGalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient. -func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient { - return &SharedGalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSnapshotsClient creates a new instance of SnapshotsClient. -func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { - return &SnapshotsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewUsageClient creates a new instance of UsageClient. -func (c *ClientFactory) NewUsageClient() *UsageClient { - return &UsageClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient. -func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient { - return &VirtualMachineExtensionImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient. -func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient { - return &VirtualMachineExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient. -func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient { - return &VirtualMachineImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient. -func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient { - return &VirtualMachineImagesEdgeZoneClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient. -func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient { - return &VirtualMachineRunCommandsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient { - return &VirtualMachineScaleSetExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient. -func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient { - return &VirtualMachineScaleSetRollingUpgradesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient { - return &VirtualMachineScaleSetVMExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient { - return &VirtualMachineScaleSetVMRunCommandsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient { - return &VirtualMachineScaleSetVMsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient { - return &VirtualMachineScaleSetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient. -func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { - return &VirtualMachineSizesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient. -func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { - return &VirtualMachinesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go deleted file mode 100644 index bd0cda902fb5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go +++ /dev/null @@ -1,301 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceOperatingSystemsClient contains the methods for the CloudServiceOperatingSystems group. -// Don't use this type directly, use NewCloudServiceOperatingSystemsClient() instead. -type CloudServiceOperatingSystemsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceOperatingSystemsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceOperatingSystemsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// GetOSFamily - Gets properties of a guest operating system family that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS family pertains to. -// - osFamilyName - Name of the OS family. -// - options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - var err error - const operationName = "CloudServiceOperatingSystemsClient.GetOSFamily" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getOSFamilyCreateRequest(ctx, location, osFamilyName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - resp, err := client.getOSFamilyHandleResponse(httpResp) - return resp, err -} - -// getOSFamilyCreateRequest creates the GetOSFamily request. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyCreateRequest(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osFamilyName == "" { - return nil, errors.New("parameter osFamilyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osFamilyName}", url.PathEscape(osFamilyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSFamilyHandleResponse handles the GetOSFamily response. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSFamilyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamily); err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - return result, nil -} - -// GetOSVersion - Gets properties of a guest operating system version that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS version pertains to. -// - osVersionName - Name of the OS version. -// - options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - var err error - const operationName = "CloudServiceOperatingSystemsClient.GetOSVersion" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getOSVersionCreateRequest(ctx, location, osVersionName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - resp, err := client.getOSVersionHandleResponse(httpResp) - return resp, err -} - -// getOSVersionCreateRequest creates the GetOSVersion request. -func (client *CloudServiceOperatingSystemsClient) getOSVersionCreateRequest(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osVersionName == "" { - return nil, errors.New("parameter osVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osVersionName}", url.PathEscape(osVersionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSVersionHandleResponse handles the GetOSVersion response. -func (client *CloudServiceOperatingSystemsClient) getOSVersionHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSVersionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersion); err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - return result, nil -} - -// NewListOSFamiliesPager - Gets a list of all guest operating system families available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS Families. Do this till nextLink is null to fetch all the OS Families. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS families pertain to. -// - options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSFamiliesResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSFamiliesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSFamiliesResponse) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSFamiliesPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listOSFamiliesCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - return client.listOSFamiliesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listOSFamiliesCreateRequest creates the ListOSFamilies request. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSFamiliesHandleResponse handles the ListOSFamilies response. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - result := CloudServiceOperatingSystemsClientListOSFamiliesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamilyListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - return result, nil -} - -// NewListOSVersionsPager - Gets a list of all guest operating system versions available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS versions. Do this till nextLink is null to fetch all the OS versions. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS versions pertain to. -// - options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSVersionsResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSVersionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSVersionsResponse) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSVersionsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listOSVersionsCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - return client.listOSVersionsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listOSVersionsCreateRequest creates the ListOSVersions request. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSVersionsHandleResponse handles the ListOSVersions response. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - result := CloudServiceOperatingSystemsClientListOSVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersionListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go deleted file mode 100644 index 1f7cdb7c382e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go +++ /dev/null @@ -1,648 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRoleInstancesClient contains the methods for the CloudServiceRoleInstances group. -// Don't use this type directly, use NewCloudServiceRoleInstancesClient() instead. -type CloudServiceRoleInstancesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRoleInstancesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceRoleInstancesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginDelete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) deleteOperation(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (CloudServiceRoleInstancesClientGetResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRoleInstancesClient) getCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRoleInstancesClient) getHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetResponse, error) { - result := CloudServiceRoleInstancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstance); err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServiceRoleInstancesClient) getInstanceViewCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServiceRoleInstancesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - result := CloudServiceRoleInstancesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceView); err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.GetRemoteDesktopFile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getRemoteDesktopFileCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{Body: httpResp.Body}, nil -} - -// getRemoteDesktopFileCreateRequest creates the GetRemoteDesktopFile request. -func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - runtime.SkipBodyDownload(req) - req.Raw().Header["Accept"] = []string{"application/x-rdp"} - return req, nil -} - -// NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the -// next page of role instances. Do this till nextLink is null to fetch all the role instances. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager -// method. -func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRoleInstancesClientListResponse]{ - More: func(page CloudServiceRoleInstancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRoleInstancesClientListResponse) (CloudServiceRoleInstancesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRoleInstancesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRoleInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientListResponse, error) { - result := CloudServiceRoleInstancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceListResult); err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - return result, nil -} - -// BeginRebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Rebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginRebuild" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.rebuildCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServiceRoleInstancesClient) restartCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go deleted file mode 100644 index a4572cf143d3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRolesClient contains the methods for the CloudServiceRoles group. -// Don't use this type directly, use NewCloudServiceRolesClient() instead. -type CloudServiceRolesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRolesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceRolesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a role from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleName - Name of the role. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (CloudServiceRolesClientGetResponse, error) { - var err error - const operationName = "CloudServiceRolesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, roleName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRolesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRolesClient) getCreateRequest(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}" - if roleName == "" { - return nil, errors.New("parameter roleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleName}", url.PathEscape(roleName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRolesClient) getHandleResponse(resp *http.Response) (CloudServiceRolesClientGetResponse, error) { - result := CloudServiceRolesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRole); err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page -// of roles. Do this till nextLink is null to fetch all the roles. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager -// method. -func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRolesClientListResponse]{ - More: func(page CloudServiceRolesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRolesClientListResponse) (CloudServiceRolesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRolesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServiceRolesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRolesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRolesClient) listHandleResponse(resp *http.Response) (CloudServiceRolesClientListResponse, error) { - result := CloudServiceRolesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRoleListResult); err != nil { - return CloudServiceRolesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go deleted file mode 100644 index 283d3a6feb7a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go +++ /dev/null @@ -1,1013 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServicesClient contains the methods for the CloudServices group. -// Don't use this type directly, use NewCloudServicesClient() instead. -type CloudServicesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServicesClient creates a new instance of CloudServicesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServicesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service -// creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - parameters - The cloud service object. -// - options - CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete -// method. -func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*runtime.Poller[CloudServicesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) deleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginDeleteInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// Get - Display information about a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (CloudServicesClientGetResponse, error) { - var err error - const operationName = "CloudServicesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServicesClient) getHandleResponse(resp *http.Response) (CloudServicesClientGetResponse, error) { - result := CloudServicesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudService); err != nil { - return CloudServicesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (CloudServicesClientGetInstanceViewResponse, error) { - var err error - const operationName = "CloudServicesClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServicesClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServicesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServicesClientGetInstanceViewResponse, error) { - result := CloudServicesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceInstanceView); err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the -// next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. -func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListResponse]{ - More: func(page CloudServicesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListResponse) (CloudServicesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return CloudServicesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (CloudServicesClientListResponse, error) { - result := CloudServicesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink -// is null to fetch all the Cloud Services. -// -// Generated from API version 2022-09-04 -// - options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager -// method. -func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListAllResponse]{ - More: func(page CloudServicesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListAllResponse) (CloudServicesClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return CloudServicesClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, options *CloudServicesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *CloudServicesClient) listAllHandleResponse(resp *http.Response) (CloudServicesClientListAllResponse, error) { - result := CloudServicesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListAllResponse{}, err - } - return result, nil -} - -// BeginPowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the -// resources. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff -// method. -func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*runtime.Poller[CloudServicesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) powerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild -// method. -func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*runtime.Poller[CloudServicesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Rebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginRebuild" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.rebuildCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage -// method. -func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*runtime.Poller[CloudServicesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart -// method. -func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*runtime.Poller[CloudServicesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) restart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginStart - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart -// method. -func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*runtime.Poller[CloudServicesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) start(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - parameters - The cloud service object. -// - options - CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate -// method. -func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*runtime.Poller[CloudServicesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CloudServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go deleted file mode 100644 index a4bd1e7b126b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go +++ /dev/null @@ -1,263 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// CloudServicesUpdateDomainClient contains the methods for the CloudServicesUpdateDomain group. -// Don't use this type directly, use NewCloudServicesUpdateDomainClient() instead. -type CloudServicesUpdateDomainClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesUpdateDomainClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServicesUpdateDomainClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// GetUpdateDomain - Gets the specified update domain of a cloud service. Use nextLink property in the response to get the -// next page of update domains. Do this till nextLink is null to fetch all the update domains. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// - options - CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - var err error - const operationName = "CloudServicesUpdateDomainClient.GetUpdateDomain" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, options) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - resp, err := client.getUpdateDomainHandleResponse(httpResp) - return resp, err -} - -// getUpdateDomainCreateRequest creates the GetUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getUpdateDomainHandleResponse handles the GetUpdateDomain response. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - result := CloudServicesUpdateDomainClientGetUpdateDomainResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomain); err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - return result, nil -} - -// NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager -// method. -func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesUpdateDomainClientListUpdateDomainsResponse]{ - More: func(page CloudServicesUpdateDomainClientListUpdateDomainsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesUpdateDomainClientListUpdateDomainsResponse) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesUpdateDomainClient.NewListUpdateDomainsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listUpdateDomainsCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - return client.listUpdateDomainsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listUpdateDomainsCreateRequest creates the ListUpdateDomains request. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listUpdateDomainsHandleResponse handles the ListUpdateDomains response. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - result := CloudServicesUpdateDomainClientListUpdateDomainsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomainListResult); err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - return result, nil -} - -// BeginWalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// - parameters - The update domain object. -// - options - CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.walkUpdateDomain(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// WalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesUpdateDomainClient) walkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesUpdateDomainClient.BeginWalkUpdateDomain" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.walkUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// walkUpdateDomainCreateRequest creates the WalkUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) walkUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go deleted file mode 100644 index 431a26cdef24..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleriesClient contains the methods for the CommunityGalleries group. -// Don't use this type directly, use NewCommunityGalleriesClient() instead. -type CommunityGalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery by gallery public name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -func (client *CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (CommunityGalleriesClientGetResponse, error) { - var err error - const operationName = "CommunityGalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, options) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleriesClient) getHandleResponse(resp *http.Response) (CommunityGalleriesClientGetResponse, error) { - result := CommunityGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGallery); err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go deleted file mode 100644 index 4ecc005caafe..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImagesClient contains the methods for the CommunityGalleryImages group. -// Don't use this type directly, use NewCommunityGalleryImagesClient() instead. -type CommunityGalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - options - CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get -// method. -func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (CommunityGalleryImagesClientGetResponse, error) { - var err error - const operationName = "CommunityGalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Response) (CommunityGalleryImagesClientGetResponse, error) { - result := CommunityGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImage); err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List community gallery images inside a gallery. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager -// method. -func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImagesClientListResponse]{ - More: func(page CommunityGalleryImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CommunityGalleryImagesClientListResponse) (CommunityGalleryImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, publicGalleryName, options) - }, nil) - if err != nil { - return CommunityGalleryImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CommunityGalleryImagesClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CommunityGalleryImagesClient) listHandleResponse(resp *http.Response) (CommunityGalleryImagesClientListResponse, error) { - result := CommunityGalleryImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageList); err != nil { - return CommunityGalleryImagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go deleted file mode 100644 index e98cfa506c7d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImageVersionsClient contains the methods for the CommunityGalleryImageVersions group. -// Don't use this type directly, use NewCommunityGalleryImageVersionsClient() instead. -type CommunityGalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - galleryImageVersionName - The name of the community gallery image version. 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: .. -// - options - CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (CommunityGalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "CommunityGalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientGetResponse, error) { - result := CommunityGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersion); err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List community gallery image versions inside an image. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - options - CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager -// method. -func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImageVersionsClientListResponse]{ - More: func(page CommunityGalleryImageVersionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CommunityGalleryImageVersionsClientListResponse) (CommunityGalleryImageVersionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImageVersionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) - }, nil) - if err != nil { - return CommunityGalleryImageVersionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CommunityGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CommunityGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientListResponse, error) { - result := CommunityGalleryImageVersionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersionList); err != nil { - return CommunityGalleryImageVersionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go deleted file mode 100644 index ab719dfdf02e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go +++ /dev/null @@ -1,2830 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" - moduleVersion = "v5.7.0" -) - -type AccessLevel string - -const ( - AccessLevelNone AccessLevel = "None" - AccessLevelRead AccessLevel = "Read" - AccessLevelWrite AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns the possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{ - AccessLevelNone, - AccessLevelRead, - AccessLevelWrite, - } -} - -// AggregatedReplicationState - This is the aggregated replication status based on all the regional replication status flags. -type AggregatedReplicationState string - -const ( - AggregatedReplicationStateCompleted AggregatedReplicationState = "Completed" - AggregatedReplicationStateFailed AggregatedReplicationState = "Failed" - AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress" - AggregatedReplicationStateUnknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns the possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{ - AggregatedReplicationStateCompleted, - AggregatedReplicationStateFailed, - AggregatedReplicationStateInProgress, - AggregatedReplicationStateUnknown, - } -} - -// AlternativeType - Describes the type of the alternative option. -type AlternativeType string - -const ( - AlternativeTypeNone AlternativeType = "None" - AlternativeTypeOffer AlternativeType = "Offer" - AlternativeTypePlan AlternativeType = "Plan" -) - -// PossibleAlternativeTypeValues returns the possible values for the AlternativeType const type. -func PossibleAlternativeTypeValues() []AlternativeType { - return []AlternativeType{ - AlternativeTypeNone, - AlternativeTypeOffer, - AlternativeTypePlan, - } -} - -// Architecture - The architecture of the image. Applicable to OS disks only. -type Architecture string - -const ( - ArchitectureArm64 Architecture = "Arm64" - ArchitectureX64 Architecture = "x64" -) - -// PossibleArchitectureValues returns the possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{ - ArchitectureArm64, - ArchitectureX64, - } -} - -// ArchitectureTypes - Specifies the Architecture Type -type ArchitectureTypes string - -const ( - ArchitectureTypesArm64 ArchitectureTypes = "Arm64" - ArchitectureTypesX64 ArchitectureTypes = "x64" -) - -// PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type. -func PossibleArchitectureTypesValues() []ArchitectureTypes { - return []ArchitectureTypes{ - ArchitectureTypesArm64, - ArchitectureTypesX64, - } -} - -// AvailabilitySetSKUTypes - Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks -// and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. -type AvailabilitySetSKUTypes string - -const ( - AvailabilitySetSKUTypesAligned AvailabilitySetSKUTypes = "Aligned" - AvailabilitySetSKUTypesClassic AvailabilitySetSKUTypes = "Classic" -) - -// PossibleAvailabilitySetSKUTypesValues returns the possible values for the AvailabilitySetSKUTypes const type. -func PossibleAvailabilitySetSKUTypesValues() []AvailabilitySetSKUTypes { - return []AvailabilitySetSKUTypes{ - AvailabilitySetSKUTypesAligned, - AvailabilitySetSKUTypesClassic, - } -} - -// CachingTypes - Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: -// None for Standard storage. ReadOnly for Premium storage -type CachingTypes string - -const ( - CachingTypesNone CachingTypes = "None" - CachingTypesReadOnly CachingTypes = "ReadOnly" - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns the possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{ - CachingTypesNone, - CachingTypesReadOnly, - CachingTypesReadWrite, - } -} - -type CapacityReservationGroupInstanceViewTypes string - -const ( - CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationGroupInstanceViewTypesValues returns the possible values for the CapacityReservationGroupInstanceViewTypes const type. -func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { - return []CapacityReservationGroupInstanceViewTypes{ - CapacityReservationGroupInstanceViewTypesInstanceView, - } -} - -type CapacityReservationInstanceViewTypes string - -const ( - CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationInstanceViewTypesValues returns the possible values for the CapacityReservationInstanceViewTypes const type. -func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { - return []CapacityReservationInstanceViewTypes{ - CapacityReservationInstanceViewTypesInstanceView, - } -} - -// CloudServiceSlotType - Slot type for the cloud service. Possible values are -// Production -// Staging -// If not specified, the default value is Production. -type CloudServiceSlotType string - -const ( - CloudServiceSlotTypeProduction CloudServiceSlotType = "Production" - CloudServiceSlotTypeStaging CloudServiceSlotType = "Staging" -) - -// PossibleCloudServiceSlotTypeValues returns the possible values for the CloudServiceSlotType const type. -func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType { - return []CloudServiceSlotType{ - CloudServiceSlotTypeProduction, - CloudServiceSlotTypeStaging, - } -} - -// CloudServiceUpgradeMode - Update mode for the cloud service. Role instances are allocated to update domains when the service -// is deployed. Updates can be initiated manually in each update domain or initiated automatically in -// all update domains. Possible Values are -// Auto -// Manual -// Simultaneous -// If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If -// set to Auto, the update is automatically applied to each update domain in -// sequence. -type CloudServiceUpgradeMode string - -const ( - CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto" - CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual" - CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous" -) - -// PossibleCloudServiceUpgradeModeValues returns the possible values for the CloudServiceUpgradeMode const type. -func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { - return []CloudServiceUpgradeMode{ - CloudServiceUpgradeModeAuto, - CloudServiceUpgradeModeManual, - CloudServiceUpgradeModeSimultaneous, - } -} - -// ConfidentialVMEncryptionType - confidential VM encryption types -type ConfidentialVMEncryptionType string - -const ( - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" - ConfidentialVMEncryptionTypeEncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" - ConfidentialVMEncryptionTypeEncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" - ConfidentialVMEncryptionTypeNonPersistedTPM ConfidentialVMEncryptionType = "NonPersistedTPM" -) - -// PossibleConfidentialVMEncryptionTypeValues returns the possible values for the ConfidentialVMEncryptionType const type. -func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType { - return []ConfidentialVMEncryptionType{ - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk, - ConfidentialVMEncryptionTypeEncryptedWithCmk, - ConfidentialVMEncryptionTypeEncryptedWithPmk, - ConfidentialVMEncryptionTypeNonPersistedTPM, - } -} - -// ConsistencyModeTypes - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. -// For now, only CrashConsistent is accepted as a valid input. Please refer to -// https://aka.ms/RestorePoints for more details. -type ConsistencyModeTypes string - -const ( - ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" - ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" - ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" -) - -// PossibleConsistencyModeTypesValues returns the possible values for the ConsistencyModeTypes const type. -func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { - return []ConsistencyModeTypes{ - ConsistencyModeTypesApplicationConsistent, - ConsistencyModeTypesCrashConsistent, - ConsistencyModeTypesFileSystemConsistent, - } -} - -// CopyCompletionErrorReason - Indicates the error code if the background copy of a resource created via the CopyStart operation -// fails. -type CopyCompletionErrorReason string - -const ( - // CopyCompletionErrorReasonCopySourceNotFound - Indicates that the source snapshot was deleted while the background copy - // of the resource created via CopyStart operation was in progress. - CopyCompletionErrorReasonCopySourceNotFound CopyCompletionErrorReason = "CopySourceNotFound" -) - -// PossibleCopyCompletionErrorReasonValues returns the possible values for the CopyCompletionErrorReason const type. -func PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason { - return []CopyCompletionErrorReason{ - CopyCompletionErrorReasonCopySourceNotFound, - } -} - -// DataAccessAuthMode - Additional authentication requirements when exporting or uploading to a disk or snapshot. -type DataAccessAuthMode string - -const ( - // DataAccessAuthModeAzureActiveDirectory - When export/upload URL is used, the system checks if the user has an identity - // in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. - DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" - // DataAccessAuthModeNone - No additional authentication would be performed when accessing export/upload URL. - DataAccessAuthModeNone DataAccessAuthMode = "None" -) - -// PossibleDataAccessAuthModeValues returns the possible values for the DataAccessAuthMode const type. -func PossibleDataAccessAuthModeValues() []DataAccessAuthMode { - return []DataAccessAuthMode{ - DataAccessAuthModeAzureActiveDirectory, - DataAccessAuthModeNone, - } -} - -// DedicatedHostLicenseTypes - Specifies the software license type that will be applied to the VMs deployed on the dedicated -// host. Possible values are: None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None. -type DedicatedHostLicenseTypes string - -const ( - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns the possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{ - DedicatedHostLicenseTypesNone, - DedicatedHostLicenseTypesWindowsServerHybrid, - DedicatedHostLicenseTypesWindowsServerPerpetual, - } -} - -// DeleteOptions - Specify what happens to the network interface when the VM is deleted -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{ - DeleteOptionsDelete, - DeleteOptionsDetach, - } -} - -// DiffDiskOptions - Specifies the ephemeral disk option for operating system disk. -type DiffDiskOptions string - -const ( - DiffDiskOptionsLocal DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns the possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{ - DiffDiskOptionsLocal, - } -} - -// DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user -// in the request to choose the location i.e, cache disk, resource disk or nvme disk space for -// Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS -// disk size requirements for Windows VM at -// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at -// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Minimum api-version for NvmeDisk: -// 2024-03-01. -type DiffDiskPlacement string - -const ( - DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" - DiffDiskPlacementNvmeDisk DiffDiskPlacement = "NvmeDisk" - DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{ - DiffDiskPlacementCacheDisk, - DiffDiskPlacementNvmeDisk, - DiffDiskPlacementResourceDisk, - } -} - -// DiskControllerTypes - Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property -// is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 -// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned -// as part of VM sku capabilities in the response of Microsoft.Compute SKUs -// api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about -// Disk Controller Types supported please refer to -// https://aka.ms/azure-diskcontrollertypes. -type DiskControllerTypes string - -const ( - DiskControllerTypesNVMe DiskControllerTypes = "NVMe" - DiskControllerTypesSCSI DiskControllerTypes = "SCSI" -) - -// PossibleDiskControllerTypesValues returns the possible values for the DiskControllerTypes const type. -func PossibleDiskControllerTypesValues() []DiskControllerTypes { - return []DiskControllerTypes{ - DiskControllerTypesNVMe, - DiskControllerTypesSCSI, - } -} - -// DiskCreateOption - This enumerates the possible sources of a disk's creation. -type DiskCreateOption string - -const ( - // DiskCreateOptionAttach - Disk will be attached to a VM. - DiskCreateOptionAttach DiskCreateOption = "Attach" - // DiskCreateOptionCopy - Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. - DiskCreateOptionCopy DiskCreateOption = "Copy" - // DiskCreateOptionCopyFromSanSnapshot - Create a new disk by exporting from elastic san volume snapshot - DiskCreateOptionCopyFromSanSnapshot DiskCreateOption = "CopyFromSanSnapshot" - // DiskCreateOptionCopyStart - Create a new disk by using a deep copy process, where the resource creation is considered complete - // only after all data has been copied from the source. - DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" - // DiskCreateOptionEmpty - Create an empty data disk of a size given by diskSizeGB. - DiskCreateOptionEmpty DiskCreateOption = "Empty" - // DiskCreateOptionFromImage - Create a new disk from a platform image specified by the given imageReference or galleryImageReference. - DiskCreateOptionFromImage DiskCreateOption = "FromImage" - // DiskCreateOptionImport - Create a disk by importing from a blob specified by a sourceUri in a storage account specified - // by storageAccountId. - DiskCreateOptionImport DiskCreateOption = "Import" - // DiskCreateOptionImportSecure - Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported - // disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId - DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" - // DiskCreateOptionRestore - Create a new disk by copying from a backup recovery point. - DiskCreateOptionRestore DiskCreateOption = "Restore" - // DiskCreateOptionUpload - Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - DiskCreateOptionUpload DiskCreateOption = "Upload" - // DiskCreateOptionUploadPreparedSecure - Similar to Upload create option. Create a new Trusted Launch VM or Confidential - // VM supported disk and upload using write token in both disk and VM guest state - DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -// PossibleDiskCreateOptionValues returns the possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{ - DiskCreateOptionAttach, - DiskCreateOptionCopy, - DiskCreateOptionCopyFromSanSnapshot, - DiskCreateOptionCopyStart, - DiskCreateOptionEmpty, - DiskCreateOptionFromImage, - DiskCreateOptionImport, - DiskCreateOptionImportSecure, - DiskCreateOptionRestore, - DiskCreateOptionUpload, - DiskCreateOptionUploadPreparedSecure, - } -} - -// DiskCreateOptionTypes - Specifies how the virtual machine disk should be created. Possible values are Attach: This value -// is used when you are using a specialized disk to create the virtual machine. FromImage: This value is -// used when you are using an image to create the virtual machine. If you are using a platform image, you should also use -// the imageReference element described above. If you are using a marketplace image, -// you should also use the plan element previously described. Empty: This value is used when creating an empty data disk. -// Copy: This value is used to create a data disk from a snapshot or another disk. -// Restore: This value is used to create a data disk from a disk restore point. -type DiskCreateOptionTypes string - -const ( - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - DiskCreateOptionTypesCopy DiskCreateOptionTypes = "Copy" - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" - DiskCreateOptionTypesRestore DiskCreateOptionTypes = "Restore" -) - -// PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{ - DiskCreateOptionTypesAttach, - DiskCreateOptionTypesCopy, - DiskCreateOptionTypesEmpty, - DiskCreateOptionTypesFromImage, - DiskCreateOptionTypesRestore, - } -} - -// DiskDeleteOptionTypes - Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed -// disk is deleted or detached. Supported values are: Delete. If this value is used, the managed disk -// is deleted when VM gets deleted. Detach. If this value is used, the managed disk is retained after VM gets deleted. Minimum -// api-version: 2021-03-01. -type DiskDeleteOptionTypes string - -const ( - DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" - DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" -) - -// PossibleDiskDeleteOptionTypesValues returns the possible values for the DiskDeleteOptionTypes const type. -func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { - return []DiskDeleteOptionTypes{ - DiskDeleteOptionTypesDelete, - DiskDeleteOptionTypesDetach, - } -} - -// DiskDetachOptionTypes - Specifies the detach behavior to be used while detaching a disk or which is already in the process -// of detachment from the virtual machine. Supported values are: ForceDetach. detachOption: ForceDetach -// is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an -// unexpected failure from the virtual machine and the disk is still not released -// then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed -// when using this detach behavior. This feature is still in preview mode and -// is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting -// detachOption: 'ForceDetach'. -type DiskDetachOptionTypes string - -const ( - DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach" -) - -// PossibleDiskDetachOptionTypesValues returns the possible values for the DiskDetachOptionTypes const type. -func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { - return []DiskDetachOptionTypes{ - DiskDetachOptionTypesForceDetach, - } -} - -// DiskEncryptionSetIdentityType - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported -// for new creations. Disk Encryption Sets can be updated with Identity type None during migration of -// subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. -type DiskEncryptionSetIdentityType string - -const ( - DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" - DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned" - DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns the possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{ - DiskEncryptionSetIdentityTypeNone, - DiskEncryptionSetIdentityTypeSystemAssigned, - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned, - DiskEncryptionSetIdentityTypeUserAssigned, - } -} - -// DiskEncryptionSetType - The type of key used to encrypt the data of the disk. -type DiskEncryptionSetType string - -const ( - // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey - Confidential VM supported disk and VM guest state would be - // encrypted with customer managed key. - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey - Resource using diskEncryptionSet would be encrypted at rest with - // Customer managed key that can be changed and revoked by a customer. - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys - Resource using diskEncryptionSet would be encrypted - // at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" -) - -// PossibleDiskEncryptionSetTypeValues returns the possible values for the DiskEncryptionSetType const type. -func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { - return []DiskEncryptionSetType{ - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys, - } -} - -// DiskSecurityTypes - Specifies the SecurityType of the VM. Applicable for OS disks only. -type DiskSecurityTypes string - -const ( - // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a customer managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a platform managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - // DiskSecurityTypesConfidentialVMNonPersistedTPM - Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not - // persisted across VM reboots. - DiskSecurityTypesConfidentialVMNonPersistedTPM DiskSecurityTypes = "ConfidentialVM_NonPersistedTPM" - // DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - Indicates Confidential VM disk with only VM guest - // state encrypted - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - // DiskSecurityTypesTrustedLaunch - Trusted Launch provides security features such as secure boot and virtual Trusted Platform - // Module (vTPM) - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -// PossibleDiskSecurityTypesValues returns the possible values for the DiskSecurityTypes const type. -func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { - return []DiskSecurityTypes{ - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, - DiskSecurityTypesConfidentialVMNonPersistedTPM, - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey, - DiskSecurityTypesTrustedLaunch, - } -} - -// DiskState - This enumerates the possible state of the disk. -type DiskState string - -const ( - // DiskStateActiveSAS - The disk currently has an Active SAS Uri associated with it. - DiskStateActiveSAS DiskState = "ActiveSAS" - // DiskStateActiveSASFrozen - The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. - DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" - // DiskStateActiveUpload - A disk is created for upload and a write token has been issued for uploading to it. - DiskStateActiveUpload DiskState = "ActiveUpload" - // DiskStateAttached - The disk is currently attached to a running VM. - DiskStateAttached DiskState = "Attached" - // DiskStateFrozen - The disk is attached to a VM which is in hibernated state. - DiskStateFrozen DiskState = "Frozen" - // DiskStateReadyToUpload - A disk is ready to be created by upload by requesting a write token. - DiskStateReadyToUpload DiskState = "ReadyToUpload" - // DiskStateReserved - The disk is attached to a stopped-deallocated VM. - DiskStateReserved DiskState = "Reserved" - // DiskStateUnattached - The disk is not being used and can be attached to a VM. - DiskStateUnattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns the possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ - DiskStateActiveSAS, - DiskStateActiveSASFrozen, - DiskStateActiveUpload, - DiskStateAttached, - DiskStateFrozen, - DiskStateReadyToUpload, - DiskStateReserved, - DiskStateUnattached, - } -} - -// DiskStorageAccountTypes - The sku name. -type DiskStorageAccountTypes string - -const ( - // DiskStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // DiskStorageAccountTypesPremiumV2LRS - Premium SSD v2 locally redundant storage. Best for production and performance-sensitive - // workloads that consistently require low latency and high IOPS and throughput. - DiskStorageAccountTypesPremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS" - // DiskStorageAccountTypesPremiumZRS - Premium SSD zone redundant storage. Best for the production workloads that need storage - // resiliency against zone failures. - DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - // DiskStorageAccountTypesStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" - // DiskStorageAccountTypesStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // DiskStorageAccountTypesStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test that need storage resiliency against zone failures. - DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - // DiskStorageAccountTypesUltraSSDLRS - 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. - DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns the possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{ - DiskStorageAccountTypesPremiumLRS, - DiskStorageAccountTypesPremiumV2LRS, - DiskStorageAccountTypesPremiumZRS, - DiskStorageAccountTypesStandardLRS, - DiskStorageAccountTypesStandardSSDLRS, - DiskStorageAccountTypesStandardSSDZRS, - DiskStorageAccountTypesUltraSSDLRS, - } -} - -// DomainNameLabelScopeTypes - The Domain name label scope.The concatenation of the hashed domain name label that generated -// according to the policy from domain name label scope and vm index will be the domain name labels of the -// PublicIPAddress resources that will be created -type DomainNameLabelScopeTypes string - -const ( - DomainNameLabelScopeTypesNoReuse DomainNameLabelScopeTypes = "NoReuse" - DomainNameLabelScopeTypesResourceGroupReuse DomainNameLabelScopeTypes = "ResourceGroupReuse" - DomainNameLabelScopeTypesSubscriptionReuse DomainNameLabelScopeTypes = "SubscriptionReuse" - DomainNameLabelScopeTypesTenantReuse DomainNameLabelScopeTypes = "TenantReuse" -) - -// PossibleDomainNameLabelScopeTypesValues returns the possible values for the DomainNameLabelScopeTypes const type. -func PossibleDomainNameLabelScopeTypesValues() []DomainNameLabelScopeTypes { - return []DomainNameLabelScopeTypes{ - DomainNameLabelScopeTypesNoReuse, - DomainNameLabelScopeTypesResourceGroupReuse, - DomainNameLabelScopeTypesSubscriptionReuse, - DomainNameLabelScopeTypesTenantReuse, - } -} - -// EdgeZoneStorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. -type EdgeZoneStorageAccountType string - -const ( - EdgeZoneStorageAccountTypePremiumLRS EdgeZoneStorageAccountType = "Premium_LRS" - EdgeZoneStorageAccountTypeStandardLRS EdgeZoneStorageAccountType = "Standard_LRS" - EdgeZoneStorageAccountTypeStandardSSDLRS EdgeZoneStorageAccountType = "StandardSSD_LRS" - EdgeZoneStorageAccountTypeStandardZRS EdgeZoneStorageAccountType = "Standard_ZRS" -) - -// PossibleEdgeZoneStorageAccountTypeValues returns the possible values for the EdgeZoneStorageAccountType const type. -func PossibleEdgeZoneStorageAccountTypeValues() []EdgeZoneStorageAccountType { - return []EdgeZoneStorageAccountType{ - EdgeZoneStorageAccountTypePremiumLRS, - EdgeZoneStorageAccountTypeStandardLRS, - EdgeZoneStorageAccountTypeStandardSSDLRS, - EdgeZoneStorageAccountTypeStandardZRS, - } -} - -// EncryptionType - The type of key used to encrypt the data of the disk. -type EncryptionType string - -const ( - // EncryptionTypeEncryptionAtRestWithCustomerKey - Disk is encrypted at rest with Customer managed key that can be changed - // and revoked by a customer. - EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk is encrypted at rest with 2 layers of encryption. One - // of the keys is Customer managed and the other key is Platform managed. - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // EncryptionTypeEncryptionAtRestWithPlatformKey - Disk is encrypted at rest with Platform managed key. It is the default - // encryption type. This is not a valid encryption type for disk encryption sets. - EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{ - EncryptionTypeEncryptionAtRestWithCustomerKey, - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - EncryptionTypeEncryptionAtRestWithPlatformKey, - } -} - -// ExecutionState - Script execution status. -type ExecutionState string - -const ( - ExecutionStateCanceled ExecutionState = "Canceled" - ExecutionStateFailed ExecutionState = "Failed" - ExecutionStatePending ExecutionState = "Pending" - ExecutionStateRunning ExecutionState = "Running" - ExecutionStateSucceeded ExecutionState = "Succeeded" - ExecutionStateTimedOut ExecutionState = "TimedOut" - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns the possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ - ExecutionStateCanceled, - ExecutionStateFailed, - ExecutionStatePending, - ExecutionStateRunning, - ExecutionStateSucceeded, - ExecutionStateTimedOut, - ExecutionStateUnknown, - } -} - -type ExpandTypeForListVMs string - -const ( - ExpandTypeForListVMsInstanceView ExpandTypeForListVMs = "instanceView" -) - -// PossibleExpandTypeForListVMsValues returns the possible values for the ExpandTypeForListVMs const type. -func PossibleExpandTypeForListVMsValues() []ExpandTypeForListVMs { - return []ExpandTypeForListVMs{ - ExpandTypeForListVMsInstanceView, - } -} - -type ExpandTypesForGetCapacityReservationGroups string - -const ( - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" -) - -// PossibleExpandTypesForGetCapacityReservationGroupsValues returns the possible values for the ExpandTypesForGetCapacityReservationGroups const type. -func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { - return []ExpandTypesForGetCapacityReservationGroups{ - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef, - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef, - } -} - -type ExpandTypesForGetVMScaleSets string - -const ( - ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData" -) - -// PossibleExpandTypesForGetVMScaleSetsValues returns the possible values for the ExpandTypesForGetVMScaleSets const type. -func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { - return []ExpandTypesForGetVMScaleSets{ - ExpandTypesForGetVMScaleSetsUserData, - } -} - -type ExpandTypesForListVMs string - -const ( - ExpandTypesForListVMsInstanceView ExpandTypesForListVMs = "instanceView" -) - -// PossibleExpandTypesForListVMsValues returns the possible values for the ExpandTypesForListVMs const type. -func PossibleExpandTypesForListVMsValues() []ExpandTypesForListVMs { - return []ExpandTypesForListVMs{ - ExpandTypesForListVMsInstanceView, - } -} - -// ExtendedLocationType - The type of the extended location. -type ExtendedLocationType string - -const ( - ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" -) - -// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type. -func PossibleExtendedLocationTypeValues() []ExtendedLocationType { - return []ExtendedLocationType{ - ExtendedLocationTypeEdgeZone, - } -} - -// ExtendedLocationTypes - The type of extendedLocation. -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ - ExtendedLocationTypesEdgeZone, - } -} - -// FileFormat - Used to specify the file format when making request for SAS on a VHDX file format snapshot -type FileFormat string - -const ( - // FileFormatVHD - A VHD file is a disk image file in the Virtual Hard Disk file format. - FileFormatVHD FileFormat = "VHD" - // FileFormatVHDX - A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. - FileFormatVHDX FileFormat = "VHDX" -) - -// PossibleFileFormatValues returns the possible values for the FileFormat const type. -func PossibleFileFormatValues() []FileFormat { - return []FileFormat{ - FileFormatVHD, - FileFormatVHDX, - } -} - -// GalleryApplicationCustomActionParameterType - Specifies the type of the custom action parameter. Possible values are: String, -// ConfigurationDataBlob or LogOutputBlob -type GalleryApplicationCustomActionParameterType string - -const ( - GalleryApplicationCustomActionParameterTypeConfigurationDataBlob GalleryApplicationCustomActionParameterType = "ConfigurationDataBlob" - GalleryApplicationCustomActionParameterTypeLogOutputBlob GalleryApplicationCustomActionParameterType = "LogOutputBlob" - GalleryApplicationCustomActionParameterTypeString GalleryApplicationCustomActionParameterType = "String" -) - -// PossibleGalleryApplicationCustomActionParameterTypeValues returns the possible values for the GalleryApplicationCustomActionParameterType const type. -func PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType { - return []GalleryApplicationCustomActionParameterType{ - GalleryApplicationCustomActionParameterTypeConfigurationDataBlob, - GalleryApplicationCustomActionParameterTypeLogOutputBlob, - GalleryApplicationCustomActionParameterTypeString, - } -} - -type GalleryExpandParams string - -const ( - GalleryExpandParamsSharingProfileGroups GalleryExpandParams = "SharingProfile/Groups" -) - -// PossibleGalleryExpandParamsValues returns the possible values for the GalleryExpandParams const type. -func PossibleGalleryExpandParamsValues() []GalleryExpandParams { - return []GalleryExpandParams{ - GalleryExpandParamsSharingProfileGroups, - } -} - -// GalleryExtendedLocationType - It is type of the extended location. -type GalleryExtendedLocationType string - -const ( - GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" - GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" -) - -// PossibleGalleryExtendedLocationTypeValues returns the possible values for the GalleryExtendedLocationType const type. -func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { - return []GalleryExtendedLocationType{ - GalleryExtendedLocationTypeEdgeZone, - GalleryExtendedLocationTypeUnknown, - } -} - -// GalleryProvisioningState - The provisioning state, which only appears in the response. -type GalleryProvisioningState string - -const ( - GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" - GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" - GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" - GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" - GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" - GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" -) - -// PossibleGalleryProvisioningStateValues returns the possible values for the GalleryProvisioningState const type. -func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState { - return []GalleryProvisioningState{ - GalleryProvisioningStateCreating, - GalleryProvisioningStateDeleting, - GalleryProvisioningStateFailed, - GalleryProvisioningStateMigrating, - GalleryProvisioningStateSucceeded, - GalleryProvisioningStateUpdating, - } -} - -// GallerySharingPermissionTypes - This property allows you to specify the permission of sharing gallery. Possible values -// are: Private, Groups, Community. -type GallerySharingPermissionTypes string - -const ( - GallerySharingPermissionTypesCommunity GallerySharingPermissionTypes = "Community" - GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" - GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" -) - -// PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type. -func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { - return []GallerySharingPermissionTypes{ - GallerySharingPermissionTypesCommunity, - GallerySharingPermissionTypesGroups, - GallerySharingPermissionTypesPrivate, - } -} - -// HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' -type HostCaching string - -const ( - HostCachingNone HostCaching = "None" - HostCachingReadOnly HostCaching = "ReadOnly" - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns the possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{ - HostCachingNone, - HostCachingReadOnly, - HostCachingReadWrite, - } -} - -// HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. -type HyperVGeneration string - -const ( - HyperVGenerationV1 HyperVGeneration = "V1" - HyperVGenerationV2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns the possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{ - HyperVGenerationV1, - HyperVGenerationV2, - } -} - -// HyperVGenerationType - Specifies the HyperVGeneration Type associated with a resource -type HyperVGenerationType string - -const ( - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns the possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{ - HyperVGenerationTypeV1, - HyperVGenerationTypeV2, - } -} - -// HyperVGenerationTypes - Specifies the HyperVGeneration Type -type HyperVGenerationTypes string - -const ( - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns the possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{ - HyperVGenerationTypesV1, - HyperVGenerationTypesV2, - } -} - -// IPVersion - 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'. -type IPVersion string - -const ( - IPVersionIPv4 IPVersion = "IPv4" - IPVersionIPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns the possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{ - IPVersionIPv4, - IPVersionIPv6, - } -} - -// IPVersions - 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'. -type IPVersions string - -const ( - IPVersionsIPv4 IPVersions = "IPv4" - IPVersionsIPv6 IPVersions = "IPv6" -) - -// PossibleIPVersionsValues returns the possible values for the IPVersions const type. -func PossibleIPVersionsValues() []IPVersions { - return []IPVersions{ - IPVersionsIPv4, - IPVersionsIPv6, - } -} - -// ImageState - Describes the state of the image. -type ImageState string - -const ( - ImageStateActive ImageState = "Active" - ImageStateDeprecated ImageState = "Deprecated" - ImageStateScheduledForDeprecation ImageState = "ScheduledForDeprecation" -) - -// PossibleImageStateValues returns the possible values for the ImageState const type. -func PossibleImageStateValues() []ImageState { - return []ImageState{ - ImageStateActive, - ImageStateDeprecated, - ImageStateScheduledForDeprecation, - } -} - -type InstanceViewTypes string - -const ( - InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" - InstanceViewTypesUserData InstanceViewTypes = "userData" -) - -// PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{ - InstanceViewTypesInstanceView, - InstanceViewTypesUserData, - } -} - -// IntervalInMins - Interval value in minutes used to create LogAnalytics call rate logs. -type IntervalInMins string - -const ( - IntervalInMinsFiveMins IntervalInMins = "FiveMins" - IntervalInMinsSixtyMins IntervalInMins = "SixtyMins" - IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins" - IntervalInMinsThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns the possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{ - IntervalInMinsFiveMins, - IntervalInMinsSixtyMins, - IntervalInMinsThirtyMins, - IntervalInMinsThreeMins, - } -} - -// LinuxPatchAssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type LinuxPatchAssessmentMode string - -const ( - LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" - LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" -) - -// PossibleLinuxPatchAssessmentModeValues returns the possible values for the LinuxPatchAssessmentMode const type. -func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { - return []LinuxPatchAssessmentMode{ - LinuxPatchAssessmentModeAutomaticByPlatform, - LinuxPatchAssessmentModeImageDefault, - } -} - -// LinuxVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting { - return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{ - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// LinuxVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// ImageDefault - The virtual machine's default patching configuration is used. -// AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent -// must be true -type LinuxVMGuestPatchMode string - -const ( - LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" - LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" -) - -// PossibleLinuxVMGuestPatchModeValues returns the possible values for the LinuxVMGuestPatchMode const type. -func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { - return []LinuxVMGuestPatchMode{ - LinuxVMGuestPatchModeAutomaticByPlatform, - LinuxVMGuestPatchModeImageDefault, - } -} - -// MaintenanceOperationResultCodeTypes - The Last Maintenance Operation Result Code. -type MaintenanceOperationResultCodeTypes string - -const ( - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns the possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{ - MaintenanceOperationResultCodeTypesMaintenanceAborted, - MaintenanceOperationResultCodeTypesMaintenanceCompleted, - MaintenanceOperationResultCodeTypesNone, - MaintenanceOperationResultCodeTypesRetryLater, - } -} - -// Mode - Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or -// monitor but not enforce access control over requests to host endpoints in Audit mode, -// while in Enforce mode it will enforce access control. The default value is Enforce mode. -type Mode string - -const ( - ModeAudit Mode = "Audit" - ModeEnforce Mode = "Enforce" -) - -// PossibleModeValues returns the possible values for the Mode const type. -func PossibleModeValues() []Mode { - return []Mode{ - ModeAudit, - ModeEnforce, - } -} - -// NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network -// Interface Configurations -type NetworkAPIVersion string - -const ( - NetworkAPIVersionTwoThousandTwenty1101 NetworkAPIVersion = "2020-11-01" -) - -// PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type. -func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { - return []NetworkAPIVersion{ - NetworkAPIVersionTwoThousandTwenty1101, - } -} - -// NetworkAccessPolicy - Policy for accessing the disk via network. -type NetworkAccessPolicy string - -const ( - // NetworkAccessPolicyAllowAll - The disk can be exported or uploaded to from any network. - NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" - // NetworkAccessPolicyAllowPrivate - The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" - // NetworkAccessPolicyDenyAll - The disk cannot be exported. - NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" -) - -// PossibleNetworkAccessPolicyValues returns the possible values for the NetworkAccessPolicy const type. -func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { - return []NetworkAccessPolicy{ - NetworkAccessPolicyAllowAll, - NetworkAccessPolicyAllowPrivate, - NetworkAccessPolicyDenyAll, - } -} - -// NetworkInterfaceAuxiliaryMode - Specifies whether the Auxiliary mode is enabled for the Network Interface resource. -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -// PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type. -func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode { - return []NetworkInterfaceAuxiliaryMode{ - NetworkInterfaceAuxiliaryModeAcceleratedConnections, - NetworkInterfaceAuxiliaryModeFloating, - NetworkInterfaceAuxiliaryModeNone, - } -} - -// NetworkInterfaceAuxiliarySKU - Specifies whether the Auxiliary sku is enabled for the Network Interface resource. -type NetworkInterfaceAuxiliarySKU string - -const ( - NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1" - NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2" - NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4" - NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8" - NetworkInterfaceAuxiliarySKUNone NetworkInterfaceAuxiliarySKU = "None" -) - -// PossibleNetworkInterfaceAuxiliarySKUValues returns the possible values for the NetworkInterfaceAuxiliarySKU const type. -func PossibleNetworkInterfaceAuxiliarySKUValues() []NetworkInterfaceAuxiliarySKU { - return []NetworkInterfaceAuxiliarySKU{ - NetworkInterfaceAuxiliarySKUA1, - NetworkInterfaceAuxiliarySKUA2, - NetworkInterfaceAuxiliarySKUA4, - NetworkInterfaceAuxiliarySKUA8, - NetworkInterfaceAuxiliarySKUNone, - } -} - -// OperatingSystemStateTypes - This property allows the user to specify whether the virtual machines created under this image -// are 'Generalized' or 'Specialized'. -type OperatingSystemStateTypes string - -const ( - OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized" - OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns the possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{ - OperatingSystemStateTypesGeneralized, - OperatingSystemStateTypesSpecialized, - } -} - -// OperatingSystemType - Gets the Operating System type. -type OperatingSystemType string - -const ( - OperatingSystemTypeLinux OperatingSystemType = "Linux" - OperatingSystemTypeWindows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{ - OperatingSystemTypeLinux, - OperatingSystemTypeWindows, - } -} - -// OperatingSystemTypes - This property allows you to specify the supported type of the OS that application is built for. -// Possible values are: Windows, Linux. -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{ - OperatingSystemTypesLinux, - OperatingSystemTypesWindows, - } -} - -// OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. -type OrchestrationMode string - -const ( - OrchestrationModeFlexible OrchestrationMode = "Flexible" - OrchestrationModeUniform OrchestrationMode = "Uniform" -) - -// PossibleOrchestrationModeValues returns the possible values for the OrchestrationMode const type. -func PossibleOrchestrationModeValues() []OrchestrationMode { - return []OrchestrationMode{ - OrchestrationModeFlexible, - OrchestrationModeUniform, - } -} - -// OrchestrationServiceNames - The name of the service. -type OrchestrationServiceNames string - -const ( - OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns the possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{ - OrchestrationServiceNamesAutomaticRepairs, - } -} - -// OrchestrationServiceState - The current state of the service. -type OrchestrationServiceState string - -const ( - OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning" - OrchestrationServiceStateRunning OrchestrationServiceState = "Running" - OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns the possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{ - OrchestrationServiceStateNotRunning, - OrchestrationServiceStateRunning, - OrchestrationServiceStateSuspended, - } -} - -// OrchestrationServiceStateAction - The action to be performed. -type OrchestrationServiceStateAction string - -const ( - OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume" - OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns the possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{ - OrchestrationServiceStateActionResume, - OrchestrationServiceStateActionSuspend, - } -} - -// PatchAssessmentState - Describes the availability of a given patch. -type PatchAssessmentState string - -const ( - PatchAssessmentStateAvailable PatchAssessmentState = "Available" - PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" -) - -// PossiblePatchAssessmentStateValues returns the possible values for the PatchAssessmentState const type. -func PossiblePatchAssessmentStateValues() []PatchAssessmentState { - return []PatchAssessmentState{ - PatchAssessmentStateAvailable, - PatchAssessmentStateUnknown, - } -} - -// PatchInstallationState - The state of the patch after the installation operation completed. -type PatchInstallationState string - -const ( - PatchInstallationStateExcluded PatchInstallationState = "Excluded" - PatchInstallationStateFailed PatchInstallationState = "Failed" - PatchInstallationStateInstalled PatchInstallationState = "Installed" - PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" - PatchInstallationStatePending PatchInstallationState = "Pending" - PatchInstallationStateUnknown PatchInstallationState = "Unknown" -) - -// PossiblePatchInstallationStateValues returns the possible values for the PatchInstallationState const type. -func PossiblePatchInstallationStateValues() []PatchInstallationState { - return []PatchInstallationState{ - PatchInstallationStateExcluded, - PatchInstallationStateFailed, - PatchInstallationStateInstalled, - PatchInstallationStateNotSelected, - PatchInstallationStatePending, - PatchInstallationStateUnknown, - } -} - -// PatchOperationStatus - The overall success or failure status of the operation. It remains "InProgress" until the operation -// completes. At that point it will become "Unknown", "Failed", "Succeeded", or -// "CompletedWithWarnings." -type PatchOperationStatus string - -const ( - PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" - PatchOperationStatusFailed PatchOperationStatus = "Failed" - PatchOperationStatusInProgress PatchOperationStatus = "InProgress" - PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" - PatchOperationStatusUnknown PatchOperationStatus = "Unknown" -) - -// PossiblePatchOperationStatusValues returns the possible values for the PatchOperationStatus const type. -func PossiblePatchOperationStatusValues() []PatchOperationStatus { - return []PatchOperationStatus{ - PatchOperationStatusCompletedWithWarnings, - PatchOperationStatusFailed, - PatchOperationStatusInProgress, - PatchOperationStatusSucceeded, - PatchOperationStatusUnknown, - } -} - -// PolicyViolationCategory - Describes the nature of the policy violation. -type PolicyViolationCategory string - -const ( - PolicyViolationCategoryCopyrightValidation PolicyViolationCategory = "CopyrightValidation" - PolicyViolationCategoryIPTheft PolicyViolationCategory = "IpTheft" - PolicyViolationCategoryImageFlaggedUnsafe PolicyViolationCategory = "ImageFlaggedUnsafe" - PolicyViolationCategoryOther PolicyViolationCategory = "Other" -) - -// PossiblePolicyViolationCategoryValues returns the possible values for the PolicyViolationCategory const type. -func PossiblePolicyViolationCategoryValues() []PolicyViolationCategory { - return []PolicyViolationCategory{ - PolicyViolationCategoryCopyrightValidation, - PolicyViolationCategoryIPTheft, - PolicyViolationCategoryImageFlaggedUnsafe, - PolicyViolationCategoryOther, - } -} - -// PrivateEndpointConnectionProvisioningState - The current provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{ - PrivateEndpointConnectionProvisioningStateCreating, - PrivateEndpointConnectionProvisioningStateDeleting, - PrivateEndpointConnectionProvisioningStateFailed, - PrivateEndpointConnectionProvisioningStateSucceeded, - } -} - -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - } -} - -// ProtocolTypes - Specifies the protocol of WinRM listener. Possible values are: http, https. -type ProtocolTypes string - -const ( - ProtocolTypesHTTP ProtocolTypes = "Http" - ProtocolTypesHTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns the possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{ - ProtocolTypesHTTP, - ProtocolTypesHTTPS, - } -} - -// ProvisionedBandwidthCopyOption - If this field is set on a snapshot and createOption is CopyStart, the snapshot will be -// copied at a quicker speed. -type ProvisionedBandwidthCopyOption string - -const ( - ProvisionedBandwidthCopyOptionEnhanced ProvisionedBandwidthCopyOption = "Enhanced" - ProvisionedBandwidthCopyOptionNone ProvisionedBandwidthCopyOption = "None" -) - -// PossibleProvisionedBandwidthCopyOptionValues returns the possible values for the ProvisionedBandwidthCopyOption const type. -func PossibleProvisionedBandwidthCopyOptionValues() []ProvisionedBandwidthCopyOption { - return []ProvisionedBandwidthCopyOption{ - ProvisionedBandwidthCopyOptionEnhanced, - ProvisionedBandwidthCopyOptionNone, - } -} - -// 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. -type ProximityPlacementGroupType string - -const ( - ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard" - ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns the possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{ - ProximityPlacementGroupTypeStandard, - ProximityPlacementGroupTypeUltra, - } -} - -// PublicIPAddressSKUName - Specify public IP sku name -type PublicIPAddressSKUName string - -const ( - PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" - PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" -) - -// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type. -func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { - return []PublicIPAddressSKUName{ - PublicIPAddressSKUNameBasic, - PublicIPAddressSKUNameStandard, - } -} - -// PublicIPAddressSKUTier - Specify public IP sku tier -type PublicIPAddressSKUTier string - -const ( - PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" - PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" -) - -// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type. -func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { - return []PublicIPAddressSKUTier{ - PublicIPAddressSKUTierGlobal, - PublicIPAddressSKUTierRegional, - } -} - -// PublicIPAllocationMethod - Specify the public IP allocation type -type PublicIPAllocationMethod string - -const ( - PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" - PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" -) - -// PossiblePublicIPAllocationMethodValues returns the possible values for the PublicIPAllocationMethod const type. -func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { - return []PublicIPAllocationMethod{ - PublicIPAllocationMethodDynamic, - PublicIPAllocationMethodStatic, - } -} - -// PublicNetworkAccess - Policy for controlling export on the disk. -type PublicNetworkAccess string - -const ( - // PublicNetworkAccessDisabled - You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy - // is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy - // is set to AllowPrivate. - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled - You can generate a SAS URI to access the underlying data of the disk publicly on the internet - // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET - // when NetworkAccessPolicy is set to AllowPrivate. - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - -// RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines -// in the scale set. Default value is replace. -type RepairAction string - -const ( - RepairActionReimage RepairAction = "Reimage" - RepairActionReplace RepairAction = "Replace" - RepairActionRestart RepairAction = "Restart" -) - -// PossibleRepairActionValues returns the possible values for the RepairAction const type. -func PossibleRepairActionValues() []RepairAction { - return []RepairAction{ - RepairActionReimage, - RepairActionReplace, - RepairActionRestart, - } -} - -// ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. -type ReplicationMode string - -const ( - ReplicationModeFull ReplicationMode = "Full" - ReplicationModeShallow ReplicationMode = "Shallow" -) - -// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{ - ReplicationModeFull, - ReplicationModeShallow, - } -} - -// ReplicationState - This is the regional replication state. -type ReplicationState string - -const ( - ReplicationStateCompleted ReplicationState = "Completed" - ReplicationStateFailed ReplicationState = "Failed" - ReplicationStateReplicating ReplicationState = "Replicating" - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns the possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ - ReplicationStateCompleted, - ReplicationStateFailed, - ReplicationStateReplicating, - ReplicationStateUnknown, - } -} - -type ReplicationStatusTypes string - -const ( - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" - ReplicationStatusTypesUefiSettings ReplicationStatusTypes = "UefiSettings" -) - -// PossibleReplicationStatusTypesValues returns the possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ - ReplicationStatusTypesReplicationStatus, - ReplicationStatusTypesUefiSettings, - } -} - -type ResourceIDOptionsForGetCapacityReservationGroups string - -const ( - ResourceIDOptionsForGetCapacityReservationGroupsAll ResourceIDOptionsForGetCapacityReservationGroups = "All" - ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription ResourceIDOptionsForGetCapacityReservationGroups = "CreatedInSubscription" - ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription ResourceIDOptionsForGetCapacityReservationGroups = "SharedWithSubscription" -) - -// PossibleResourceIDOptionsForGetCapacityReservationGroupsValues returns the possible values for the ResourceIDOptionsForGetCapacityReservationGroups const type. -func PossibleResourceIDOptionsForGetCapacityReservationGroupsValues() []ResourceIDOptionsForGetCapacityReservationGroups { - return []ResourceIDOptionsForGetCapacityReservationGroups{ - ResourceIDOptionsForGetCapacityReservationGroupsAll, - ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription, - ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription, - } -} - -// ResourceIdentityType - 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. -type ResourceIdentityType string - -const ( - ResourceIdentityTypeNone ResourceIdentityType = "None" - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ - ResourceIdentityTypeNone, - ResourceIdentityTypeSystemAssigned, - ResourceIdentityTypeSystemAssignedUserAssigned, - ResourceIdentityTypeUserAssigned, - } -} - -// ResourceSKUCapacityScaleType - The scale type applicable to the sku. -type ResourceSKUCapacityScaleType string - -const ( - ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "Automatic" - ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "Manual" - ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "None" -) - -// PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type. -func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType { - return []ResourceSKUCapacityScaleType{ - ResourceSKUCapacityScaleTypeAutomatic, - ResourceSKUCapacityScaleTypeManual, - ResourceSKUCapacityScaleTypeNone, - } -} - -// ResourceSKURestrictionsReasonCode - The reason for restriction. -type ResourceSKURestrictionsReasonCode string - -const ( - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription" - ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type. -func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode { - return []ResourceSKURestrictionsReasonCode{ - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription, - ResourceSKURestrictionsReasonCodeQuotaID, - } -} - -// ResourceSKURestrictionsType - The type of restrictions. -type ResourceSKURestrictionsType string - -const ( - ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location" - ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone" -) - -// PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type. -func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { - return []ResourceSKURestrictionsType{ - ResourceSKURestrictionsTypeLocation, - ResourceSKURestrictionsTypeZone, - } -} - -type RestorePointCollectionExpandOptions string - -const ( - RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints" -) - -// PossibleRestorePointCollectionExpandOptionsValues returns the possible values for the RestorePointCollectionExpandOptions const type. -func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { - return []RestorePointCollectionExpandOptions{ - RestorePointCollectionExpandOptionsRestorePoints, - } -} - -// RestorePointEncryptionType - The type of key used to encrypt the data of the disk restore point. -type RestorePointEncryptionType string - -const ( - // RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey - Disk Restore Point is encrypted at rest with Customer managed - // key that can be changed and revoked by a customer. - RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey" - // RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk Restore Point is encrypted at rest with 2 - // layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey - Disk Restore Point is encrypted at rest with Platform managed - // key. - RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleRestorePointEncryptionTypeValues returns the possible values for the RestorePointEncryptionType const type. -func PossibleRestorePointEncryptionTypeValues() []RestorePointEncryptionType { - return []RestorePointEncryptionType{ - RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey, - RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey, - } -} - -type RestorePointExpandOptions string - -const ( - RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" -) - -// PossibleRestorePointExpandOptionsValues returns the possible values for the RestorePointExpandOptions const type. -func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions { - return []RestorePointExpandOptions{ - RestorePointExpandOptionsInstanceView, - } -} - -// RollingUpgradeActionType - The last action performed on the rolling upgrade. -type RollingUpgradeActionType string - -const ( - RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel" - RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns the possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{ - RollingUpgradeActionTypeCancel, - RollingUpgradeActionTypeStart, - } -} - -// RollingUpgradeStatusCode - Code indicating the current status of the upgrade. -type RollingUpgradeStatusCode string - -const ( - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns the possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{ - RollingUpgradeStatusCodeCancelled, - RollingUpgradeStatusCodeCompleted, - RollingUpgradeStatusCodeFaulted, - RollingUpgradeStatusCodeRollingForward, - } -} - -// SSHEncryptionTypes - The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. -// If not provided, will default to RSA -type SSHEncryptionTypes string - -const ( - SSHEncryptionTypesEd25519 SSHEncryptionTypes = "Ed25519" - SSHEncryptionTypesRSA SSHEncryptionTypes = "RSA" -) - -// PossibleSSHEncryptionTypesValues returns the possible values for the SSHEncryptionTypes const type. -func PossibleSSHEncryptionTypesValues() []SSHEncryptionTypes { - return []SSHEncryptionTypes{ - SSHEncryptionTypesEd25519, - SSHEncryptionTypesRSA, - } -} - -// SecurityEncryptionTypes - Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption -// of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the -// VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set -// for only Confidential VMs. -type SecurityEncryptionTypes string - -const ( - SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" - SecurityEncryptionTypesNonPersistedTPM SecurityEncryptionTypes = "NonPersistedTPM" - SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" -) - -// PossibleSecurityEncryptionTypesValues returns the possible values for the SecurityEncryptionTypes const type. -func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes { - return []SecurityEncryptionTypes{ - SecurityEncryptionTypesDiskWithVMGuestState, - SecurityEncryptionTypesNonPersistedTPM, - SecurityEncryptionTypesVMGuestStateOnly, - } -} - -// SecurityTypes - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. -// The default behavior is: UefiSettings will not be enabled unless this property is -// set. -type SecurityTypes string - -const ( - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -// PossibleSecurityTypesValues returns the possible values for the SecurityTypes const type. -func PossibleSecurityTypesValues() []SecurityTypes { - return []SecurityTypes{ - SecurityTypesConfidentialVM, - SecurityTypesTrustedLaunch, - } -} - -type SelectPermissions string - -const ( - SelectPermissionsPermissions SelectPermissions = "Permissions" -) - -// PossibleSelectPermissionsValues returns the possible values for the SelectPermissions const type. -func PossibleSelectPermissionsValues() []SelectPermissions { - return []SelectPermissions{ - SelectPermissionsPermissions, - } -} - -// SettingNames - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands -// and AutoLogon. -type SettingNames string - -const ( - SettingNamesAutoLogon SettingNames = "AutoLogon" - SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns the possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{ - SettingNamesAutoLogon, - SettingNamesFirstLogonCommands, - } -} - -// SharedGalleryHostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' -type SharedGalleryHostCaching string - -const ( - SharedGalleryHostCachingNone SharedGalleryHostCaching = "None" - SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly" - SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite" -) - -// PossibleSharedGalleryHostCachingValues returns the possible values for the SharedGalleryHostCaching const type. -func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching { - return []SharedGalleryHostCaching{ - SharedGalleryHostCachingNone, - SharedGalleryHostCachingReadOnly, - SharedGalleryHostCachingReadWrite, - } -} - -type SharedToValues string - -const ( - SharedToValuesTenant SharedToValues = "tenant" -) - -// PossibleSharedToValuesValues returns the possible values for the SharedToValues const type. -func PossibleSharedToValuesValues() []SharedToValues { - return []SharedToValues{ - SharedToValuesTenant, - } -} - -// SharingProfileGroupTypes - This property allows you to specify the type of sharing group. Possible values are: Subscriptions, -// AADTenants. -type SharingProfileGroupTypes string - -const ( - SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" - SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" -) - -// PossibleSharingProfileGroupTypesValues returns the possible values for the SharingProfileGroupTypes const type. -func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { - return []SharingProfileGroupTypes{ - SharingProfileGroupTypesAADTenants, - SharingProfileGroupTypesSubscriptions, - } -} - -// SharingState - The sharing state of the gallery, which only appears in the response. -type SharingState string - -const ( - SharingStateFailed SharingState = "Failed" - SharingStateInProgress SharingState = "InProgress" - SharingStateSucceeded SharingState = "Succeeded" - SharingStateUnknown SharingState = "Unknown" -) - -// PossibleSharingStateValues returns the possible values for the SharingState const type. -func PossibleSharingStateValues() []SharingState { - return []SharingState{ - SharingStateFailed, - SharingStateInProgress, - SharingStateSucceeded, - SharingStateUnknown, - } -} - -// SharingUpdateOperationTypes - This property allows you to specify the operation type of gallery sharing update. Possible -// values are: Add, Remove, Reset. -type SharingUpdateOperationTypes string - -const ( - SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add" - SharingUpdateOperationTypesEnableCommunity SharingUpdateOperationTypes = "EnableCommunity" - SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove" - SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset" -) - -// PossibleSharingUpdateOperationTypesValues returns the possible values for the SharingUpdateOperationTypes const type. -func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { - return []SharingUpdateOperationTypes{ - SharingUpdateOperationTypesAdd, - SharingUpdateOperationTypesEnableCommunity, - SharingUpdateOperationTypesRemove, - SharingUpdateOperationTypesReset, - } -} - -// SnapshotStorageAccountTypes - The sku name. -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 the possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{ - SnapshotStorageAccountTypesPremiumLRS, - SnapshotStorageAccountTypesStandardLRS, - SnapshotStorageAccountTypesStandardZRS, - } -} - -// StatusLevelTypes - The level code. -type StatusLevelTypes string - -const ( - StatusLevelTypesError StatusLevelTypes = "Error" - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{ - StatusLevelTypesError, - StatusLevelTypesInfo, - StatusLevelTypesWarning, - } -} - -// StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. -type StorageAccountType string - -const ( - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{ - StorageAccountTypePremiumLRS, - StorageAccountTypeStandardLRS, - StorageAccountTypeStandardZRS, - } -} - -// StorageAccountTypes - Specifies the storage account type for the managed disk. Managed OS disk storage account type can -// only be set when you create the scale set. NOTE: UltraSSDLRS can only be used with data disks. It -// cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD. -// UltraSSDLRS uses Ultra disk. PremiumZRS uses Premium SSD zone redundant -// storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows -// Virtual Machines, refer to -// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types -type StorageAccountTypes string - -const ( - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" - StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns the possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{ - StorageAccountTypesPremiumLRS, - StorageAccountTypesPremiumV2LRS, - StorageAccountTypesPremiumZRS, - StorageAccountTypesStandardLRS, - StorageAccountTypesStandardSSDLRS, - StorageAccountTypesStandardSSDZRS, - StorageAccountTypesUltraSSDLRS, - } -} - -// UefiKeyType - The type of key signature. -type UefiKeyType string - -const ( - UefiKeyTypeSHA256 UefiKeyType = "sha256" - UefiKeyTypeX509 UefiKeyType = "x509" -) - -// PossibleUefiKeyTypeValues returns the possible values for the UefiKeyType const type. -func PossibleUefiKeyTypeValues() []UefiKeyType { - return []UefiKeyType{ - UefiKeyTypeSHA256, - UefiKeyTypeX509, - } -} - -// UefiSignatureTemplateName - The name of the signature template that contains default UEFI keys. -type UefiSignatureTemplateName string - -const ( - UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate UefiSignatureTemplateName = "MicrosoftUefiCertificateAuthorityTemplate" - UefiSignatureTemplateNameMicrosoftWindowsTemplate UefiSignatureTemplateName = "MicrosoftWindowsTemplate" - UefiSignatureTemplateNameNoSignatureTemplate UefiSignatureTemplateName = "NoSignatureTemplate" -) - -// PossibleUefiSignatureTemplateNameValues returns the possible values for the UefiSignatureTemplateName const type. -func PossibleUefiSignatureTemplateNameValues() []UefiSignatureTemplateName { - return []UefiSignatureTemplateName{ - UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate, - UefiSignatureTemplateNameMicrosoftWindowsTemplate, - UefiSignatureTemplateNameNoSignatureTemplate, - } -} - -// UpgradeMode - 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. -type UpgradeMode string - -const ( - UpgradeModeAutomatic UpgradeMode = "Automatic" - UpgradeModeManual UpgradeMode = "Manual" - UpgradeModeRolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{ - UpgradeModeAutomatic, - UpgradeModeManual, - UpgradeModeRolling, - } -} - -// UpgradeOperationInvoker - Invoker of the Upgrade Operation -type UpgradeOperationInvoker string - -const ( - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns the possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{ - UpgradeOperationInvokerPlatform, - UpgradeOperationInvokerUnknown, - UpgradeOperationInvokerUser, - } -} - -// UpgradeState - Code indicating the current status of the upgrade. -type UpgradeState string - -const ( - UpgradeStateCancelled UpgradeState = "Cancelled" - UpgradeStateCompleted UpgradeState = "Completed" - UpgradeStateFaulted UpgradeState = "Faulted" - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns the possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{ - UpgradeStateCancelled, - UpgradeStateCompleted, - UpgradeStateFaulted, - UpgradeStateRollingForward, - } -} - -// VMDiskTypes - VM disk types which are disallowed. -type VMDiskTypes string - -const ( - VMDiskTypesNone VMDiskTypes = "None" - VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" -) - -// PossibleVMDiskTypesValues returns the possible values for the VMDiskTypes const type. -func PossibleVMDiskTypesValues() []VMDiskTypes { - return []VMDiskTypes{ - VMDiskTypesNone, - VMDiskTypesUnmanaged, - } -} - -type VMGuestPatchClassificationLinux string - -const ( - VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" - VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" - VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" -) - -// PossibleVMGuestPatchClassificationLinuxValues returns the possible values for the VMGuestPatchClassificationLinux const type. -func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { - return []VMGuestPatchClassificationLinux{ - VMGuestPatchClassificationLinuxCritical, - VMGuestPatchClassificationLinuxOther, - VMGuestPatchClassificationLinuxSecurity, - } -} - -type VMGuestPatchClassificationWindows string - -const ( - VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" - VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" - VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" - VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" - VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" - VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" - VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" - VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" -) - -// PossibleVMGuestPatchClassificationWindowsValues returns the possible values for the VMGuestPatchClassificationWindows const type. -func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { - return []VMGuestPatchClassificationWindows{ - VMGuestPatchClassificationWindowsCritical, - VMGuestPatchClassificationWindowsDefinition, - VMGuestPatchClassificationWindowsFeaturePack, - VMGuestPatchClassificationWindowsSecurity, - VMGuestPatchClassificationWindowsServicePack, - VMGuestPatchClassificationWindowsTools, - VMGuestPatchClassificationWindowsUpdateRollUp, - VMGuestPatchClassificationWindowsUpdates, - } -} - -// VMGuestPatchRebootBehavior - Describes the reboot requirements of the patch. -type VMGuestPatchRebootBehavior string - -const ( - VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" - VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" - VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" - VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" -) - -// PossibleVMGuestPatchRebootBehaviorValues returns the possible values for the VMGuestPatchRebootBehavior const type. -func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { - return []VMGuestPatchRebootBehavior{ - VMGuestPatchRebootBehaviorAlwaysRequiresReboot, - VMGuestPatchRebootBehaviorCanRequestReboot, - VMGuestPatchRebootBehaviorNeverReboots, - VMGuestPatchRebootBehaviorUnknown, - } -} - -// VMGuestPatchRebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. -type VMGuestPatchRebootSetting string - -const ( - VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" - VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" - VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" -) - -// PossibleVMGuestPatchRebootSettingValues returns the possible values for the VMGuestPatchRebootSetting const type. -func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { - return []VMGuestPatchRebootSetting{ - VMGuestPatchRebootSettingAlways, - VMGuestPatchRebootSettingIfRequired, - VMGuestPatchRebootSettingNever, - } -} - -// VMGuestPatchRebootStatus - The reboot state of the VM following completion of the operation. -type VMGuestPatchRebootStatus string - -const ( - VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" - VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" - VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" - VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" - VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" - VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" -) - -// PossibleVMGuestPatchRebootStatusValues returns the possible values for the VMGuestPatchRebootStatus const type. -func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { - return []VMGuestPatchRebootStatus{ - VMGuestPatchRebootStatusCompleted, - VMGuestPatchRebootStatusFailed, - VMGuestPatchRebootStatusNotNeeded, - VMGuestPatchRebootStatusRequired, - VMGuestPatchRebootStatusStarted, - VMGuestPatchRebootStatusUnknown, - } -} - -// VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS -type VirtualMachineEvictionPolicyTypes string - -const ( - VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns the possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{ - VirtualMachineEvictionPolicyTypesDeallocate, - VirtualMachineEvictionPolicyTypesDelete, - } -} - -// VirtualMachinePriorityTypes - Specifies the priority for a standalone virtual machine or the virtual machines in the scale -// set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot -// VM/VMSS. -type VirtualMachinePriorityTypes string - -const ( - VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" - VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" - VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns the possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{ - VirtualMachinePriorityTypesLow, - VirtualMachinePriorityTypesRegular, - VirtualMachinePriorityTypesSpot, - } -} - -// VirtualMachineScaleSetSKUScaleType - The scale type applicable to the sku. -type VirtualMachineScaleSetSKUScaleType string - -const ( - VirtualMachineScaleSetSKUScaleTypeAutomatic VirtualMachineScaleSetSKUScaleType = "Automatic" - VirtualMachineScaleSetSKUScaleTypeNone VirtualMachineScaleSetSKUScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSKUScaleTypeValues returns the possible values for the VirtualMachineScaleSetSKUScaleType const type. -func PossibleVirtualMachineScaleSetSKUScaleTypeValues() []VirtualMachineScaleSetSKUScaleType { - return []VirtualMachineScaleSetSKUScaleType{ - VirtualMachineScaleSetSKUScaleTypeAutomatic, - VirtualMachineScaleSetSKUScaleTypeNone, - } -} - -type VirtualMachineScaleSetScaleInRules string - -const ( - VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default" - VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns the possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{ - VirtualMachineScaleSetScaleInRulesDefault, - VirtualMachineScaleSetScaleInRulesNewestVM, - VirtualMachineScaleSetScaleInRulesOldestVM, - } -} - -// VirtualMachineSizeTypes - Specifies the size of the virtual machine. The enum data type is currently deprecated and will -// be removed by December 23rd 2023. The recommended way to get the list of available sizes is using 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/resourceskus/list], List all available virtual machine sizes for resizing -// [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine -// sizes, see Sizes for virtual machines -// [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set. -type VirtualMachineSizeTypes string - -const ( - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - VirtualMachineSizeTypesStandardA2MV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - VirtualMachineSizeTypesStandardA4MV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - VirtualMachineSizeTypesStandardA8MV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - VirtualMachineSizeTypesStandardB1Ms VirtualMachineSizeTypes = "Standard_B1ms" - VirtualMachineSizeTypesStandardB1S VirtualMachineSizeTypes = "Standard_B1s" - VirtualMachineSizeTypesStandardB2Ms VirtualMachineSizeTypes = "Standard_B2ms" - VirtualMachineSizeTypesStandardB2S VirtualMachineSizeTypes = "Standard_B2s" - VirtualMachineSizeTypesStandardB4Ms VirtualMachineSizeTypes = "Standard_B4ms" - VirtualMachineSizeTypesStandardB8Ms VirtualMachineSizeTypes = "Standard_B8ms" - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - VirtualMachineSizeTypesStandardD16SV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - VirtualMachineSizeTypesStandardD2SV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - VirtualMachineSizeTypesStandardD32SV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - VirtualMachineSizeTypesStandardD4SV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - VirtualMachineSizeTypesStandardD64SV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - VirtualMachineSizeTypesStandardD8SV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - VirtualMachineSizeTypesStandardE16SV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - VirtualMachineSizeTypesStandardE2SV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - VirtualMachineSizeTypesStandardE328SV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - VirtualMachineSizeTypesStandardE32SV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - VirtualMachineSizeTypesStandardE4SV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - VirtualMachineSizeTypesStandardE6416SV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - VirtualMachineSizeTypesStandardE6432SV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - VirtualMachineSizeTypesStandardE64SV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - VirtualMachineSizeTypesStandardE8SV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s" - VirtualMachineSizeTypesStandardF16SV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s" - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s" - VirtualMachineSizeTypesStandardF2SV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - VirtualMachineSizeTypesStandardF32SV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s" - VirtualMachineSizeTypesStandardF4SV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - VirtualMachineSizeTypesStandardF64SV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - VirtualMachineSizeTypesStandardF72SV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s" - VirtualMachineSizeTypesStandardF8SV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - VirtualMachineSizeTypesStandardH16M VirtualMachineSizeTypes = "Standard_H16m" - VirtualMachineSizeTypesStandardH16Mr VirtualMachineSizeTypes = "Standard_H16mr" - VirtualMachineSizeTypesStandardH16R VirtualMachineSizeTypes = "Standard_H16r" - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - VirtualMachineSizeTypesStandardH8M VirtualMachineSizeTypes = "Standard_H8m" - VirtualMachineSizeTypesStandardL16S VirtualMachineSizeTypes = "Standard_L16s" - VirtualMachineSizeTypesStandardL32S VirtualMachineSizeTypes = "Standard_L32s" - VirtualMachineSizeTypesStandardL4S VirtualMachineSizeTypes = "Standard_L4s" - VirtualMachineSizeTypesStandardL8S VirtualMachineSizeTypes = "Standard_L8s" - VirtualMachineSizeTypesStandardM12832Ms VirtualMachineSizeTypes = "Standard_M128-32ms" - VirtualMachineSizeTypesStandardM12864Ms VirtualMachineSizeTypes = "Standard_M128-64ms" - VirtualMachineSizeTypesStandardM128Ms VirtualMachineSizeTypes = "Standard_M128ms" - VirtualMachineSizeTypesStandardM128S VirtualMachineSizeTypes = "Standard_M128s" - VirtualMachineSizeTypesStandardM6416Ms VirtualMachineSizeTypes = "Standard_M64-16ms" - VirtualMachineSizeTypesStandardM6432Ms VirtualMachineSizeTypes = "Standard_M64-32ms" - VirtualMachineSizeTypesStandardM64Ms VirtualMachineSizeTypes = "Standard_M64ms" - VirtualMachineSizeTypesStandardM64S VirtualMachineSizeTypes = "Standard_M64s" - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - VirtualMachineSizeTypesStandardNC12SV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - VirtualMachineSizeTypesStandardNC12SV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - VirtualMachineSizeTypesStandardNC24R VirtualMachineSizeTypes = "Standard_NC24r" - VirtualMachineSizeTypesStandardNC24RsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - VirtualMachineSizeTypesStandardNC24RsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - VirtualMachineSizeTypesStandardNC24SV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - VirtualMachineSizeTypesStandardNC24SV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - VirtualMachineSizeTypesStandardNC6SV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - VirtualMachineSizeTypesStandardNC6SV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - VirtualMachineSizeTypesStandardND12S VirtualMachineSizeTypes = "Standard_ND12s" - VirtualMachineSizeTypesStandardND24Rs VirtualMachineSizeTypes = "Standard_ND24rs" - VirtualMachineSizeTypesStandardND24S VirtualMachineSizeTypes = "Standard_ND24s" - VirtualMachineSizeTypesStandardND6S VirtualMachineSizeTypes = "Standard_ND6s" - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns the 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, - } -} - -// WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type WindowsPatchAssessmentMode string - -const ( - WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" - WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" -) - -// PossibleWindowsPatchAssessmentModeValues returns the possible values for the WindowsPatchAssessmentMode const type. -func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { - return []WindowsPatchAssessmentMode{ - WindowsPatchAssessmentModeAutomaticByPlatform, - WindowsPatchAssessmentModeImageDefault, - } -} - -// WindowsVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting { - return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{ - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// WindowsVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the -// VM. In this mode, automatic updates are disabled; the property -// WindowsConfiguration.enableAutomaticUpdates must be false -// AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates -// must be true. -// AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and -// WindowsConfiguration.enableAutomaticUpdates must be true -type WindowsVMGuestPatchMode string - -const ( - WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" - WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" - WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" -) - -// PossibleWindowsVMGuestPatchModeValues returns the possible values for the WindowsVMGuestPatchMode const type. -func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { - return []WindowsVMGuestPatchMode{ - WindowsVMGuestPatchModeAutomaticByOS, - WindowsVMGuestPatchModeAutomaticByPlatform, - WindowsVMGuestPatchModeManual, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go deleted file mode 100644 index ae2c4f36671e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go +++ /dev/null @@ -1,423 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostGroupsClient contains the methods for the DedicatedHostGroups group. -// Don't use this type directly, use NewDedicatedHostGroupsClient() instead. -type DedicatedHostGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DedicatedHostGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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] -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - parameters - Parameters supplied to the Create Dedicated Host Group. -// - options - DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DedicatedHostGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - result := DedicatedHostGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete -// method. -func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (DedicatedHostGroupsClientDeleteResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientDeleteResponse{}, err - } - return DedicatedHostGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (DedicatedHostGroupsClientGetResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostGroupsClient) getHandleResponse(resp *http.Response) (DedicatedHostGroupsClientGetResponse, error) { - result := DedicatedHostGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - 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. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager -// method. -func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListByResourceGroupResponse]{ - More: func(page DedicatedHostGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListByResourceGroupResponse) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DedicatedHostGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DedicatedHostGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - result := DedicatedHostGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - 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. -// -// Generated from API version 2024-03-01 -// - options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager -// method. -func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListBySubscriptionResponse]{ - More: func(page DedicatedHostGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListBySubscriptionResponse) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *DedicatedHostGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *DedicatedHostGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *DedicatedHostGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - result := DedicatedHostGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update -// method. -func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (DedicatedHostGroupsClientUpdateResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *DedicatedHostGroupsClient) updateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientUpdateResponse, error) { - result := DedicatedHostGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go deleted file mode 100644 index 66ae1f99bf0e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go +++ /dev/null @@ -1,680 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostsClient contains the methods for the DedicatedHosts group. -// Don't use this type directly, use NewDedicatedHostsClient() instead. -type DedicatedHostsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DedicatedHostsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete -// method. -func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (DedicatedHostsClientGetResponse, error) { - var err error - const operationName = "DedicatedHostsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostsClient) getHandleResponse(resp *http.Response) (DedicatedHostsClientGetResponse, error) { - result := DedicatedHostsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHost); err != nil { - return DedicatedHostsClientGetResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available dedicated host sizes to which the specified dedicated host can be resized. -// NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager -// method. -func (client *DedicatedHostsClient) NewListAvailableSizesPager(resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListAvailableSizesResponse]{ - More: func(page DedicatedHostsClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DedicatedHostsClientListAvailableSizesResponse) (DedicatedHostsClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *DedicatedHostsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *DedicatedHostsClient) listAvailableSizesHandleResponse(resp *http.Response) (DedicatedHostsClientListAvailableSizesResponse, error) { - result := DedicatedHostsClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostSizeListResult); err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListByHostGroupPager - 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. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager -// method. -func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListByHostGroupResponse]{ - More: func(page DedicatedHostsClientListByHostGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostsClientListByHostGroupResponse) (DedicatedHostsClientListByHostGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListByHostGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByHostGroupCreateRequest(ctx, resourceGroupName, hostGroupName, options) - }, nil) - if err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - return client.listByHostGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByHostGroupCreateRequest creates the ListByHostGroup request. -func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByHostGroupHandleResponse handles the ListByHostGroup response. -func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Response) (DedicatedHostsClientListByHostGroupResponse, error) { - result := DedicatedHostsClientListByHostGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostListResult); err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - return result, nil -} - -// BeginRedeploy - Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated -// to a new node and is running. To determine the health of VMs deployed on the dedicated host -// after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy -// method. -func (client *DedicatedHostsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to -// a new node and is running. To determine the health of VMs deployed on the dedicated host -// after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) redeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *DedicatedHostsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted -// and is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart -// method. -func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*runtime.Poller[DedicatedHostsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and -// is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate -// method. -func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go deleted file mode 100644 index 0bea05f3e375..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go +++ /dev/null @@ -1,846 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskAccessesClient contains the methods for the DiskAccesses group. -// Don't use this type directly, use NewDiskAccessesClient() instead. -type DiskAccessesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskAccessesClient creates a new instance of DiskAccessesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskAccessesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskAccessesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskAccessesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - diskAccess - disk access object supplied in the body of the Put disk access operation. -// - options - DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskAccessesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskAccess); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - options - DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete -// method. -func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*runtime.Poller[DiskAccessesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) deleteOperation(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskAccessesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - options - DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) deleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginDeleteAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteAPrivateEndpointConnectionCreateRequest creates the DeleteAPrivateEndpointConnection request. -func (client *DiskAccessesClient) deleteAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - options - DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (DiskAccessesClientGetResponse, error) { - var err error - const operationName = "DiskAccessesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskAccessesClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskAccessesClient) getHandleResponse(resp *http.Response) (DiskAccessesClientGetResponse, error) { - result := DiskAccessesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccess); err != nil { - return DiskAccessesClientGetResponse{}, err - } - return result, nil -} - -// GetAPrivateEndpointConnection - Gets information about a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - options - DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - var err error - const operationName = "DiskAccessesClient.GetAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - resp, err := client.getAPrivateEndpointConnectionHandleResponse(httpResp) - return resp, err -} - -// getAPrivateEndpointConnectionCreateRequest creates the GetAPrivateEndpointConnection request. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getAPrivateEndpointConnectionHandleResponse handles the GetAPrivateEndpointConnection response. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionHandleResponse(resp *http.Response) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - result := DiskAccessesClientGetAPrivateEndpointConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - return result, nil -} - -// GetPrivateLinkResources - Gets the private link resources possible under disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - options - DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - var err error - const operationName = "DiskAccessesClient.GetPrivateLinkResources" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - resp, err := client.getPrivateLinkResourcesHandleResponse(httpResp) - return resp, err -} - -// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. -func (client *DiskAccessesClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. -func (client *DiskAccessesClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - result := DiskAccessesClientGetPrivateLinkResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk access resources under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. -func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListResponse]{ - More: func(page DiskAccessesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListResponse) (DiskAccessesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DiskAccessesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DiskAccessesClient) listCreateRequest(ctx context.Context, options *DiskAccessesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskAccessesClient) listHandleResponse(resp *http.Response) (DiskAccessesClientListResponse, error) { - result := DiskAccessesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk access resources under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager -// method. -func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListByResourceGroupResponse]{ - More: func(page DiskAccessesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListByResourceGroupResponse) (DiskAccessesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskAccessesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskAccessesClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskAccessesClientListByResourceGroupResponse, error) { - result := DiskAccessesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListPrivateEndpointConnectionsPager - List information about private endpoint connections under a disk access resource -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - options - DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager -// method. -func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListPrivateEndpointConnectionsResponse]{ - More: func(page DiskAccessesClientListPrivateEndpointConnectionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListPrivateEndpointConnectionsResponse) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPrivateEndpointConnectionsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, diskAccessName, options) - }, nil) - if err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - return client.listPrivateEndpointConnectionsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - result := DiskAccessesClientListPrivateEndpointConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - diskAccess - disk access object supplied in the body of the Patch disk access operation. -// - options - DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate -// method. -func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*runtime.Poller[DiskAccessesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskAccessesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskAccess); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this -// can't be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource 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. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - privateEndpointConnection - private endpoint connection object supplied in the body of the Put private endpoint connection -// operation. -// - options - DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this can't -// be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) updateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginUpdateAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateAPrivateEndpointConnectionCreateRequest creates the UpdateAPrivateEndpointConnection request. -func (client *DiskAccessesClient) updateAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go deleted file mode 100644 index 59d34d1e2d97..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go +++ /dev/null @@ -1,535 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskEncryptionSetsClient contains the methods for the DiskEncryptionSets group. -// Don't use this type directly, use NewDiskEncryptionSetsClient() instead. -type DiskEncryptionSetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskEncryptionSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskEncryptionSetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskEncryptionSetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskEncryptionSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskEncryptionSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (DiskEncryptionSetsClientGetResponse, error) { - var err error - const operationName = "DiskEncryptionSetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskEncryptionSetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskEncryptionSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskEncryptionSetsClient) getHandleResponse(resp *http.Response) (DiskEncryptionSetsClientGetResponse, error) { - result := DiskEncryptionSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSet); err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk encryption sets under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager -// method. -func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListResponse]{ - More: func(page DiskEncryptionSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListResponse) (DiskEncryptionSetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DiskEncryptionSetsClient) listCreateRequest(ctx context.Context, options *DiskEncryptionSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskEncryptionSetsClient) listHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListResponse, error) { - result := DiskEncryptionSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAssociatedResourcesPager - Lists all resources that are encrypted with this disk encryption set. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager -// method. -func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListAssociatedResourcesResponse]{ - More: func(page DiskEncryptionSetsClientListAssociatedResourcesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListAssociatedResourcesResponse) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListAssociatedResourcesPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAssociatedResourcesCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - return client.listAssociatedResourcesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAssociatedResourcesCreateRequest creates the ListAssociatedResources request. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAssociatedResourcesHandleResponse handles the ListAssociatedResources response. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - result := DiskEncryptionSetsClientListAssociatedResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceURIList); err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk encryption sets under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager -// method. -func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListByResourceGroupResponse]{ - More: func(page DiskEncryptionSetsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListByResourceGroupResponse) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskEncryptionSetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskEncryptionSetsClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - result := DiskEncryptionSetsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskEncryptionSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go deleted file mode 100644 index 43307ca04936..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go +++ /dev/null @@ -1,367 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskRestorePointClient contains the methods for the DiskRestorePoint group. -// Don't use this type directly, use NewDiskRestorePointClient() instead. -type DiskRestorePointClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskRestorePointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskRestorePointClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskRestorePointClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get disk restorePoint resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - options - DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (DiskRestorePointClientGetResponse, error) { - var err error - const operationName = "DiskRestorePointClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskRestorePointClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskRestorePointClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskRestorePointClient) getHandleResponse(resp *http.Response) (DiskRestorePointClientGetResponse, error) { - result := DiskRestorePointClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePoint); err != nil { - return DiskRestorePointClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - grantAccessData - Access data object supplied in the body of the get disk access operation. -// - options - DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskRestorePointClient) grantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "DiskRestorePointClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DiskRestorePointClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListByRestorePointPager - Lists diskRestorePoints under a vmRestorePoint. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - options - DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager -// method. -func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskRestorePointClientListByRestorePointResponse]{ - More: func(page DiskRestorePointClientListByRestorePointResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskRestorePointClientListByRestorePointResponse) (DiskRestorePointClientListByRestorePointResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskRestorePointClient.NewListByRestorePointPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByRestorePointCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, options) - }, nil) - if err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - return client.listByRestorePointHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByRestorePointCreateRequest creates the ListByRestorePoint request. -func (client *DiskRestorePointClient) listByRestorePointCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRestorePointHandleResponse handles the ListByRestorePoint response. -func (client *DiskRestorePointClient) listByRestorePointHandleResponse(resp *http.Response) (DiskRestorePointClientListByRestorePointResponse, error) { - result := DiskRestorePointClientListByRestorePointResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePointList); err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - options - DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskRestorePointClient) revokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "DiskRestorePointClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DiskRestorePointClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go deleted file mode 100644 index a0ffa752bc99..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go +++ /dev/null @@ -1,623 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DisksClient contains the methods for the Disks group. -// Don't use this type directly, use NewDisksClient() instead. -type DisksClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDisksClient creates a new instance of DisksClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisksClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DisksClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate -// method. -func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, disk); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) deleteOperation(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (DisksClientGetResponse, error) { - var err error - const operationName = "DisksClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return DisksClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DisksClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DisksClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DisksClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DisksClient) getHandleResponse(resp *http.Response) (DisksClientGetResponse, error) { - result := DisksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Disk); err != nil { - return DisksClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*runtime.Poller[DisksClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) grantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DisksClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListPager - Lists all the disks under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. -func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListResponse]{ - More: func(page DisksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListResponse) (DisksClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DisksClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DisksClient) listCreateRequest(ctx context.Context, options *DisksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DisksClient) listHandleResponse(resp *http.Response) (DisksClientListResponse, error) { - result := DisksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disks under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager -// method. -func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListByResourceGroupResponse]{ - More: func(page DisksClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListByResourceGroupResponse) (DisksClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DisksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DisksClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DisksClient) listByResourceGroupHandleResponse(resp *http.Response) (DisksClientListByResourceGroupResponse, error) { - result := DisksClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*runtime.Poller[DisksClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) revokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DisksClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*runtime.Poller[DisksClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DisksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, disk); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go deleted file mode 100644 index f24e730a63f5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go +++ /dev/null @@ -1,465 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleriesClient contains the methods for the Galleries group. -// Don't use this type directly, use NewGalleriesClient() instead. -type GalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleriesClient creates a new instance of GalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gallery); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery to be deleted. -// - options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*runtime.Poller[GalleriesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. -// - options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (GalleriesClientGetResponse, error) { - var err error - const operationName = "GalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return GalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", string(*options.Select)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleriesClient) getHandleResponse(resp *http.Response) (GalleriesClientGetResponse, error) { - result := GalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Gallery); err != nil { - return GalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List galleries under a subscription. -// -// Generated from API version 2023-07-03 -// - options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. -func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{ - More: func(page GalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListResponse) (GalleriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return GalleriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *GalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GalleriesClient) listHandleResponse(resp *http.Response) (GalleriesClientListResponse, error) { - result := GalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List galleries under a resource group. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager -// method. -func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListByResourceGroupResponse]{ - More: func(page GalleriesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListByResourceGroupResponse) (GalleriesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *GalleriesClient) listByResourceGroupHandleResponse(resp *http.Response) (GalleriesClientListByResourceGroupResponse, error) { - result := GalleriesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*runtime.Poller[GalleriesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gallery); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go deleted file mode 100644 index cd5d6f3ecfe6..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go +++ /dev/null @@ -1,434 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationsClient contains the methods for the GalleryApplications group. -// Don't use this type directly, use NewGalleryApplicationsClient() instead. -type GalleryApplicationsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (GalleryApplicationsClientGetResponse, error) { - var err error - const operationName = "GalleryApplicationsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryApplicationsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) (GalleryApplicationsClientGetResponse, error) { - result := GalleryApplicationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplication); err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery Application Definitions in a gallery. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed. -// - options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager -// method. -func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationsClientListByGalleryResponse]{ - More: func(page GalleryApplicationsClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationsClientListByGalleryResponse) (GalleryApplicationsClientListByGalleryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationsClient.NewListByGalleryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - }, nil) - if err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - return client.listByGalleryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryApplicationsClient) listByGalleryHandleResponse(resp *http.Response) (GalleryApplicationsClientListByGalleryResponse, error) { - result := GalleryApplicationsClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationList); err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go deleted file mode 100644 index 06571af3d467..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go +++ /dev/null @@ -1,464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationVersionsClient contains the methods for the GalleryApplicationVersions group. -// Don't use this type directly, use NewGalleryApplicationVersionsClient() instead. -type GalleryApplicationVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (GalleryApplicationVersionsClientGetResponse, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryApplicationVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientGetResponse, error) { - result := GalleryApplicationVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersion); err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager -// method. -func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationVersionsClientListByGalleryApplicationResponse]{ - More: func(page GalleryApplicationVersionsClientListByGalleryApplicationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationVersionsClientListByGalleryApplicationResponse) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationVersionsClient.NewListByGalleryApplicationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryApplicationCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - }, nil) - if err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - return client.listByGalleryApplicationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryApplicationCreateRequest creates the ListByGalleryApplication request. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryApplicationHandleResponse handles the ListByGalleryApplication response. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - result := GalleryApplicationVersionsClientListByGalleryApplicationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersionList); err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go deleted file mode 100644 index 8be1a5784a01..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go +++ /dev/null @@ -1,433 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImagesClient contains the methods for the GalleryImages group. -// Don't use this type directly, use NewGalleryImagesClient() instead. -type GalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryImagesClient creates a new instance of GalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete -// method. -func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*runtime.Poller[GalleryImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error) { - var err error - const operationName = "GalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (GalleryImagesClientGetResponse, error) { - result := GalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImage); err != nil { - return GalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery image definitions in a gallery. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed. -// - options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager -// method. -func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImagesClientListByGalleryResponse]{ - More: func(page GalleryImagesClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImagesClientListByGalleryResponse) (GalleryImagesClientListByGalleryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImagesClient.NewListByGalleryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - }, nil) - if err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - return client.listByGalleryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryImagesClientListByGalleryResponse, error) { - result := GalleryImagesClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageList); err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate -// method. -func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*runtime.Poller[GalleryImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go deleted file mode 100644 index b16e42ed74a0..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go +++ /dev/null @@ -1,463 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImageVersionsClient contains the methods for the GalleryImageVersions group. -// Don't use this type directly, use NewGalleryImageVersionsClient() instead. -type GalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get -// method. -func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (GalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "GalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) (GalleryImageVersionsClientGetResponse, error) { - result := GalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersion); err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryImagePager - List gallery image versions in a gallery image definition. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager -// method. -func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImageVersionsClientListByGalleryImageResponse]{ - More: func(page GalleryImageVersionsClientListByGalleryImageResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImageVersionsClientListByGalleryImageResponse) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImageVersionsClient.NewListByGalleryImagePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryImageCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - }, nil) - if err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - return client.listByGalleryImageHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryImageCreateRequest creates the ListByGalleryImage request. -func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryImageHandleResponse handles the ListByGalleryImage response. -func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp *http.Response) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - result := GalleryImageVersionsClientListByGalleryImageResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersionList); err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - 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. -// - options - GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go deleted file mode 100644 index 0ccc5ce9fd60..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GallerySharingProfileClient contains the methods for the GallerySharingProfile group. -// Don't use this type directly, use NewGallerySharingProfileClient() instead. -type GallerySharingProfileClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGallerySharingProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GallerySharingProfileClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GallerySharingProfileClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginUpdate - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. -// - sharingUpdate - Parameters supplied to the update gallery sharing profile. -// - options - GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*runtime.Poller[GallerySharingProfileClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GallerySharingProfileClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GallerySharingProfileClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GallerySharingProfileClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, sharingUpdate); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go deleted file mode 100644 index 5fecdbf1d7c3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ImagesClient contains the methods for the Images group. -// Don't use this type directly, use NewImagesClient() instead. -type ImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewImagesClient creates a new instance of ImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - parameters - Parameters supplied to the Create Image operation. -// - options - ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate -// method. -func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*runtime.Poller[ImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (ImagesClientGetResponse, error) { - var err error - const operationName = "ImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return ImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ImagesClient) getHandleResponse(resp *http.Response) (ImagesClientGetResponse, error) { - result := ImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Image); err != nil { - return ImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - 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. -// -// Generated from API version 2024-03-01 -// - options - ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. -func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListResponse]{ - More: func(page ImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListResponse) (ImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return ImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ImagesClient) listCreateRequest(ctx context.Context, options *ImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ImagesClient) listHandleResponse(resp *http.Response) (ImagesClientListResponse, error) { - result := ImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets the list of images under a resource group. Use nextLink property in the response to -// get the next page of Images. Do this till nextLink is null to fetch all the Images. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager -// method. -func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListByResourceGroupResponse]{ - More: func(page ImagesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListByResourceGroupResponse) (ImagesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ImagesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ImagesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ImagesClient) listByResourceGroupHandleResponse(resp *http.Response) (ImagesClientListByResourceGroupResponse, error) { - result := ImagesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - parameters - Parameters supplied to the Update Image operation. -// - options - ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*runtime.Poller[ImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *ImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go deleted file mode 100644 index a3b77f828379..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LogAnalyticsClient contains the methods for the LogAnalytics group. -// Don't use this type directly, use NewLogAnalyticsClient() instead. -type LogAnalyticsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogAnalyticsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LogAnalyticsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window -// to show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// - options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportRequestRateByInterval(ctx, location, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *LogAnalyticsClient) exportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*http.Response, error) { - var err error - const operationName = "LogAnalyticsClient.BeginExportRequestRateByInterval" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.exportRequestRateByIntervalCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// exportRequestRateByIntervalCreateRequest creates the ExportRequestRateByInterval request. -func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time -// window. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api. -// - options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportThrottledRequests(ctx, location, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportThrottledRequestsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportThrottledRequestsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *LogAnalyticsClient) exportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*http.Response, error) { - var err error - const operationName = "LogAnalyticsClient.BeginExportThrottledRequests" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.exportThrottledRequestsCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// exportThrottledRequestsCreateRequest creates the ExportThrottledRequests request. -func (client *LogAnalyticsClient) exportThrottledRequestsCreateRequest(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go deleted file mode 100644 index 1fad0acd2a7e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go +++ /dev/null @@ -1,8643 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "time" - -// APIEntityReference - The API entity reference. -type APIEntityReference struct { - // The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/… - ID *string -} - -// APIError - Api error. -type APIError struct { - // The error code. - Code *string - - // The Api error details - Details []*APIErrorBase - - // The Api inner error - Innererror *InnerError - - // The error message. - Message *string - - // The target of the particular error. - Target *string -} - -// APIErrorBase - Api error base. -type APIErrorBase struct { - // The error code. - Code *string - - // The error message. - Message *string - - // The target of the particular error. - Target *string -} - -// AccessURI - A disk access SAS uri. -type AccessURI struct { - // READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string - - // READ-ONLY; A SAS uri for accessing a VM guest state. - SecurityDataAccessSAS *string -} - -// AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set. -type AdditionalCapabilities struct { - // The flag that enables or disables hibernation capability on the VM. - HibernationEnabled *bool - - // The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account - // type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can - // be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool -} - -// 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 { - // The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - ComponentName *string - - // 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 - - // The pass name. Currently, the only allowable value is OobeSystem. - PassName *string - - // Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. - SettingName *SettingNames -} - -// AlternativeOption - Describes the alternative option specified by the Publisher for this image when this image is deprecated. -type AlternativeOption struct { - // Describes the type of the alternative option. - Type *AlternativeType - - // Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the - // Plan name when the type is Plan. - Value *string -} - -// ApplicationProfile - Contains the list of gallery applications that should be made available to the VM/VMSS -type ApplicationProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - GalleryApplications []*VMGalleryApplication -} - -// AttachDetachDataDisksRequest - Specifies the input for attaching and detaching a list of managed data disks. -type AttachDetachDataDisksRequest struct { - // The list of managed data disks to be attached. - DataDisksToAttach []*DataDisksToAttach - - // The list of managed data disks to be detached. - DataDisksToDetach []*DataDisksToDetach -} - -// AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool - - // 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 - - // Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM - // basis that an OS upgrade from rolling upgrades is incoming, via the IMDS - // tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call. - OSRollingUpgradeDeferral *bool - - // Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade - // will fallback to the default policy if no policy is defined on the VMSS. - UseRollingUpgradePolicy *bool -} - -// AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // REQUIRED; Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool -} - -// AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set. -type AutomaticRepairsPolicy struct { - // Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool - - // 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 10 minutes (PT10M), which - // is also the default value. The maximum allowed grace period is 90 minutes - // (PT90M). - GracePeriod *string - - // Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale - // set. Default value is replace. - RepairAction *RepairAction -} - -// 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. -// For more information on Azure -// planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. -// Currently, a VM can only be added to an -// availability set at creation time. An existing VM cannot be added to an availability set. -type AvailabilitySet struct { - // REQUIRED; Resource location - Location *string - - // The instance view of a resource. - Properties *AvailabilitySetProperties - - // 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 - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// AvailabilitySetListResult - The List Availability Set operation response. -type AvailabilitySetListResult struct { - // REQUIRED; The list of availability sets - Value []*AvailabilitySet - - // The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string -} - -// AvailabilitySetProperties - The instance view of a resource. -type AvailabilitySetProperties struct { - // Fault Domain count. - PlatformFaultDomainCount *int32 - - // Update Domain count. - PlatformUpdateDomainCount *int32 - - // Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: - // 2018-04-01. - ProximityPlacementGroup *SubResource - - // A list of references to all virtual machines in the availability set. - VirtualMachines []*SubResource - - // READ-ONLY; The resource status information. - Statuses []*InstanceViewStatus -} - -// AvailabilitySetUpdate - Specifies information about the availability set that the virtual machine should be assigned to. -// Only tags may be updated. -type AvailabilitySetUpdate struct { - // The instance view of a resource. - Properties *AvailabilitySetProperties - - // Sku of the availability set - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary. -type AvailablePatchSummary struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// BillingProfile - Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. -type BillingProfile struct { - // 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 -} - -// 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 { - // Whether boot diagnostics should be enabled on the Virtual Machine. - Enabled *bool - - // Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling - // boot diagnostics, managed storage will be used. - StorageURI *string -} - -// BootDiagnosticsInstanceView - The instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // READ-ONLY; The console screenshot blob URI. Note: This will not be set if boot diagnostics is currently enabled with managed - // storage. - ConsoleScreenshotBlobURI *string - - // READ-ONLY; The serial console log blob Uri. Note: This will not be set if boot diagnostics is currently enabled with managed - // storage. - SerialConsoleLogBlobURI *string - - // 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 -} - -// CapacityReservation - Specifies information about the capacity reservation. -type CapacityReservation struct { - // REQUIRED; Resource location - Location *string - - // REQUIRED; SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently - // VM Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU - - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties - - // Resource tags - Tags map[string]*string - - // Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the - // list of zones specified during the capacity reservation group creation. The zone - // can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, - // enforces VM/VMSS using this capacity reservation to be in same zone. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CapacityReservationGroup - Specifies information about the capacity reservation group that the capacity reservations should -// be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at -// creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. -type CapacityReservationGroup struct { - // REQUIRED; Resource location - Location *string - - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties - - // Resource tags - Tags map[string]*string - - // Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, - // the group supports only regional resources in the region. If provided, - // enforces each capacity reservation in the group to be in one of the zones. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -type CapacityReservationGroupInstanceView struct { - // READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. - CapacityReservations []*CapacityReservationInstanceViewWithName - - // READ-ONLY; List of the subscriptions that the capacity reservation group is shared with. Note: Minimum api-version: 2024-03-01. - // Please refer to https://aka.ms/computereservationsharing for more details. - SharedSubscriptionIDs []*SubResourceReadOnly -} - -// CapacityReservationGroupListResult - The List capacity reservation group with resource group response. -type CapacityReservationGroupListResult struct { - // REQUIRED; The list of capacity reservation groups - Value []*CapacityReservationGroup - - // The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of - // capacity reservation groups. - NextLink *string -} - -// CapacityReservationGroupProperties - capacity reservation group Properties. -type CapacityReservationGroupProperties struct { - // Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in - // mind the capacity reservation group resource generally can be shared across - // subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between - // the AAD tenants. Note: Minimum api-version: 2024-03-01. Please refer to - // https://aka.ms/computereservationsharing for more details. - SharingProfile *ResourceSharingProfile - - // READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. - CapacityReservations []*SubResourceReadOnly - - // READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations - // that belong to the capacity reservation group. - InstanceView *CapacityReservationGroupInstanceView - - // READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. - VirtualMachinesAssociated []*SubResourceReadOnly -} - -// CapacityReservationGroupUpdate - Specifies information about the capacity reservation group. Only tags can be updated. -type CapacityReservationGroupUpdate struct { - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties - - // Resource tags - Tags map[string]*string -} - -// CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime -// properties of the capacity reservation that is managed by the platform and can change outside of control plane -// operations. -type CapacityReservationInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization -} - -// CapacityReservationInstanceViewWithName - The instance view of a capacity reservation that includes the name of the capacity -// reservation. It is used for the response to the instance view of a capacity reservation group. -type CapacityReservationInstanceViewWithName struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization - - // READ-ONLY; The name of the capacity reservation. - Name *string -} - -// CapacityReservationListResult - The list capacity reservation operation response. -type CapacityReservationListResult struct { - // REQUIRED; The list of capacity reservations - Value []*CapacityReservation - - // The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity - // reservations. - NextLink *string -} - -// CapacityReservationProfile - The parameters of a capacity reservation Profile. -type CapacityReservationProfile struct { - // Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset - // vm instances provided enough capacity has been reserved. Please refer to - // https://aka.ms/CapacityReservation for more details. - CapacityReservationGroup *SubResource -} - -// CapacityReservationProperties - Properties of the Capacity reservation. -type CapacityReservationProperties struct { - // READ-ONLY; The Capacity reservation instance view. - InstanceView *CapacityReservationInstanceView - - // READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The - // fault domain count specified for a resource (like virtual machines scale set) must be less - // than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. - PlatformFaultDomainCount *int32 - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The date time when the capacity reservation was last updated. - ProvisioningTime *time.Time - - // READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout - // the lifetime of the resource. - ReservationID *string - - // READ-ONLY; Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. - VirtualMachinesAssociated []*SubResourceReadOnly -} - -// CapacityReservationUpdate - Specifies information about the capacity reservation. Only tags and sku.capacity can be updated. -type CapacityReservationUpdate struct { - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties - - // SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM - // Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// CapacityReservationUtilization - Represents the capacity reservation utilization in terms of resources allocated. -type CapacityReservationUtilization struct { - // READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer - // is getting billed. Minimum api-version: 2022-08-01. - CurrentCapacity *int32 - - // READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. - VirtualMachinesAllocated []*SubResourceReadOnly -} - -// CloudService - Describes the cloud service. -type CloudService struct { - // REQUIRED; Resource location. - Location *string - - // Cloud service properties - Properties *CloudServiceProperties - - // The system meta data relating to this resource. - SystemData *SystemData - - // Resource tags. - Tags map[string]*string - - // List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. - // This field is optional. - Zones []*string - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// CloudServiceExtensionProfile - Describes a cloud service extension profile. -type CloudServiceExtensionProfile struct { - // List of extensions for the cloud service. - Extensions []*Extension -} - -// CloudServiceExtensionProperties - Extension Properties. -type CloudServiceExtensionProperties struct { - // Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become - // available. - AutoUpgradeMinorVersion *bool - - // Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension - // without changing any of the public or protected settings. If forceUpdateTag is - // not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor - // any of public or protected settings change, extension would flow to the role - // instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not - ForceUpdateTag *string - - // Protected settings for the extension which are encrypted before sent to the role instance. - ProtectedSettings any - - // Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. - ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference - - // The name of the extension handler publisher. - Publisher *string - - // Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied - // to all roles in the cloud service. - RolesAppliedTo []*string - - // Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension - // (like RDP), this is the XML setting for the extension. - Settings any - - // Specifies the type of the extension. - Type *string - - // Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an - // asterisk (*) is used as the value, the latest version of the extension is used. - // If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor - // version of the specified major version is selected. If a major version number - // and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, - // an auto-upgrade is performed on the role instance. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// CloudServiceInstanceView - InstanceView of CloudService as a whole -type CloudServiceInstanceView struct { - // Instance view statuses. - RoleInstance *InstanceViewStatusesSummary - - // READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateIDs []*string - - // READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. - SdkVersion *string - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus -} - -// CloudServiceListResult - The list operation result. -type CloudServiceListResult struct { - // REQUIRED; The list of resources. - Value []*CloudService - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// CloudServiceNetworkProfile - Network Profile for the cloud service. -type CloudServiceNetworkProfile struct { - // List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a - // Public Load Balancer and an Internal Load Balancer. - LoadBalancerConfigurations []*LoadBalancerConfiguration - - // Slot type for the cloud service. Possible values are - // Production - // Staging - // If not specified, the default value is Production. - SlotType *CloudServiceSlotType - - // The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. - // This property cannot be updated once it is set. The swappable cloud service - // referred by this id must be present otherwise an error will be thrown. - SwappableCloudService *SubResource -} - -// CloudServiceOsProfile - Describes the OS profile for the cloud service. -type CloudServiceOsProfile struct { - // Specifies set of certificates that should be installed onto the role instances. - Secrets []*CloudServiceVaultSecretGroup -} - -// CloudServiceProperties - Cloud service properties -type CloudServiceProperties struct { - // (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override - // the role instance count and vm size specified in the .cscfg and .csdef - // respectively. The default value is false. - AllowModelOverride *bool - - // Specifies the XML service configuration (.cscfg) for the cloud service. - Configuration *string - - // Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can - // be Shared Access Signature (SAS) URI from any storage account. This is a - // write-only property and is not returned in GET calls. - ConfigurationURL *string - - // Describes a cloud service extension profile. - ExtensionProfile *CloudServiceExtensionProfile - - // Network Profile for the cloud service. - NetworkProfile *CloudServiceNetworkProfile - - // Describes the OS profile for the cloud service. - OSProfile *CloudServiceOsProfile - - // Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be - // Shared Access Signature (SAS) URI from any storage account. This is a write-only - // property and is not returned in GET calls. - PackageURL *string - - // Describes the role profile for the cloud service. - RoleProfile *CloudServiceRoleProfile - - // (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is true. If - // false, the service model is still deployed, but the code is not run immediately. - // Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service - // still incurs charges, even if it is poweredoff. - StartCloudService *bool - - // Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates - // can be initiated manually in each update domain or initiated automatically in - // all update domains. Possible Values are - // Auto - // Manual - // Simultaneous - // If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If - // set to Auto, the update is automatically applied to each update domain in - // sequence. - UpgradeMode *CloudServiceUpgradeMode - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The unique identifier for the cloud service. - UniqueID *string -} - -// CloudServiceRole - Describes a role of the cloud service. -type CloudServiceRole struct { - // The cloud service role properties. - Properties *CloudServiceRoleProperties - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU - - // READ-ONLY; Resource id - ID *string - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CloudServiceRoleListResult - The list operation result. -type CloudServiceRoleListResult struct { - // REQUIRED; The list of resources. - Value []*CloudServiceRole - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// CloudServiceRoleProfile - Describes the role profile for the cloud service. -type CloudServiceRoleProfile struct { - // List of roles for the cloud service. - Roles []*CloudServiceRoleProfileProperties -} - -// CloudServiceRoleProfileProperties - Describes the role properties. -type CloudServiceRoleProfileProperties struct { - // Resource name. - Name *string - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU -} - -// CloudServiceRoleProperties - The cloud service role properties. -type CloudServiceRoleProperties struct { - // READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. - UniqueID *string -} - -// CloudServiceRoleSKU - Describes the cloud service role sku. -type CloudServiceRoleSKU struct { - // Specifies the number of role instances in the cloud service. - Capacity *int64 - - // The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete - // and recreate the cloud service or move back to the old sku. - Name *string - - // Specifies the tier of the cloud service. Possible Values are - // Standard - // Basic - Tier *string -} - -type CloudServiceUpdate struct { - // Resource tags - Tags map[string]*string -} - -// CloudServiceVaultAndSecretReference - Protected settings for the extension, referenced using KeyVault which are encrypted -// before sent to the role instance. -type CloudServiceVaultAndSecretReference struct { - // Secret URL which contains the protected settings of the extension - SecretURL *string - - // The ARM Resource ID of the Key Vault - SourceVault *SubResource -} - -// CloudServiceVaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should -// reside on the role instance. -type CloudServiceVaultCertificate struct { - // This is the URL of a certificate that has been uploaded to Key Vault as a secret. - CertificateURL *string -} - -// CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type CloudServiceVaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*CloudServiceVaultCertificate -} - -// CommunityGallery - Specifies information about the Community Gallery that you want to create or update. -type CommunityGallery struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a community gallery. - Properties *CommunityGalleryProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryIdentifier - The identifier information of community gallery. -type CommunityGalleryIdentifier struct { - // The unique id of this community gallery. - UniqueID *string -} - -// CommunityGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type CommunityGalleryImage struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a gallery image definition. - Properties *CommunityGalleryImageProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryImageIdentifier - This is the community gallery image definition identifier. -type CommunityGalleryImageIdentifier struct { - // The name of the gallery image definition offer. - Offer *string - - // The name of the gallery image definition publisher. - Publisher *string - - // The name of the gallery image definition SKU. - SKU *string -} - -// CommunityGalleryImageList - The List Community Gallery Images operation response. -type CommunityGalleryImageList struct { - // REQUIRED; A list of community gallery images. - Value []*CommunityGalleryImage - - // The URI to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community - // gallery images. - NextLink *string -} - -// CommunityGalleryImageProperties - Describes the properties of a gallery image definition. -type CommunityGalleryImageProperties struct { - // REQUIRED; This is the community gallery image definition identifier. - Identifier *CommunityGalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; 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. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The disclaimer for a community gallery resource. - Disclaimer *string - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // The end-user license agreement for the current community gallery image. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Privacy statement URI for the current community gallery image. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration -} - -// CommunityGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type CommunityGalleryImageVersion struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a gallery image version. - Properties *CommunityGalleryImageVersionProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryImageVersionList - The List Community Gallery Image versions operation response. -type CommunityGalleryImageVersionList struct { - // REQUIRED; A list of community gallery image versions. - Value []*CommunityGalleryImageVersion - - // The URI to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of - // community gallery image versions. - NextLink *string -} - -// CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version. -type CommunityGalleryImageVersionProperties struct { - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // The disclaimer for a community gallery resource. - Disclaimer *string - - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time - - // Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile -} - -// CommunityGalleryInfo - Information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // End-user license agreement for community gallery image. - Eula *string - - // The prefix of the gallery name that will be displayed publicly. Visible to all users. - PublicNamePrefix *string - - // Community gallery publisher support email. The email address of the publisher. Visible to all users. - PublisherContact *string - - // The link to the publisher website. Visible to all users. - PublisherURI *string - - // READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool - - // READ-ONLY; Community gallery public name list. - PublicNames []*string -} - -// CommunityGalleryMetadata - The metadata of community gallery. -type CommunityGalleryMetadata struct { - // REQUIRED; A list of public names the gallery has. - PublicNames []*string - - // REQUIRED; The publisher email id of this community gallery. - PublisherContact *string - - // The end-user license agreement for this community gallery. - Eula *string - - // The link for the privacy statement of this community gallery from the gallery publisher. - PrivacyStatementURI *string - - // The publisher URI of this community gallery. - PublisherURI *string -} - -// CommunityGalleryProperties - Describes the properties of a community gallery. -type CommunityGalleryProperties struct { - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // The metadata of community gallery. - CommunityMetadata *CommunityGalleryMetadata - - // The disclaimer for a community gallery resource. - Disclaimer *string -} - -// CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation -// fails. -type CopyCompletionError struct { - // REQUIRED; Indicates the error code if the background copy of a resource created via the CopyStart operation fails. - ErrorCode *CopyCompletionErrorReason - - // REQUIRED; Indicates the error message if the background copy of a resource created via the CopyStart operation fails. - ErrorMessage *string -} - -// CreationData - Data used when creating a disk. -type CreationData struct { - // REQUIRED; This enumerates the possible sources of a disk's creation. - CreateOption *DiskCreateOption - - // Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. - ElasticSanResourceID *string - - // Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference - // will be the ARM id of the shared galley image version from which to create a - // disk. - GalleryImageReference *ImageDiskReference - - // Disk source information for PIR or user images. - ImageReference *ImageDiskReference - - // Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. - LogicalSectorSize *int32 - - // Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance - // target. This flag can only be set on disk creation time and cannot be - // disabled after enabled. - PerformancePlus *bool - - // If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. - ProvisionedBandwidthCopySpeed *ProvisionedBandwidthCopyOption - - // If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. - SecurityDataURI *string - - // If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string - - // If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string - - // Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to - // import as a disk. - StorageAccountID *string - - // 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 - - // READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string -} - -// DataDisk - Describes a data disk. -type DataDisk struct { - // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when - // you are using a specialized disk to create the virtual machine. FromImage: This value is - // used when you are using an image to create the virtual machine data disk. If you are using a platform image, you should - // also use the imageReference element described above. If you are using a - // marketplace image, you should also use the plan element previously described. Empty: This value is used when creating an - // empty data disk. Copy: This value is used to create a data disk from a snapshot - // or another disk. Restore: This value is used to create a data disk from a disk restore point. - CreateOption *DiskCreateOptionTypes - - // REQUIRED; 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 - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value - // is used, the data disk is deleted when VM is deleted. Detach. If this value is - // used, the data disk is retained after VM is deleted. The default value is set to Detach. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the - // virtual machine. Supported values: ForceDetach. detachOption: ForceDetach is - // applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected - // failure from the virtual machine and the disk is still not released then - // use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed - // when using this detach behavior. This feature is still in preview mode and is - // not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting - // detachOption: 'ForceDetach'. - DetachOption *DiskDetachOptionTypes - - // 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. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // 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 - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters - - // The disk name. - Name *string - - // The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk. - SourceResource *APIEntityReference - - // Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool - - // The virtual hard disk. - Vhd *VirtualHardDisk - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool - - // 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 - - // 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 -} - -// DataDiskImage - Contains the data disk images information. -type DataDiskImage struct { - // 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 -} - -// DataDiskImageEncryption - Contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // REQUIRED; 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 - - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string -} - -// DataDisksToAttach - Describes the data disk to be attached. -type DataDisksToAttach struct { - // REQUIRED; ID of the managed data disk. - DiskID *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value - // is used, the data disk is deleted when VM is deleted. Detach. If this value is - // used, the data disk is retained after VM is deleted. The default value is set to Detach. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // 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. If not specified, lun would be auto - // assigned. - Lun *int32 - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// DataDisksToDetach - Describes the data disk to be detached. -type DataDisksToDetach struct { - // REQUIRED; ID of the managed data disk. - DiskID *string - - // Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details. - DetachOption *DiskDetachOptionTypes -} - -// DedicatedHost - Specifies information about the Dedicated host. -type DedicatedHost struct { - // REQUIRED; Resource location - Location *string - - // REQUIRED; 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 - - // Properties of the dedicated host. - Properties *DedicatedHostProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DedicatedHostAllocatableVM - Represents the dedicated host unutilized capacity in terms of a specific VM size. -type DedicatedHostAllocatableVM struct { - // Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 - - // VM size in terms of which the unutilized capacity is represented. - VMSize *string -} - -// DedicatedHostAvailableCapacity - Dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // 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 -} - -// 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 { - // REQUIRED; Resource location - Location *string - - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties - - // Resource tags - Tags map[string]*string - - // 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 - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -type DedicatedHostGroupInstanceView struct { - // List of instance view of the dedicated hosts under the dedicated host group. - Hosts []*DedicatedHostInstanceViewWithName -} - -// DedicatedHostGroupListResult - The List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - // REQUIRED; The list of dedicated host groups - Value []*DedicatedHostGroup - - // 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 -} - -// DedicatedHostGroupProperties - Dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // REQUIRED; Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 - - // Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. - AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities - - // Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. - // Automatic placement means resources are allocated on dedicated hosts, that are - // chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: - // 2020-06-01. - SupportAutomaticPlacement *bool - - // READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts []*SubResourceReadOnly - - // READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the - // dedicated host group. - InstanceView *DedicatedHostGroupInstanceView -} - -// DedicatedHostGroupPropertiesAdditionalCapabilities - Enables or disables a capability on the dedicated host group. Minimum -// api-version: 2022-03-01. -type DedicatedHostGroupPropertiesAdditionalCapabilities struct { - // The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated - // Host Group. For the Virtual Machines to be UltraSSD Enabled, - // UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. - // Please refer to - // https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. Note: - // The ultraSSDEnabled setting can only be enabled for Host Groups that are - // created as zonal. Minimum api-version: 2022-03-01. - UltraSSDEnabled *bool -} - -// DedicatedHostGroupUpdate - Specifies information about the dedicated host group that the dedicated host should be assigned -// to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties - - // Resource tags - Tags map[string]*string - - // 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 -} - -// DedicatedHostInstanceView - The instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity - - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string -} - -// DedicatedHostInstanceViewWithName - The instance view of a dedicated host that includes the name of the dedicated host. -// It is used for the response to the instance view of a dedicated host group. -type DedicatedHostInstanceViewWithName struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity - - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string - - // READ-ONLY; The name of the dedicated host. - Name *string -} - -// DedicatedHostListResult - The list dedicated host operation response. -type DedicatedHostListResult struct { - // REQUIRED; The list of dedicated hosts - Value []*DedicatedHost - - // 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 -} - -// DedicatedHostProperties - Properties of the dedicated host. -type DedicatedHostProperties struct { - // 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 - - // Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: - // None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None. - LicenseType *DedicatedHostLicenseTypes - - // Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 - - // 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 - - // READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *time.Time - - // READ-ONLY; Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines []*SubResourceReadOnly -} - -// DedicatedHostSizeListResult - The List Dedicated Host sizes operation response. -type DedicatedHostSizeListResult struct { - // The list of dedicated host sizes. - Value []*string -} - -// DedicatedHostUpdate - Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may -// be updated. -type DedicatedHostUpdate struct { - // Properties of the dedicated host. - Properties *DedicatedHostProperties - - // List all available dedicated host sizes for resizing [https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes]. - // Resizing can be only used to scale up DedicatedHost. Only name is - // required to be set. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// DiagnosticsProfile - Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. -type DiagnosticsProfile struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. NOTE: - // If storageUri is being specified then ensure that the storage account is in - // the same region and subscription as the VM. 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 -} - -// 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 { - // Specifies the ephemeral disk settings for operating system disk. - Option *DiffDiskOptions - - // Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk, NvmeDisk. - // The defaulting behavior is: CacheDisk if one is configured for the VM size - // otherwise ResourceDisk or NvmeDisk is used. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes - // and Linux VM at - // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Minimum api-version - // for NvmeDisk: 2024-03-01. - Placement *DiffDiskPlacement -} - -// Disallowed - Describes the disallowed disk types. -type Disallowed struct { - // A list of disk types. - DiskTypes []*string -} - -// DisallowedConfiguration - Specifies the disallowed configuration for a virtual machine image. -type DisallowedConfiguration struct { - // VM disk types which are disallowed. - VMDiskType *VMDiskTypes -} - -// Disk resource. -type Disk struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the disk will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - - // Disk resource properties. - Properties *DiskProperties - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. - SKU *DiskSKU - - // Resource tags - Tags map[string]*string - - // The Logical zone list for Disk. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string - - // READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to - // a value greater than one for disks to allow attaching them to multiple VMs. - ManagedByExtended []*string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskAccess - disk access resource. -type DiskAccess struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the disk access will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - Properties *DiskAccessProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskAccessList - The List disk access operation response. -type DiskAccessList struct { - // REQUIRED; A list of disk access resources. - Value []*DiskAccess - - // The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access - // resources. - NextLink *string -} - -type DiskAccessProperties struct { - // READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection - // is supported. - PrivateEndpointConnections []*PrivateEndpointConnection - - // READ-ONLY; The disk access resource provisioning state. - ProvisioningState *string - - // READ-ONLY; The time when the disk access was created. - TimeCreated *time.Time -} - -// DiskAccessUpdate - Used for updating a disk access resource. -type DiskAccessUpdate struct { - // Resource tags - Tags map[string]*string -} - -// DiskEncryptionSet - disk encryption set resource. -type DiskEncryptionSet struct { - // REQUIRED; Resource location - Location *string - - // 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. - Identity *EncryptionSetIdentity - Properties *EncryptionSetProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskEncryptionSetList - The List disk encryption set operation response. -type DiskEncryptionSetList struct { - // REQUIRED; A list of disk encryption sets. - Value []*DiskEncryptionSet - - // 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 -} - -// 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 { - // Resource Id - ID *string -} - -// DiskEncryptionSetUpdate - disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - // 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. - Identity *EncryptionSetIdentity - - // disk encryption set resource update properties. - Properties *DiskEncryptionSetUpdateProperties - - // Resource tags - Tags map[string]*string -} - -// DiskEncryptionSetUpdateProperties - disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - // Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots - ActiveKey *KeyForDiskEncryptionSet - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType - - // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the - // property. - FederatedClientID *string - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool -} - -// DiskEncryptionSettings - Describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference - - // Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool - - // Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference -} - -// DiskImageEncryption - This is the disk image encryption base class. -type DiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string -} - -// DiskInstanceView - The instance view of the disk. -type DiskInstanceView struct { - // Specifies the encryption settings for the OS Disk. - // Minimum api-version: 2015-06-15 - EncryptionSettings []*DiskEncryptionSettings - - // The disk name. - Name *string - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// DiskList - The List Disks operation response. -type DiskList struct { - // REQUIRED; A list of disks. - Value []*Disk - - // The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string -} - -// DiskProperties - Disk resource properties. -type DiskProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData - - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 - - // 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 *int64 - - // 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 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // The Operating System type. - OSType *OperatingSystemTypes - - // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times - // a day) by detached from one virtual machine and attached to another. This - // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align - // with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: - // MicrosoftWindowsServer, product: WindowsServer} - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string - - // READ-ONLY; Latest time when bursting was last enabled on a disk. - BurstingEnabledTime *time.Time - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 - - // READ-ONLY; The state of the disk. - DiskState *DiskState - - // READ-ONLY; The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached - // or detached from a VM or the time when the VM to which the disk was attached was - // deallocated or started. - LastOwnershipUpdateTime *time.Time - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string - - // READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than - // one for disks to allow attaching them to multiple VMs. - ShareInfo []*ShareInfoElement - - // READ-ONLY; The time when the disk was created. - TimeCreated *time.Time - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string -} - -// DiskPurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type DiskPurchasePlan struct { - // REQUIRED; The plan ID. - Name *string - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string - - // REQUIRED; The publisher ID. - Publisher *string - - // The Offer Promotion Code. - PromotionCode *string -} - -// DiskRestorePoint - Properties of disk restore point -type DiskRestorePoint struct { - // Properties of an incremental disk restore point - Properties *DiskRestorePointProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskRestorePointAttributes - Disk Restore Point details. -type DiskRestorePointAttributes struct { - // Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while - // creating a restore point. - Encryption *RestorePointEncryption - - // Resource Id of the source disk restore point. - SourceDiskRestorePoint *APIEntityReference - - // READ-ONLY; Resource Id - ID *string -} - -// DiskRestorePointInstanceView - The instance view of a disk restore point. -type DiskRestorePointInstanceView struct { - // Disk restore point Id. - ID *string - - // The disk restore point replication status information. - ReplicationStatus *DiskRestorePointReplicationStatus -} - -// DiskRestorePointList - The List Disk Restore Points operation response. -type DiskRestorePointList struct { - // REQUIRED; A list of disk restore points. - Value []*DiskRestorePoint - - // The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore - // points. - NextLink *string -} - -// DiskRestorePointProperties - Properties of an incremental disk restore point -type DiskRestorePointProperties struct { - // Percentage complete for the background copy of disk restore point when source resource is from a different region. - CompletionPercent *float32 - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the the image from which the OS disk was created. - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // READ-ONLY; id of the backing snapshot's MIS family - FamilyID *string - - // READ-ONLY; The Operating System type. - OSType *OperatingSystemTypes - - // READ-ONLY; Replication state of disk restore point when source resource is from a different region. - ReplicationState *string - - // READ-ONLY; arm id of source disk or source disk restore point. - SourceResourceID *string - - // READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. - SourceResourceLocation *string - - // READ-ONLY; unique incarnation id of the source disk - SourceUniqueID *string - - // READ-ONLY; The timestamp of restorePoint creation - TimeCreated *time.Time -} - -// DiskRestorePointReplicationStatus - The instance view of a disk restore point. -type DiskRestorePointReplicationStatus struct { - // Replication completion percentage. - CompletionPercent *int32 - - // The resource status information. - Status *InstanceViewStatus -} - -// DiskSKU - The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, -// or PremiumV2_LRS. -type DiskSKU struct { - // The sku name. - Name *DiskStorageAccountTypes - - // READ-ONLY; The sku tier. - Tier *string -} - -// DiskSecurityProfile - Contains the security related information for the resource. -type DiskSecurityProfile struct { - // ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key - SecureVMDiskEncryptionSetID *string - - // Specifies the SecurityType of the VM. Applicable for OS disks only. - SecurityType *DiskSecurityTypes -} - -// DiskUpdate - Disk update resource. -type DiskUpdate struct { - // Disk resource update properties. - Properties *DiskUpdateProperties - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. - SKU *DiskSKU - - // Resource tags - Tags map[string]*string -} - -// DiskUpdateProperties - Disk resource update properties. -type DiskUpdateProperties struct { - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 - - // 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 *int64 - - // 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 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // the Operating System type. - OSType *OperatingSystemTypes - - // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times - // a day) by detached from one virtual machine and attached to another. This - // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align - // with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information to be added on the OS disk - PurchasePlan *DiskPurchasePlan - - // List of supported capabilities to be added on the OS disk. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress -} - -// Encryption at rest settings for disk or snapshot -type Encryption struct { - // ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string - - // The type of key used to encrypt the data of the disk. - Type *EncryptionType -} - -// EncryptionIdentity - Specifies the Managed Identity used by ADE to get access token for keyvault operations. -type EncryptionIdentity struct { - // Specifies ARM Resource ID of one of the user identities associated with the VM. - UserAssignedIdentityResourceID *string -} - -// EncryptionImages - Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the -// gallery artifact. -type EncryptionImages struct { - // A list of encryption specifications for data disk images. - DataDiskImages []*DataDiskImageEncryption - - // Contains encryption settings for an OS disk image. - OSDiskImage *OSDiskImageEncryption -} - -// 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 { - // The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption - // Sets can be updated with Identity type None during migration of - // subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. - Type *DiskEncryptionSetIdentityType - - // The list of user identities associated with the disk encryption 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]*UserAssignedIdentitiesValue - - // 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 - - // 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 -} - -type EncryptionSetProperties struct { - // The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyForDiskEncryptionSet - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType - - // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the - // property. - FederatedClientID *string - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool - - // READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will - // not be attempted until the error on this disk encryption set is fixed. - AutoKeyRotationError *APIError - - // READ-ONLY; The time when the active key of this disk encryption set was updated. - LastKeyRotationTimestamp *time.Time - - // 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 []*KeyForDiskEncryptionSet - - // READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string -} - -// EncryptionSettingsCollection - Encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // REQUIRED; 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 - - // A collection of encryption settings, one for each disk volume. - EncryptionSettings []*EncryptionSettingsElement - - // 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 -} - -// EncryptionSettingsElement - Encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference - - // 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 -} - -// EventGridAndResourceGraph - Specifies eventGridAndResourceGraph related Scheduled Event related configurations. -type EventGridAndResourceGraph struct { - // Specifies if event grid and resource graph is enabled for Scheduled event related configurations. - Enable *bool -} - -// ExtendedLocation - The complex type of the extended location. -type ExtendedLocation struct { - // The name of the extended location. - Name *string - - // The type of the extended location. - Type *ExtendedLocationTypes -} - -// Extension - Describes a cloud service Extension. -type Extension struct { - // The name of the extension. - Name *string - - // Extension Properties. - Properties *CloudServiceExtensionProperties -} - -// Gallery - Specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplication - Specifies information about the gallery Application Definition that you want to create or update. -type GalleryApplication struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationCustomAction - A custom action that can be performed with a Gallery Application Version. -type GalleryApplicationCustomAction struct { - // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. - Name *string - - // REQUIRED; The script to run when executing this custom action. - Script *string - - // Description to help the users understand what this custom action does. - Description *string - - // The parameters that this custom action uses - Parameters []*GalleryApplicationCustomActionParameter -} - -// GalleryApplicationCustomActionParameter - The definition of a parameter that can be passed to a custom action of a Gallery -// Application Version. -type GalleryApplicationCustomActionParameter struct { - // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. - Name *string - - // The default value of the parameter. Only applies to string types - DefaultValue *string - - // A description to help users understand what this parameter means - Description *string - - // Indicates whether this parameter must be passed when running the custom action. - Required *bool - - // Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob - Type *GalleryApplicationCustomActionParameterType -} - -// GalleryApplicationList - The List Gallery Applications operation response. -type GalleryApplicationList struct { - // REQUIRED; A list of Gallery Applications. - Value []*GalleryApplication - - // 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 -} - -// GalleryApplicationProperties - Describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // REQUIRED; This property allows you to specify the supported type of the OS that application is built for. Possible values - // are: Windows, Linux. - SupportedOSType *OperatingSystemTypes - - // A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. - CustomActions []*GalleryApplicationCustomAction - - // The description of this gallery Application Definition resource. This property is updatable. - Description *string - - // The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // The Eula agreement for the gallery Application Definition. - Eula *string - - // The privacy statement uri. - PrivacyStatementURI *string - - // The release note uri. - ReleaseNoteURI *string -} - -// GalleryApplicationUpdate - Specifies information about the gallery Application Definition that you want to update. -type GalleryApplicationUpdate struct { - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationVersion - Specifies information about the gallery Application Version that you want to create or update. -type GalleryApplicationVersion struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationVersionList - The List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - // REQUIRED; A list of gallery Application Versions. - Value []*GalleryApplicationVersion - - // 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 -} - -// GalleryApplicationVersionProperties - Describes the properties of a gallery image version. -type GalleryApplicationVersionProperties struct { - // REQUIRED; The publishing profile of a gallery image version. - PublishingProfile *GalleryApplicationVersionPublishingProfile - - // The safety profile of the Gallery Application Version. - SafetyProfile *GalleryApplicationVersionSafetyProfile - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GalleryApplicationVersionPublishingProfile - The publishing profile of a gallery image version. -type GalleryApplicationVersionPublishingProfile struct { - // REQUIRED; The source image from which the Image Version is going to be created. - Source *UserArtifactSource - - // Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. - AdvancedSettings map[string]*string - - // A list of custom actions that can be performed with this Gallery Application Version. - CustomActions []*GalleryApplicationCustomAction - - // Optional. Whether or not this application reports health. - EnableHealthCheck *bool - - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - ManageActions *UserArtifactManage - - // 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 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Additional settings for the VM app that contains the target package and config file name when it is deployed to target - // VM or VM scale set. - Settings *UserArtifactSettings - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryApplicationVersionSafetyProfile - The safety profile of the Gallery Application Version. -type GalleryApplicationVersionSafetyProfile struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool -} - -// GalleryApplicationVersionUpdate - Specifies information about the gallery Application Version that you want to update. -type GalleryApplicationVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // 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 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryArtifactSafetyProfileBase - This is the safety profile of the Gallery Artifact Version. -type GalleryArtifactSafetyProfileBase struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool -} - -// GalleryArtifactSource - The source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - // REQUIRED; The managed artifact. - ManagedImage *ManagedArtifact -} - -// GalleryArtifactVersionFullSource - The source of the gallery artifact version. -type GalleryArtifactVersionFullSource struct { - // The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. - CommunityGalleryImageID *string - - // The id of the gallery artifact version source. - ID *string - - // The resource Id of the source virtual machine. Only required when capturing a virtual machine to source this Gallery Image - // Version. - VirtualMachineID *string -} - -// GalleryArtifactVersionSource - The gallery artifact version source. -type GalleryArtifactVersionSource struct { - // The id of the gallery artifact version source. - ID *string -} - -// GalleryDataDiskImage - This is the data disk image. -type GalleryDataDiskImage struct { - // REQUIRED; 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 - - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryDiskImage - This is the disk image base class. -type GalleryDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryDiskImageSource - The source for the disk image. -type GalleryDiskImageSource struct { - // The id of the gallery artifact version source. - ID *string - - // The Storage Account Id that contains the vhd blob being used as a source for this artifact version. - StorageAccountID *string - - // The uri of the gallery artifact version source. Currently used to specify vhd/blob source. - URI *string -} - -// GalleryExtendedLocation - The name of the extended location. -type GalleryExtendedLocation struct { - Name *string - - // It is type of the extended location. - Type *GalleryExtendedLocationType -} - -// GalleryIdentifier - Describes the gallery unique name. -type GalleryIdentifier struct { - // READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string -} - -// GalleryImage - Specifies information about the gallery image definition that you want to create or update. -type GalleryImage struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageFeature - A feature for gallery image. -type GalleryImageFeature struct { - // The name of the gallery image feature. - Name *string - - // The value of the gallery image feature. - Value *string -} - -// GalleryImageIdentifier - This is the gallery image definition identifier. -type GalleryImageIdentifier struct { - // REQUIRED; The name of the gallery image definition offer. - Offer *string - - // REQUIRED; The name of the gallery image definition publisher. - Publisher *string - - // REQUIRED; The name of the gallery image definition SKU. - SKU *string -} - -// GalleryImageList - The List Gallery Images operation response. -type GalleryImageList struct { - // REQUIRED; A list of Shared Image Gallery images. - Value []*GalleryImage - - // 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 -} - -// GalleryImageProperties - Describes the properties of a gallery image definition. -type GalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; 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. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The description of this gallery image definition resource. This property is updatable. - Description *string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // The Eula agreement for the gallery image definition. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // The privacy statement uri. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration - - // The release note uri. - ReleaseNoteURI *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState -} - -// GalleryImageUpdate - Specifies information about the gallery image definition that you want to update. -type GalleryImageUpdate struct { - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type GalleryImageVersion struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageVersionList - The List Gallery Image version operation response. -type GalleryImageVersionList struct { - // REQUIRED; A list of gallery image versions. - Value []*GalleryImageVersion - - // 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 -} - -// GalleryImageVersionProperties - Describes the properties of a gallery image version. -type GalleryImageVersionProperties struct { - // REQUIRED; This is the storage profile of a Gallery Image Version. - StorageProfile *GalleryImageVersionStorageProfile - - // The publishing profile of a gallery image Version. - PublishingProfile *GalleryImageVersionPublishingProfile - - // This is the safety profile of the Gallery Image Version. - SafetyProfile *GalleryImageVersionSafetyProfile - - // The security profile of a gallery image version - SecurityProfile *ImageVersionSecurityProfile - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version. -type GalleryImageVersionPublishingProfile struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // 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 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryImageVersionSafetyProfile - This is the safety profile of the Gallery Image Version. -type GalleryImageVersionSafetyProfile struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool - - // READ-ONLY; A list of Policy Violations that have been reported for this Gallery Image Version. - PolicyViolations []*PolicyViolation - - // READ-ONLY; Indicates whether this image has been reported as violating Microsoft's policies. - ReportedForPolicyViolation *bool -} - -// GalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - // A list of data disk images. - DataDiskImages []*GalleryDataDiskImage - - // This is the OS disk image. - OSDiskImage *GalleryOSDiskImage - - // The source of the gallery artifact version. - Source *GalleryArtifactVersionFullSource -} - -// GalleryImageVersionUefiSettings - Contains UEFI settings for the image version. -type GalleryImageVersionUefiSettings struct { - // Additional UEFI key signatures that will be added to the image in addition to the signature templates - AdditionalSignatures *UefiKeySignatures - - // The name of the template(s) that contains default UEFI key signatures that will be added to the image. - SignatureTemplateNames []*UefiSignatureTemplateName -} - -// GalleryImageVersionUpdate - Specifies information about the gallery image version that you want to update. -type GalleryImageVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryList - The List Galleries operation response. -type GalleryList struct { - // REQUIRED; A list of galleries. - Value []*Gallery - - // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string -} - -// GalleryOSDiskImage - This is the OS disk image. -type GalleryOSDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryProperties - Describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // The description of this Shared Image Gallery resource. This property is updatable. - Description *string - - // Describes the gallery unique name. - Identifier *GalleryIdentifier - - // Profile for gallery sharing to subscription or tenant - SharingProfile *SharingProfile - - // Contains information about the soft deletion policy of the gallery. - SoftDeletePolicy *SoftDeletePolicy - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; Sharing status of current gallery. - SharingStatus *SharingStatus -} - -type GalleryTargetExtendedLocation struct { - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages - - // The name of the extended location. - ExtendedLocation *GalleryExtendedLocation - - // The number of replicas of the Image Version to be created per extended location. This property is updatable. - ExtendedLocationReplicaCount *int32 - - // The name of the region. - Name *string - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *EdgeZoneStorageAccountType -} - -// GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GrantAccessData - Data used for requesting a SAS. -type GrantAccessData struct { - // REQUIRED - Access *AccessLevel - - // REQUIRED; Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 - - // Used to specify the file format when making request for SAS on a VHDX file format snapshot - FileFormat *FileFormat - - // Set this flag to true to get additional SAS for VM guest state - GetSecureVMGuestStateSAS *bool -} - -// HardwareProfile - Specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd - // 2023. The recommended way to get the list of available sizes is using 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/resourceskus/list], List all available virtual machine sizes for resizing - // [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine - // sizes, see Sizes for virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set. - VMSize *VirtualMachineSizeTypes - - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature - // is still in preview mode and is not supported for VirtualMachineScaleSet. Please - // follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details. - VMSizeProperties *VMSizeProperties -} - -// 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 { - // REQUIRED; Resource location - Location *string - - // The extended location of the Image. - ExtendedLocation *ExtendedLocation - - // Describes the properties of an Image. - Properties *ImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ImageDataDisk - Describes a data disk. -type ImageDataDisk struct { - // REQUIRED; 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 - - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // 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 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // 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. - StorageAccountType *StorageAccountTypes -} - -// ImageDeprecationStatus - Describes image deprecation status properties on the image. -type ImageDeprecationStatus struct { - // Describes the alternative option specified by the Publisher for this image when this image is deprecated. - AlternativeOption *AlternativeOption - - // Describes the state of the image. - ImageState *ImageState - - // The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher. - ScheduledDeprecationTime *time.Time -} - -// ImageDisk - Describes a image disk. -type ImageDisk struct { - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // 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 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // 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. - StorageAccountType *StorageAccountTypes -} - -// ImageDiskReference - The source image used for creating the disk. -type ImageDiskReference struct { - // A relative uri containing a community Azure Compute Gallery image reference. - CommunityGalleryImageID *string - - // A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. - ID *string - - // 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 - - // A relative uri containing a direct shared Azure Compute Gallery image reference. - SharedGalleryImageID *string -} - -// ImageListResult - The List Image operation response. -type ImageListResult struct { - // REQUIRED; The list of Images. - Value []*Image - - // The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string -} - -// ImageOSDisk - Describes an Operating System disk. -type ImageOSDisk struct { - // REQUIRED; The OS State. For managed images, use Generalized. - OSState *OperatingSystemStateTypes - - // REQUIRED; 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. - OSType *OperatingSystemTypes - - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // 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 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // 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. - StorageAccountType *StorageAccountTypes -} - -// ImageProperties - Describes the properties of an Image. -type ImageProperties struct { - // Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image - // source is a blob, then we need the user to specify the value, if the source is - // managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the - // source managed resource. - HyperVGeneration *HyperVGenerationTypes - - // The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile - - // READ-ONLY; The provisioning state. - ProvisioningState *string -} - -// ImagePurchasePlan - Describes the gallery image definition purchase plan. This is used by marketplace images. -type ImagePurchasePlan struct { - // The plan ID. - Name *string - - // The product ID. - Product *string - - // The publisher ID. - Publisher *string -} - -// 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 { - // Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET - // call. - CommunityGalleryImageID *string - - // Resource Id - ID *string - - // Specifies the offer of the platform image or marketplace image used to create the virtual machine. - Offer *string - - // The image publisher. - Publisher *string - - // The image SKU. - SKU *string - - // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string - - // 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. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for - // deployment, to use 'latest' version of gallery image, just set - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' - // in the 'id' field without version input. - Version *string - - // 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 -} - -// ImageStorageProfile - Describes a storage profile. -type ImageStorageProfile struct { - // 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/managed-disks-overview]. - DataDisks []*ImageDataDisk - - // 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/managed-disks-overview]. - OSDisk *ImageOSDisk - - // 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 -} - -// ImageUpdate - The source user image virtual hard disk. Only tags may be updated. -type ImageUpdate struct { - // Describes the properties of an Image. - Properties *ImageProperties - - // Resource tags - Tags map[string]*string -} - -// ImageVersionSecurityProfile - The security profile of a gallery image version -type ImageVersionSecurityProfile struct { - // Contains UEFI settings for the image version. - UefiSettings *GalleryImageVersionUefiSettings -} - -// InnerError - Inner error details. -type InnerError struct { - // The internal error message or exception dump. - Errordetail *string - - // The exception type. - Exceptiontype *string -} - -// InstanceSKU - The role instance SKU. -type InstanceSKU struct { - // READ-ONLY; The sku name. - Name *string - - // READ-ONLY; The tier of the cloud service role instance. - Tier *string -} - -// InstanceViewStatus - Instance view status. -type InstanceViewStatus struct { - // The status code. - Code *string - - // The short localizable label for the status. - DisplayStatus *string - - // The level code. - Level *StatusLevelTypes - - // The detailed status message, including for alerts and error messages. - Message *string - - // The time of the status. - Time *time.Time -} - -// InstanceViewStatusesSummary - Instance view statuses. -type InstanceViewStatusesSummary struct { - // READ-ONLY; The summary. - StatusesSummary []*StatusCodeCount -} - -// KeyForDiskEncryptionSet - Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots -type KeyForDiskEncryptionSet struct { - // REQUIRED; Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled - // value. - KeyURL *string - - // Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault - // subscription is not the same as the Disk Encryption Set subscription. - SourceVault *SourceVault -} - -// 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 { - // REQUIRED; Url pointing to a key or secret in KeyVault - KeyURL *string - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault -} - -// KeyVaultAndSecretReference - Key Vault Secret Url and vault id of the encryption key -type KeyVaultAndSecretReference struct { - // REQUIRED; Url pointing to a key or secret in KeyVault - SecretURL *string - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault -} - -// KeyVaultKeyReference - Describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // REQUIRED; The URL referencing a key encryption key in Key Vault. - KeyURL *string - - // REQUIRED; The relative URL of the Key Vault containing the key. - SourceVault *SubResource -} - -// KeyVaultSecretReference - Describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // REQUIRED; The URL referencing a secret in a Key Vault. - SecretURL *string - - // REQUIRED; The relative URL of the Key Vault containing the secret. - SourceVault *SubResource -} - -// LastPatchInstallationSummary - Describes the properties of the last installed patch summary. -type LastPatchInstallationSummary struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - ExcludedPatchCount *int32 - - // READ-ONLY; The count of patches that failed installation. - FailedPatchCount *int32 - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string - - // READ-ONLY; The count of patches that successfully installed. - InstalledPatchCount *int32 - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time - - // READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions - MaintenanceWindowExceeded *bool - - // READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or - // inclusion list entry. - NotSelectedPatchCount *int32 - - // READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. - PendingPatchCount *int32 - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// LatestGalleryImageVersion - The gallery image version with latest version in a particular region. -type LatestGalleryImageVersion struct { - // The name of the latest version in the region. - LatestVersionName *string - - // region of the Gallery Image Version. - Location *string -} - -// 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/linux/endorsed-distros]. -type LinuxConfiguration struct { - // Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool - - // Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool - - // [Preview Feature] Specifies settings related to VM Guest Patching on Linux. - PatchSettings *LinuxPatchSettings - - // 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 - - // Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration -} - -// LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API -type LinuxParameters struct { - // The update classifications to select when installing patches for Linux. - ClassificationsToInclude []*VMGuestPatchClassificationLinux - - // This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. - MaintenanceRunID *string - - // packages to exclude in the patch operation. Format: packageName_packageVersion - PackageNameMasksToExclude []*string - - // packages to include in the patch operation. Format: packageName_packageVersion - PackageNameMasksToInclude []*string -} - -// LinuxPatchSettings - Specifies settings related to VM Guest Patching on Linux. -type LinuxPatchSettings struct { - // Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *LinuxPatchAssessmentMode - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. - AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // ImageDefault - The virtual machine's default patching configuration is used. - // AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent - // must be true - PatchMode *LinuxVMGuestPatchMode -} - -// LinuxVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Linux patch settings. -type LinuxVMGuestPatchAutomaticByPlatformSettings struct { - // Enables customer to schedule patching without accidental upgrades - BypassPlatformSafetyChecksOnUserSchedule *bool - - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting -} - -// ListUsagesResult - The List Usages operation response. -type ListUsagesResult struct { - // REQUIRED; The list of compute resource usages. - Value []*Usage - - // 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 -} - -// LoadBalancerConfiguration - Describes the load balancer configuration. -type LoadBalancerConfiguration struct { - // REQUIRED; The name of the Load balancer - Name *string - - // REQUIRED; Properties of the load balancer configuration. - Properties *LoadBalancerConfigurationProperties - - // Resource Id - ID *string -} - -// LoadBalancerConfigurationProperties - Describes the properties of the load balancer configuration. -type LoadBalancerConfigurationProperties struct { - // REQUIRED; Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each - // load balancer configuration must have exactly one frontend IP configuration. - FrontendIPConfigurations []*LoadBalancerFrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfiguration - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP -// address is supported. Each load balancer configuration must have exactly one frontend IP configuration. -type LoadBalancerFrontendIPConfiguration struct { - // REQUIRED; The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. - // This name can be used to access the resource. - Name *string - - // REQUIRED; Properties of load balancer frontend ip configuration. - Properties *LoadBalancerFrontendIPConfigurationProperties -} - -// LoadBalancerFrontendIPConfigurationProperties - Describes a cloud service IP Configuration -type LoadBalancerFrontendIPConfigurationProperties struct { - // The virtual network private IP address of the IP configuration. - PrivateIPAddress *string - - // The reference to the public ip address resource. - PublicIPAddress *SubResource - - // The reference to the virtual network subnet resource. - Subnet *SubResource -} - -// LogAnalyticsInputBase - Api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// LogAnalyticsOperationResult - LogAnalytics operation status response -type LogAnalyticsOperationResult struct { - // READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput -} - -// LogAnalyticsOutput - LogAnalytics output properties -type LogAnalyticsOutput struct { - // READ-ONLY; Output file Uri path to blob container. - Output *string -} - -// MaintenanceRedeployStatus - Maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool - - // Message returned for the last Maintenance Operation. - LastOperationMessage *string - - // The Last Maintenance Operation Result Code. - LastOperationResultCode *MaintenanceOperationResultCodeTypes - - // End Time for the Maintenance Window. - MaintenanceWindowEndTime *time.Time - - // Start Time for the Maintenance Window. - MaintenanceWindowStartTime *time.Time - - // End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *time.Time - - // Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *time.Time -} - -// ManagedArtifact - The managed artifact. -type ManagedArtifact struct { - // REQUIRED; The managed artifact id. - ID *string -} - -// ManagedDiskParameters - The parameters of a managed disk. -type ManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Resource Id - ID *string - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile - - // 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. - StorageAccountType *StorageAccountTypes -} - -// NetworkInterfaceReference - Describes a network interface reference. -type NetworkInterfaceReference struct { - // Resource Id - ID *string - - // Describes a network interface reference properties. - Properties *NetworkInterfaceReferenceProperties -} - -// NetworkInterfaceReferenceProperties - Describes a network interface reference properties. -type NetworkInterfaceReferenceProperties struct { - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// NetworkProfile - Specifies the network interfaces or the networking configuration of the virtual machine. -type NetworkProfile struct { - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - NetworkAPIVersion *NetworkAPIVersion - - // Specifies the networking configurations that will be used to create the virtual machine networking resources. - NetworkInterfaceConfigurations []*VirtualMachineNetworkInterfaceConfiguration - - // Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces []*NetworkInterfaceReference -} - -// 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/managed-disks-overview]. -type OSDisk struct { - // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when - // you are using a specialized disk to create the virtual machine. FromImage: This value is - // used when you are using an image to create the virtual machine. If you are using a platform image, you should also use - // the imageReference element described above. If you are using a marketplace image, - // you should also use the plan element previously described. - CreateOption *DiskCreateOptionTypes - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value is - // used, the OS disk is deleted when VM is deleted. Detach. If this value is used, - // the os disk is retained after VM is deleted. The default value is set to Detach. For an ephemeral OS Disk, the default - // value is set to Delete. The user cannot change the delete option for an ephemeral - // OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings - - // 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. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15. - EncryptionSettings *DiskEncryptionSettings - - // 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 - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters - - // The disk name. - Name *string - - // 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. - OSType *OperatingSystemTypes - - // The virtual hard disk. - Vhd *VirtualHardDisk - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// OSDiskImage - Contains the os disk image information. -type OSDiskImage struct { - // REQUIRED; The operating system of the osDiskImage. - OperatingSystem *OperatingSystemTypes -} - -// OSDiskImageEncryption - Contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string - - // This property specifies the security profile of an OS disk image. - SecurityProfile *OSDiskImageSecurityProfile -} - -// OSDiskImageSecurityProfile - Contains security profile for an OS disk image. -type OSDiskImageSecurityProfile struct { - // confidential VM encryption types - ConfidentialVMEncryptionType *ConfidentialVMEncryptionType - - // secure VM disk encryption set id - SecureVMDiskEncryptionSetID *string -} - -// OSFamily - Describes a cloud service OS family. -type OSFamily struct { - // OS family properties. - Properties *OSFamilyProperties - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource location. - Location *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// OSFamilyListResult - The list operation result. -type OSFamilyListResult struct { - // REQUIRED; The list of resources. - Value []*OSFamily - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// OSFamilyProperties - OS family properties. -type OSFamilyProperties struct { - // READ-ONLY; The OS family label. - Label *string - - // READ-ONLY; The OS family name. - Name *string - - // READ-ONLY; List of OS versions belonging to this family. - Versions []*OSVersionPropertiesBase -} - -type OSImageNotificationProfile struct { - // Specifies whether the OS Image Scheduled event is enabled or disabled. - Enable *bool - - // Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image - // Scheduled Event before the event is auto approved (timed out). The configuration - // is specified in ISO 8601 format, and the value must be 15 minutes (PT15M) - NotBeforeTimeout *string -} - -// OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once -// VM is provisioned. -type OSProfile struct { - // 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/troubleshoot/azure/virtual-machines/reset-rdp] - // 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/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // 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. - AdminUsername *string - - // 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 - - // 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/azure-resource-manager/management/resource-name-rules]. - ComputerName *string - - // 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. The property 'customData' is passed to the VM to be saved as a - // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. - // 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/linux/using-cloud-init]. - CustomData *string - - // 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/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration - - // Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool - - // Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine - // it is recommended to use the Azure Key Vault virtual machine extension for - // Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine - // extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration -} - -// OSProfileProvisioningData - Additional parameters for Reimaging Non-Ephemeral Virtual Machine. -type OSProfileProvisioningData struct { - // 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/troubleshoot/azure/virtual-machines/reset-rdp] - // 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/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // 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. The property customData is passed to the VM to be saved as a - // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. - // If 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/linux/using-cloud-init]. - CustomData *string -} - -// OSVersion - Describes a cloud service OS version. -type OSVersion struct { - // OS version properties. - Properties *OSVersionProperties - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource location. - Location *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// OSVersionListResult - The list operation result. -type OSVersionListResult struct { - // REQUIRED; The list of resources. - Value []*OSVersion - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// OSVersionProperties - OS version properties. -type OSVersionProperties struct { - // READ-ONLY; The family of this OS version. - Family *string - - // READ-ONLY; The family label of this OS version. - FamilyLabel *string - - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool - - // READ-ONLY; The OS version label. - Label *string - - // READ-ONLY; The OS version. - Version *string -} - -// OSVersionPropertiesBase - Configuration view of an OS version. -type OSVersionPropertiesBase struct { - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool - - // READ-ONLY; The OS version label. - Label *string - - // READ-ONLY; The OS version. - Version *string -} - -// OperationListResult - The List Compute Operation operation response. -type OperationListResult struct { - // READ-ONLY; The list of compute operations - Value []*OperationValue -} - -// OperationValue - Describes the properties of a Compute Operation value. -type OperationValue struct { - // Describes the properties of a Compute Operation Value Display. - Display *OperationValueDisplay - - // READ-ONLY; The name of the compute operation. - Name *string - - // READ-ONLY; The origin of the compute operation. - Origin *string -} - -// OperationValueDisplay - Describes the properties of a Compute Operation Value Display. -type OperationValueDisplay struct { - // READ-ONLY; The description of the operation. - Description *string - - // READ-ONLY; The display name of the compute operation. - Operation *string - - // READ-ONLY; The resource provider for the operation. - Provider *string - - // READ-ONLY; The display name of the resource the operation applies to. - Resource *string -} - -// OrchestrationServiceStateInput - The input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // REQUIRED; The action to be performed. - Action *OrchestrationServiceStateAction - - // REQUIRED; The name of the service. - ServiceName *OrchestrationServiceNames -} - -// OrchestrationServiceSummary - Summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // READ-ONLY; The name of the service. - ServiceName *OrchestrationServiceNames - - // READ-ONLY; The current state of the service. - ServiceState *OrchestrationServiceState -} - -// PatchInstallationDetail - Information about a specific patch that was encountered during an installation action. -type PatchInstallationDetail struct { - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string - - // READ-ONLY; The state of the patch after the installation operation completed. - InstallationState *PatchInstallationState - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string - - // READ-ONLY; The friendly name of the patch. - Name *string - - // READ-ONLY; A unique identifier for the patch. - PatchID *string - - // READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - Version *string -} - -// PatchSettings - Specifies settings related to VM Guest Patching on Windows. -type PatchSettings struct { - // Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *WindowsPatchAssessmentMode - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. - AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings - - // Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must - // be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. - EnableHotpatching *bool - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the - // VM. In this mode, automatic updates are disabled; the property - // WindowsConfiguration.enableAutomaticUpdates must be false - // AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates - // must be true. - // AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and - // WindowsConfiguration.enableAutomaticUpdates must be true - PatchMode *WindowsVMGuestPatchMode -} - -// PirCommunityGalleryResource - Base information about the community gallery resource in azure compute gallery. -type PirCommunityGalleryResource struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// PirResource - The Resource model definition. -type PirResource struct { - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// PirSharedGalleryResource - Base information about the shared gallery resource in pir. -type PirSharedGalleryResource struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// 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 { - // The plan ID. - Name *string - - // Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string - - // The promotion code. - PromotionCode *string - - // The publisher ID. - Publisher *string -} - -// PolicyViolation - A policy violation reported against a gallery artifact. -type PolicyViolation struct { - // Describes the nature of the policy violation. - Category *PolicyViolationCategory - - // Describes specific details about why this policy violation was reported. - Details *string -} - -// PriorityMixPolicy - Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration -// mode. With this property the customer is able to specify the base number of regular -// priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this -// base target has been reached. -type PriorityMixPolicy struct { - // The base number of regular priority VMs that will be created in this scale set as it scales out. - BaseRegularPriorityCount *int32 - - // The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular - // priority. - RegularPriorityPercentageAboveBase *int32 -} - -// PrivateEndpoint - The Private Endpoint resource. -type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint - ID *string -} - -// PrivateEndpointConnection - The Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties - - // READ-ONLY; private endpoint connection Id - ID *string - - // READ-ONLY; private endpoint connection name - Name *string - - // READ-ONLY; private endpoint connection type - Type *string -} - -// PrivateEndpointConnectionListResult - A list of private link resources -type PrivateEndpointConnectionListResult struct { - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string - - // Array of private endpoint connections - Value []*PrivateEndpointConnection -} - -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between DiskAccess and Virtual Network. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - - // READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint - - // READ-ONLY; The provisioning state of the private endpoint connection resource. - ProvisioningState *PrivateEndpointConnectionProvisioningState -} - -// PrivateLinkResource - A private link resource -type PrivateLinkResource struct { - // Resource properties. - Properties *PrivateLinkResourceProperties - - // READ-ONLY; private link resource Id - ID *string - - // READ-ONLY; private link resource name - Name *string - - // READ-ONLY; private link resource type - Type *string -} - -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // Array of private link resources - Value []*PrivateLinkResource -} - -// PrivateLinkResourceProperties - Properties of a private link resource. -type PrivateLinkResourceProperties struct { - // The private link resource DNS zone name. - RequiredZoneNames []*string - - // READ-ONLY; The private link resource group id. - GroupID *string - - // READ-ONLY; The private link resource required member names. - RequiredMembers []*string -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string - - // The reason for approval/rejection of the connection. - Description *string - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus -} - -// PropertyUpdatesInProgress - Properties of the disk for which update is pending. -type PropertyUpdatesInProgress struct { - // The target performance tier of the disk if a tier change operation is in progress. - TargetTier *string -} - -// ProximityPlacementGroup - Specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Proximity Placement Group. - Properties *ProximityPlacementGroupProperties - - // Resource tags - Tags map[string]*string - - // Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the - // proximity placement group can be created. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ProximityPlacementGroupListResult - The List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - // REQUIRED; The list of proximity placement groups - Value []*ProximityPlacementGroup - - // The URI to fetch the next page of proximity placement groups. - NextLink *string -} - -// ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus - - // Specifies the user intent of the proximity placement group. - Intent *ProximityPlacementGroupPropertiesIntent - - // 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. - ProximityPlacementGroupType *ProximityPlacementGroupType - - // READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets []*SubResourceWithColocationStatus - - // READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets []*SubResourceWithColocationStatus - - // READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines []*SubResourceWithColocationStatus -} - -// ProximityPlacementGroupPropertiesIntent - Specifies the user intent of the proximity placement group. -type ProximityPlacementGroupPropertiesIntent struct { - // Specifies possible sizes of virtual machines that can be created in the proximity placement group. - VMSizes []*string -} - -// ProximityPlacementGroupUpdate - Specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Resource tags - Tags map[string]*string -} - -// ProxyAgentSettings - Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. -type ProxyAgentSettings struct { - // Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. - Enabled *bool - - // Increase the value of this property allows user to reset the key used for securing communication channel between guest - // and host. - KeyIncarnationID *int32 - - // Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor - // but not enforce access control over requests to host endpoints in Audit mode, - // while in Enforce mode it will enforce access control. The default value is Enforce mode. - Mode *Mode -} - -// ProxyOnlyResource - The ProxyOnly Resource model definition. -type ProxyOnlyResource struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ProxyResource - The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// PublicIPAddressSKU - Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. -type PublicIPAddressSKU struct { - // Specify public IP sku name - Name *PublicIPAddressSKUName - - // Specify public IP sku tier - Tier *PublicIPAddressSKUTier -} - -// PurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // REQUIRED; The plan ID. - Name *string - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string - - // REQUIRED; The publisher ID. - Publisher *string -} - -// RecommendedMachineConfiguration - The properties describe the recommended machine configuration for this Image Definition. -// These properties are updatable. -type RecommendedMachineConfiguration struct { - // Describes the resource range. - Memory *ResourceRange - - // Describes the resource range. - VCPUs *ResourceRange -} - -// RecoveryWalkResponse - Response after calling a manual recovery walk -type RecoveryWalkResponse struct { - // READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 - - // READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool -} - -// RegionalReplicationStatus - This is the regional replication status. -type RegionalReplicationStatus struct { - // READ-ONLY; The details of the replication status. - Details *string - - // READ-ONLY; It indicates progress of the replication job. - Progress *int32 - - // READ-ONLY; The region to which the gallery image version is being replicated to. - Region *string - - // READ-ONLY; This is the regional replication state. - State *ReplicationState -} - -// RegionalSharingStatus - Gallery regional sharing status -type RegionalSharingStatus struct { - // Details of gallery regional sharing failure. - Details *string - - // Region name - Region *string - - // READ-ONLY; Gallery sharing state in current region - State *SharingState -} - -// ReplicationStatus - This is the replication status of the gallery image version. -type ReplicationStatus struct { - // READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. - AggregatedState *AggregatedReplicationState - - // READ-ONLY; This is a summary of replication status for each region. - Summary []*RegionalReplicationStatus -} - -// RequestRateByIntervalInput - Api request input for LogAnalytics getRequestRateByInterval Api. -type RequestRateByIntervalInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; Interval value in minutes used to create LogAnalytics call rate logs. - IntervalLength *IntervalInMins - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// ResiliencyPolicy - Describes an resiliency policy - resilientVMCreationPolicy and/or resilientVMDeletionPolicy. -type ResiliencyPolicy struct { - // The configuration parameters used while performing resilient VM creation. - ResilientVMCreationPolicy *ResilientVMCreationPolicy - - // The configuration parameters used while performing resilient VM deletion. - ResilientVMDeletionPolicy *ResilientVMDeletionPolicy -} - -// ResilientVMCreationPolicy - The configuration parameters used while performing resilient VM creation. -type ResilientVMCreationPolicy struct { - // Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool -} - -// ResilientVMDeletionPolicy - The configuration parameters used while performing resilient VM deletion. -type ResilientVMDeletionPolicy struct { - // Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool -} - -// Resource - The Resource model definition. -type Resource struct { - // REQUIRED; Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ResourceInstanceViewStatus - Instance view status. -type ResourceInstanceViewStatus struct { - // The level code. - Level *StatusLevelTypes - - // READ-ONLY; The status code. - Code *string - - // READ-ONLY; The short localizable label for the status. - DisplayStatus *string - - // READ-ONLY; The detailed status message, including for alerts and error messages. - Message *string - - // READ-ONLY; The time of the status. - Time *time.Time -} - -// ResourceRange - Describes the resource range. -type ResourceRange struct { - // The maximum number of the resource. - Max *int32 - - // The minimum number of the resource. - Min *int32 -} - -// ResourceSKU - Describes an available Compute SKU. -type ResourceSKU struct { - // READ-ONLY; The api versions that support this SKU. - APIVersions []*string - - // READ-ONLY; A name value pair to describe the capability. - Capabilities []*ResourceSKUCapabilities - - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSKUCapacity - - // READ-ONLY; Metadata for retrieving price info. - Costs []*ResourceSKUCosts - - // READ-ONLY; The Family of this particular SKU. - Family *string - - // READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string - - // READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo []*ResourceSKULocationInfo - - // READ-ONLY; The set of locations that the SKU is available. - Locations []*string - - // READ-ONLY; The name of SKU. - Name *string - - // READ-ONLY; The type of resource the SKU applies to. - ResourceType *string - - // READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions []*ResourceSKURestrictions - - // READ-ONLY; The Size of the SKU. - Size *string - - // READ-ONLY; Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string -} - -// ResourceSKUCapabilities - Describes The SKU capabilities object. -type ResourceSKUCapabilities struct { - // READ-ONLY; An invariant to describe the feature. - Name *string - - // READ-ONLY; An invariant if the feature is measured by quantity. - Value *string -} - -// ResourceSKUCapacity - Describes scaling information of a SKU. -type ResourceSKUCapacity struct { - // READ-ONLY; The default capacity. - Default *int64 - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 - - // READ-ONLY; The minimum capacity. - Minimum *int64 - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *ResourceSKUCapacityScaleType -} - -// ResourceSKUCosts - Describes metadata for retrieving price info. -type ResourceSKUCosts struct { - // READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string - - // READ-ONLY; Used for querying price from commerce. - MeterID *string - - // READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 -} - -// ResourceSKULocationInfo - Describes an available Compute SKU Location Information. -type ResourceSKULocationInfo struct { - // READ-ONLY; The names of extended locations. - ExtendedLocations []*string - - // READ-ONLY; Location of the SKU - Location *string - - // READ-ONLY; The type of the extended location. - Type *ExtendedLocationType - - // READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails []*ResourceSKUZoneDetails - - // READ-ONLY; List of availability zones where the SKU is supported. - Zones []*string -} - -// ResourceSKURestrictionInfo - Describes an available Compute SKU Restriction Information. -type ResourceSKURestrictionInfo struct { - // READ-ONLY; Locations where the SKU is restricted - Locations []*string - - // READ-ONLY; List of availability zones where the SKU is restricted. - Zones []*string -} - -// ResourceSKURestrictions - Describes scaling information of a SKU. -type ResourceSKURestrictions struct { - // READ-ONLY; The reason for restriction. - ReasonCode *ResourceSKURestrictionsReasonCode - - // READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSKURestrictionInfo - - // READ-ONLY; The type of restrictions. - Type *ResourceSKURestrictionsType - - // 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 -} - -// ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU. -type ResourceSKUZoneDetails struct { - // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities []*ResourceSKUCapabilities - - // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name []*string -} - -// ResourceSKUsResult - The List Resource Skus operation response. -type ResourceSKUsResult struct { - // REQUIRED; The list of skus available for the subscription. - Value []*ResourceSKU - - // 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 -} - -type ResourceSharingProfile struct { - // Specifies an array of subscription resource IDs that capacity reservation group is shared with. Note: Minimum api-version: - // 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more - // details. - SubscriptionIDs []*SubResource -} - -// ResourceURIList - The List resources which are encrypted with the disk encryption set. -type ResourceURIList struct { - // REQUIRED; A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. - Value []*string - - // The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. - NextLink *string -} - -// ResourceWithOptionalLocation - The Resource model definition with location property as optional. -type ResourceWithOptionalLocation struct { - // Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePoint - Restore Point details. -type RestorePoint struct { - // The restore point properties. - Properties *RestorePointProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePointCollection - Create or update Restore Point collection parameters. -type RestorePointCollection struct { - // REQUIRED; Resource location - Location *string - - // The restore point collection properties. - Properties *RestorePointCollectionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePointCollectionListResult - The List restore point collection operation response. -type RestorePointCollectionListResult struct { - // The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections - NextLink *string - - // Gets the list of restore point collections. - Value []*RestorePointCollection -} - -// RestorePointCollectionProperties - The restore point collection properties. -type RestorePointCollectionProperties struct { - // The properties of the source resource that this restore point collection is created from. - Source *RestorePointCollectionSourceProperties - - // READ-ONLY; The provisioning state of the restore point collection. - ProvisioningState *string - - // READ-ONLY; The unique id of the restore point collection. - RestorePointCollectionID *string - - // READ-ONLY; A list containing all restore points created under this restore point collection. - RestorePoints []*RestorePoint -} - -// RestorePointCollectionSourceProperties - The properties of the source resource that this restore point collection is created -// from. -type RestorePointCollectionSourceProperties struct { - // Resource Id of the source resource used to create this restore point collection - ID *string - - // READ-ONLY; Location of the source resource used to create this restore point collection. - Location *string -} - -// RestorePointCollectionUpdate - Update Restore Point collection parameters. -type RestorePointCollectionUpdate struct { - // The restore point collection properties. - Properties *RestorePointCollectionProperties - - // Resource tags - Tags map[string]*string -} - -// RestorePointEncryption - Encryption at rest settings for disk restore point. It is an optional property that can be specified -// in the input while creating a restore point. -type RestorePointEncryption struct { - // 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. - DiskEncryptionSet *DiskEncryptionSetParameters - - // The type of key used to encrypt the data of the disk restore point. - Type *RestorePointEncryptionType -} - -// RestorePointInstanceView - The instance view of a restore point. -type RestorePointInstanceView struct { - // The disk restore points information. - DiskRestorePoints []*DiskRestorePointInstanceView - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// RestorePointProperties - The restore point properties. -type RestorePointProperties struct { - // ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent - // is accepted as a valid input. Please refer to - // https://aka.ms/RestorePoints for more details. - ConsistencyMode *ConsistencyModeTypes - - // List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks - // will be included. - ExcludeDisks []*APIEntityReference - - // Gets the details of the VM captured at the time of the restore point creation. - SourceMetadata *RestorePointSourceMetadata - - // Resource Id of the source restore point from which a copy needs to be created. - SourceRestorePoint *APIEntityReference - - // Gets the creation time of the restore point. - TimeCreated *time.Time - - // READ-ONLY; The restore point instance view. - InstanceView *RestorePointInstanceView - - // READ-ONLY; Gets the provisioning state of the restore point. - ProvisioningState *string -} - -// RestorePointSourceMetadata - Describes the properties of the Virtual Machine for which the restore point was created. The -// properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the -// time of the restore point creation. -type RestorePointSourceMetadata struct { - // Gets the storage profile. - StorageProfile *RestorePointSourceVMStorageProfile - - // READ-ONLY; Gets the diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile - - // READ-ONLY; Gets the hardware profile. - HardwareProfile *HardwareProfile - - // READ-ONLY; HyperVGeneration of the source VM for which restore point is captured. - HyperVGeneration *HyperVGenerationTypes - - // READ-ONLY; Gets the license type, which is for bring your own license scenario. - LicenseType *string - - // READ-ONLY; Location of the VM from which the restore point was created. - Location *string - - // READ-ONLY; Gets the OS profile. - OSProfile *OSProfile - - // READ-ONLY; Gets the security profile. - SecurityProfile *SecurityProfile - - // READ-ONLY; UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. - UserData *string - - // READ-ONLY; Gets the virtual machine unique id. - VMID *string -} - -// RestorePointSourceVMDataDisk - Describes a data disk. -type RestorePointSourceVMDataDisk struct { - // Contains Disk Restore Point properties. - DiskRestorePoint *DiskRestorePointAttributes - - // Contains the managed disk details. - ManagedDisk *ManagedDiskParameters - - // READ-ONLY; Gets the caching type. - Caching *CachingTypes - - // READ-ONLY; Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - DiskSizeGB *int32 - - // READ-ONLY; Gets the logical unit number. - Lun *int32 - - // READ-ONLY; Gets the disk name. - Name *string - - // READ-ONLY; Shows true if the disk is write-accelerator enabled. - WriteAcceleratorEnabled *bool -} - -// RestorePointSourceVMOSDisk - Describes an Operating System disk. -type RestorePointSourceVMOSDisk struct { - // Contains Disk Restore Point properties. - DiskRestorePoint *DiskRestorePointAttributes - - // Gets the managed disk details - ManagedDisk *ManagedDiskParameters - - // READ-ONLY; Gets the caching type. - Caching *CachingTypes - - // READ-ONLY; Gets the disk size in GB. - DiskSizeGB *int32 - - // READ-ONLY; Gets the disk encryption settings. - EncryptionSettings *DiskEncryptionSettings - - // READ-ONLY; Gets the disk name. - Name *string - - // READ-ONLY; Gets the Operating System type. - OSType *OperatingSystemType - - // READ-ONLY; Shows true if the disk is write-accelerator enabled. - WriteAcceleratorEnabled *bool -} - -// RestorePointSourceVMStorageProfile - Describes the storage profile. -type RestorePointSourceVMStorageProfile struct { - // Gets the data disks of the VM captured at the time of the restore point creation. - DataDisks []*RestorePointSourceVMDataDisk - - // Gets the OS disk of the VM captured at the time of the restore point creation. - OSDisk *RestorePointSourceVMOSDisk - - // READ-ONLY; Gets the disk controller type of the VM captured at the time of the restore point creation. - DiskControllerType *DiskControllerTypes -} - -// RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs. -type RetrieveBootDiagnosticsDataResult struct { - // READ-ONLY; The console screenshot blob URI - ConsoleScreenshotBlobURI *string - - // READ-ONLY; The serial console log blob URI. - SerialConsoleLogBlobURI *string -} - -// RoleInstance - Describes the cloud service role instance. -type RoleInstance struct { - // Role instance properties. - Properties *RoleInstanceProperties - - // The role instance SKU. - SKU *InstanceSKU - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource Location. - Location *string - - // READ-ONLY; Resource Name. - Name *string - - // READ-ONLY; Resource tags. - Tags map[string]*string - - // READ-ONLY; Resource Type. - Type *string -} - -// RoleInstanceListResult - The list operation result. -type RoleInstanceListResult struct { - // REQUIRED; The list of resources. - Value []*RoleInstance - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// RoleInstanceNetworkProfile - Describes the network profile for the role instance. -type RoleInstanceNetworkProfile struct { - // READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. - NetworkInterfaces []*SubResource -} - -// RoleInstanceProperties - Role instance properties. -type RoleInstanceProperties struct { - // The instance view of the role instance. - InstanceView *RoleInstanceView - - // Describes the network profile for the role instance. - NetworkProfile *RoleInstanceNetworkProfile -} - -// RoleInstanceView - The instance view of the role instance. -type RoleInstanceView struct { - // READ-ONLY; The Fault Domain. - PlatformFaultDomain *int32 - - // READ-ONLY; The Update Domain. - PlatformUpdateDomain *int32 - - // READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateID *string - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus -} - -// RoleInstances - Specifies a list of role instances from the cloud service. -type RoleInstances struct { - // REQUIRED; List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. - RoleInstances []*string -} - -// RollbackStatusInfo - Information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 - - // READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError - - // READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 -} - -// RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent - // to determine the batch size. - EnableCrossZoneUpgrade *bool - - // 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 - - // Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual - // machines will be deleted once the new virtual machines are created for each - // batch. - MaxSurge *bool - - // 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 - - // 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 - - // 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 - - // Upgrade all unhealthy instances in a scale set before any healthy instances. - PrioritizeUnhealthyInstances *bool - - // Rollback failed instances to previous model if the Rolling Upgrade policy is violated. - RollbackFailedInstancesOnPolicyBreach *bool -} - -// RollingUpgradeProgressInfo - Information about the number of virtual machine instances in each upgrade state. -type RollingUpgradeProgressInfo struct { - // READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 - - // READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 - - // READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 - - // READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 -} - -// RollingUpgradeRunningStatus - Information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *RollingUpgradeStatusCode - - // READ-ONLY; The last action performed on the rolling upgrade. - LastAction *RollingUpgradeActionType - - // READ-ONLY; Last action time of the upgrade. - LastActionTime *time.Time - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time -} - -// RollingUpgradeStatusInfo - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - // REQUIRED; Resource location - Location *string - - // The status of the latest virtual machine scale set rolling upgrade. - Properties *RollingUpgradeStatusInfoProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RollingUpgradeStatusInfoProperties - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfoProperties struct { - // READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError - - // READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy - - // READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo - - // READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus -} - -// RunCommandDocument - Describes the properties of a Run Command. -type RunCommandDocument struct { - // REQUIRED; The VM run command description. - Description *string - - // REQUIRED; The VM run command id. - ID *string - - // REQUIRED; The VM run command label. - Label *string - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes - - // REQUIRED; The VM run command schema. - Schema *string - - // REQUIRED; The script to be executed. - Script []*string - - // The parameters used by the script. - Parameters []*RunCommandParameterDefinition -} - -// RunCommandDocumentBase - Describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // REQUIRED; The VM run command description. - Description *string - - // REQUIRED; The VM run command id. - ID *string - - // REQUIRED; The VM run command label. - Label *string - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes - - // REQUIRED; The VM run command schema. - Schema *string -} - -// RunCommandInput - Capture Virtual Machine parameters. -type RunCommandInput struct { - // REQUIRED; The run command id. - CommandID *string - - // The run command parameters. - Parameters []*RunCommandInputParameter - - // Optional. The script to be executed. When this value is given, the given script will override the default script of the - // command. - Script []*string -} - -// RunCommandInputParameter - Describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // REQUIRED; The run command parameter name. - Name *string - - // REQUIRED; The run command parameter value. - Value *string -} - -// RunCommandListResult - The List Virtual Machine operation response. -type RunCommandListResult struct { - // REQUIRED; The list of virtual machine run commands. - Value []*RunCommandDocumentBase - - // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string -} - -// RunCommandManagedIdentity - Contains clientId or objectId (use only one, not both) of a user-assigned managed identity -// that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of -// system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given -// access to blob's container with 'Storage Blob Data Reader' role assignment -// with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user -// assigned identity, make sure you add it under VM's identity. For more info on -// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. -type RunCommandManagedIdentity struct { - // Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - ClientID *string - - // Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - ObjectID *string -} - -// RunCommandParameterDefinition - Describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // REQUIRED; The run command parameter name. - Name *string - - // REQUIRED; The run command parameter type. - Type *string - - // The run command parameter default value. - DefaultValue *string - - // The run command parameter required. - Required *bool -} - -type RunCommandResult struct { - // Run command operation response. - Value []*InstanceViewStatus -} - -// 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 { - // Specifies the number of virtual machines in the scale set. - Capacity *int64 - - // The sku name. - Name *string - - // Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string -} - -// SSHConfiguration - SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys []*SSHPublicKey -} - -// SSHGenerateKeyPairInputParameters - Parameters for GenerateSshKeyPair. -type SSHGenerateKeyPairInputParameters struct { - // The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, - // will default to RSA - EncryptionType *SSHEncryptionTypes -} - -// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key -// is placed. -type SSHPublicKey struct { - // 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/linux/create-ssh-keys-detailed). - KeyData *string - - // 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 -} - -// SSHPublicKeyGenerateKeyPairResult - Response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - // REQUIRED; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string - - // REQUIRED; Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is - // returned in RFC3447 format and should be treated as a secret. - PrivateKey *string - - // REQUIRED; Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in - // ssh-rsa format. - PublicKey *string -} - -// SSHPublicKeyResource - Specifies information about the SSH public key. -type SSHPublicKeyResource struct { - // REQUIRED; Resource location - Location *string - - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// SSHPublicKeyResourceProperties - Properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the - // resource is created, the publicKey property will be populated when - // generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at - // least 2048-bit and in ssh-rsa format. - PublicKey *string -} - -// SSHPublicKeyUpdateResource - Specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties - - // Resource tags - Tags map[string]*string -} - -// SSHPublicKeysGroupListResult - The list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - // REQUIRED; The list of SSH public keys - Value []*SSHPublicKeyResource - - // The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. - NextLink *string -} - -// ScaleInPolicy - Describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine - // scale set is being scaled-in.(Feature in Preview) - ForceDeletion *bool - - // 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 -} - -type ScheduledEventsAdditionalPublishingTargets struct { - // The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. - EventGridAndResourceGraph *EventGridAndResourceGraph -} - -// ScheduledEventsPolicy - Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related -// configurations. -type ScheduledEventsPolicy struct { - // The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. - ScheduledEventsAdditionalPublishingTargets *ScheduledEventsAdditionalPublishingTargets - - // The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. - UserInitiatedReboot *UserInitiatedReboot - - // The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. - UserInitiatedRedeploy *UserInitiatedRedeploy -} - -type ScheduledEventsProfile struct { - // Specifies OS Image Scheduled Event related configurations. - OSImageNotificationProfile *OSImageNotificationProfile - - // Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile -} - -// SecurityPostureReference - Specifies the security posture to be used for all virtual machines in the scale set. Minimum -// api-version: 2023-03-01 -type SecurityPostureReference struct { - // List of virtual machine extensions to exclude when applying the Security Posture. - ExcludeExtensions []*VirtualMachineExtension - - // The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest - ID *string -} - -// SecurityProfile - Specifies the Security profile settings for the virtual machine or virtual machine scale set. -type SecurityProfile struct { - // This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual - // machine scale set. This will enable the encryption for all the disks - // including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this - // property is set to true for the resource. - EncryptionAtHost *bool - - // Specifies the Managed Identity used by ADE to get access token for keyvault operations. - EncryptionIdentity *EncryptionIdentity - - // Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. - ProxyAgentSettings *ProxyAgentSettings - - // Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The - // default behavior is: UefiSettings will not be enabled unless this property is - // set. - SecurityType *SecurityTypes - - // Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: - // 2020-12-01. - UefiSettings *UefiSettings -} - -// ServiceArtifactReference - Specifies the service artifact reference id used to set same image version for all virtual machines -// in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 -type ServiceArtifactReference struct { - // The service artifact reference id in the form of - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} - ID *string -} - -type ShareInfoElement struct { - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string -} - -// SharedGallery - Specifies information about the Shared Gallery that you want to create or update. -type SharedGallery struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Specifies the properties of a shared gallery - Properties *SharedGalleryProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryDataDiskImage - This is the data disk image. -type SharedGalleryDataDiskImage struct { - // REQUIRED; 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 - - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryDiskImage - This is the disk image base class. -type SharedGalleryDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryIdentifier - The identifier information of shared gallery. -type SharedGalleryIdentifier struct { - // The unique id of this shared gallery. - UniqueID *string -} - -// SharedGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type SharedGalleryImage struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Describes the properties of a gallery image definition. - Properties *SharedGalleryImageProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryImageList - The List Shared Gallery Images operation response. -type SharedGalleryImageList struct { - // REQUIRED; A list of shared gallery images. - Value []*SharedGalleryImage - - // The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery - // images. - NextLink *string -} - -// SharedGalleryImageProperties - Describes the properties of a gallery image definition. -type SharedGalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; 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. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // End-user license agreement for the current community gallery image. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Privacy statement uri for the current community gallery image. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration -} - -// SharedGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type SharedGalleryImageVersion struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Describes the properties of a gallery image version. - Properties *SharedGalleryImageVersionProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryImageVersionList - The List Shared Gallery Image versions operation response. -type SharedGalleryImageVersionList struct { - // REQUIRED; A list of shared gallery images versions. - Value []*SharedGalleryImageVersion - - // The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared - // gallery image versions. - NextLink *string -} - -// SharedGalleryImageVersionProperties - Describes the properties of a gallery image version. -type SharedGalleryImageVersionProperties struct { - // The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string - - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time - - // Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile -} - -// SharedGalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. -type SharedGalleryImageVersionStorageProfile struct { - // A list of data disk images. - DataDiskImages []*SharedGalleryDataDiskImage - - // This is the OS disk image. - OSDiskImage *SharedGalleryOSDiskImage -} - -// SharedGalleryList - The List Shared Galleries operation response. -type SharedGalleryList struct { - // REQUIRED; A list of shared galleries. - Value []*SharedGallery - - // The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. - NextLink *string -} - -// SharedGalleryOSDiskImage - This is the OS disk image. -type SharedGalleryOSDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryProperties - Specifies the properties of a shared gallery -type SharedGalleryProperties struct { - // READ-ONLY; The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string -} - -// SharingProfile - Profile for gallery sharing to subscription or tenant -type SharingProfile struct { - // Information of community gallery if current gallery is shared to community. - CommunityGalleryInfo *CommunityGalleryInfo - - // This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community. - Permissions *GallerySharingPermissionTypes - - // READ-ONLY; A list of sharing profile groups. - Groups []*SharingProfileGroup -} - -// SharingProfileGroup - Group of the gallery sharing profile -type SharingProfileGroup struct { - // A list of subscription/tenant ids the gallery is aimed to be shared to. - IDs []*string - - // This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants. - Type *SharingProfileGroupTypes -} - -// SharingStatus - Sharing status of current gallery. -type SharingStatus struct { - // Summary of all regional sharing status. - Summary []*RegionalSharingStatus - - // READ-ONLY; Aggregated sharing state of current gallery. - AggregatedState *SharingState -} - -// SharingUpdate - Specifies information about the gallery sharing profile update. -type SharingUpdate struct { - // REQUIRED; This property allows you to specify the operation type of gallery sharing update. Possible values are: Add, Remove, - // Reset. - OperationType *SharingUpdateOperationTypes - - // A list of sharing profile groups. - Groups []*SharingProfileGroup -} - -// Snapshot resource. -type Snapshot struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the snapshot will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - - // Snapshot resource properties. - Properties *SnapshotProperties - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Unused. Always Null. - ManagedBy *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// SnapshotList - The List Snapshots operation response. -type SnapshotList struct { - // REQUIRED; A list of snapshots. - Value []*Snapshot - - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string -} - -// SnapshotProperties - Snapshot resource properties. -type SnapshotProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 - - // Indicates the error details if the background copy of a resource created via the CopyStart operation fails. - CopyCompletionError *CopyCompletionError - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // 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 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can - // be diffed. - Incremental *bool - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // The Operating System type. - OSType *OperatingSystemTypes - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the image from which the source disk for the snapshot was originally created. - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the source disk from the snapshot was originally created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 - - // READ-ONLY; The state of the snapshot. - DiskState *DiskState - - // READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only - // be called on incremental snapshots with the same family id. - IncrementalSnapshotFamilyID *string - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string - - // READ-ONLY; The time when the snapshot was created. - TimeCreated *time.Time - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string -} - -// SnapshotSKU - The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for -// incremental snapshot and the default behavior is the SKU will be set to the same sku as the -// previous snapshot -type SnapshotSKU struct { - // The sku name. - Name *SnapshotStorageAccountTypes - - // READ-ONLY; The sku tier. - Tier *string -} - -// SnapshotUpdate - Snapshot update resource. -type SnapshotUpdate struct { - // Snapshot resource update properties. - Properties *SnapshotUpdateProperties - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU - - // Resource tags - Tags map[string]*string -} - -// SnapshotUpdateProperties - Snapshot resource update properties. -type SnapshotUpdateProperties struct { - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // 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 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // the Operating System type. - OSType *OperatingSystemTypes - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool -} - -// SoftDeletePolicy - Contains information about the soft deletion policy of the gallery. -type SoftDeletePolicy struct { - // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. - IsSoftDeleteEnabled *bool -} - -// 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 { - // Resource Id - ID *string -} - -// SpotRestorePolicy - Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer -// can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically -// based on capacity availability and pricing constraint. -type SpotRestorePolicy struct { - // Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based - // on capacity availability and pricing constraints - Enabled *bool - - // Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances - RestoreTimeout *string -} - -// StatusCodeCount - The status code and count of the cloud service instance view statuses -type StatusCodeCount struct { - // READ-ONLY; The instance view status code - Code *string - - // READ-ONLY; Number of instances having this status code - Count *int32 -} - -// StorageProfile - Specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // 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/managed-disks-overview]. - DataDisks []*DataDisk - - // Specifies the disk controller type configured for the VM. Note: This property will be set to the default disk controller - // type if not specified provided virtual machine is being created with - // 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified - // minimum api version. You need to deallocate the VM before updating its disk - // controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates - // the VM. Minimum api-version: 2022-08-01. - DiskControllerType *DiskControllerTypes - - // 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 - - // 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/managed-disks-overview]. - OSDisk *OSDisk -} - -type SubResource struct { - // Resource Id - ID *string -} - -type SubResourceReadOnly struct { - // READ-ONLY; Resource Id - ID *string -} - -type SubResourceWithColocationStatus struct { - // Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus - - // Resource Id - ID *string -} - -// SupportedCapabilities - List of supported capabilities persisted on the disk resource for VM use. -type SupportedCapabilities struct { - // True if the image from which the OS disk is created supports accelerated networking. - AcceleratedNetwork *bool - - // CPU architecture supported by an OS disk. - Architecture *Architecture - - // The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. - DiskControllerTypes *string -} - -// SystemData - The system meta data relating to this resource. -type SystemData struct { - // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created. - // Minimum api-version: 2022-04-04. - CreatedAt *time.Time - - // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified. - // Minimum api-version: 2022-04-04. - LastModifiedAt *time.Time -} - -// TargetRegion - Describes the target region information. -type TargetRegion struct { - // REQUIRED; The name of the region. - Name *string - - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages - - // Contains the flag setting to hide an image when users specify version='latest' - ExcludeFromLatest *bool - - // The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType -} - -type TerminateNotificationProfile struct { - // Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool - - // 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 -} - -// ThrottledRequestsInput - Api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// UefiKey - A UEFI key signature. -type UefiKey struct { - // The type of key signature. - Type *UefiKeyType - - // The value of the key signature. - Value []*string -} - -// UefiKeySignatures - Additional UEFI key signatures that will be added to the image in addition to the signature templates -type UefiKeySignatures struct { - // The database of UEFI keys for this image version. - Db []*UefiKey - - // The database of revoked UEFI keys for this image version. - Dbx []*UefiKey - - // The Key Encryption Keys of this image version. - Kek []*UefiKey - - // The Platform Key of this image version. - Pk *UefiKey -} - -// UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum -// api-version: 2020-12-01. -type UefiSettings struct { - // Specifies whether secure boot should be enabled on the virtual machine. Minimum api-version: 2020-12-01. - SecureBootEnabled *bool - - // Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01. - VTpmEnabled *bool -} - -// UpdateDomain - Defines an update domain for the cloud service. -type UpdateDomain struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource Name - Name *string -} - -// UpdateDomainListResult - The list operation result. -type UpdateDomainListResult struct { - // REQUIRED; The list of resources. - Value []*UpdateDomain - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// UpdateResource - The Update Resource model definition. -type UpdateResource struct { - // Resource tags - Tags map[string]*string -} - -// UpdateResourceDefinition - The Update Resource model definition. -type UpdateResourceDefinition struct { - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// UpgradeOperationHistoricalStatusInfo - Virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties - - // READ-ONLY; Resource type - Type *string -} - -// UpgradeOperationHistoricalStatusInfoProperties - Describes each OS upgrade on the Virtual Machine Scale Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError - - // READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo - - // READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo - - // READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus - - // READ-ONLY; Invoker of the Upgrade Operation - StartedBy *UpgradeOperationInvoker - - // READ-ONLY; Image Reference details - TargetImageReference *ImageReference -} - -// UpgradeOperationHistoryStatus - Information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *UpgradeState - - // READ-ONLY; End time of the upgrade. - EndTime *time.Time - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time -} - -// UpgradePolicy - Describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy - - // 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. - Mode *UpgradeMode - - // The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy -} - -// Usage - Describes Compute Resource Usage. -type Usage struct { - // REQUIRED; The current usage of the resource. - CurrentValue *int32 - - // REQUIRED; The maximum permitted usage of the resource. - Limit *int64 - - // REQUIRED; The name of the type of usage. - Name *UsageName - - // REQUIRED; An enum describing the unit of usage measurement. - Unit *string -} - -// UsageName - The Usage Names. -type UsageName struct { - // The localized name of the resource. - LocalizedValue *string - - // The name of the resource. - Value *string -} - -type UserArtifactManage struct { - // REQUIRED; Required. The path and arguments to install the gallery application. This is limited to 4096 characters. - Install *string - - // REQUIRED; Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. - Remove *string - - // Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove - // command on the previous version and install command on the current version - // of the gallery application. This is limited to 4096 characters. - Update *string -} - -// UserArtifactSettings - Additional settings for the VM app that contains the target package and config file name when it -// is deployed to target VM or VM scale set. -type UserArtifactSettings struct { - // Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, - // the config file will be named the Gallery Application name appended with - // "_config". - ConfigFileName *string - - // Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, - // the package file will be named the same as the Gallery Application name. - PackageFileName *string -} - -// UserArtifactSource - The source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob. - MediaLink *string - - // Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. - DefaultConfigurationLink *string -} - -type UserAssignedIdentitiesValue struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string - - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string -} - -// UserInitiatedReboot - Specifies Reboot related Scheduled Event related configurations. -type UserInitiatedReboot struct { - // Specifies Reboot Scheduled Event related configurations. - AutomaticallyApprove *bool -} - -// UserInitiatedRedeploy - Specifies Redeploy related Scheduled Event related configurations. -type UserInitiatedRedeploy struct { - // Specifies Redeploy Scheduled Event related configurations. - AutomaticallyApprove *bool -} - -// VMDiskSecurityProfile - Specifies the security profile settings for the managed disk. Note: It can only be set for Confidential -// VMs. -type VMDiskSecurityProfile struct { - // Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key - // encrypted ConfidentialVM OS Disk and VMGuest blob. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk - // along with VMGuestState blob, VMGuestStateOnly for encryption of just the - // VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set - // for only Confidential VMs. - SecurityEncryptionType *SecurityEncryptionTypes -} - -// VMGalleryApplication - Specifies the required information to reference a compute gallery application version -type VMGalleryApplication struct { - // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of - // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - PackageReferenceID *string - - // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided - ConfigurationReference *string - - // If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the - // VM/VMSS - EnableAutomaticUpgrade *bool - - // Optional, Specifies the order in which the packages have to be installed - Order *int32 - - // Optional, Specifies a passthrough value for more generic context. - Tags *string - - // Optional, If true, any failure for any operation in the VmApplication will fail the deployment - TreatFailureAsDeploymentFailure *bool -} - -// VMImagesInEdgeZoneListResult - The List VmImages in EdgeZone operation response. -type VMImagesInEdgeZoneListResult struct { - // The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. - NextLink *string - - // The list of VMImages in EdgeZone - Value []*VirtualMachineImageResource -} - -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // 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 -} - -// VMSizeProperties - Specifies VM Size Property settings on the virtual machine. -type VMSizeProperties struct { - // Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default - // behavior is to set it to the value of vCPUs available for that VM size exposed - // in api response of List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. - VCPUsAvailable *int32 - - // Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior - // is set to the value of vCPUsPerCore for the VM Size exposed in api response of - // List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. - // Setting this property to 1 also means that hyper-threading is disabled. - VCPUsPerCore *int32 -} - -// VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on -// the VM. -type VaultCertificate struct { - // 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 .crt - // for the X509 certificate file and .prv for private key. Both - // of these files are .pem formatted. - CertificateStore *string - - // 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":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string -} - -// VaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*VaultCertificate -} - -// VirtualHardDisk - Describes the uri of a disk. -type VirtualHardDisk struct { - // Specifies the virtual hard disk's uri. - URI *string -} - -// VirtualMachine - Describes a Virtual Machine. -type VirtualMachine struct { - // REQUIRED; Resource location - Location *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // 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 - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties - - // Resource tags - Tags map[string]*string - - // The virtual machine zones. - Zones []*string - - // READ-ONLY; Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header - // to ensure optimistic updates. - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This - // property is used by platform for internal resource group delete optimization. - ManagedBy *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineAgentInstanceView - The instance view of the VM Agent running on the virtual machine. -type VirtualMachineAgentInstanceView struct { - // The virtual machine extension handler instance view. - ExtensionHandlers []*VirtualMachineExtensionHandlerInstanceView - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent full version. - VMAgentVersion *string -} - -// VirtualMachineAssessPatchesResult - Describes the properties of an AssessPatches result. -type VirtualMachineAssessPatchesResult struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string - - // READ-ONLY; The list of patches that have been detected as available for installation. - AvailablePatches []*VirtualMachineSoftwarePatchProperties - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// VirtualMachineCaptureParameters - Capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // REQUIRED; The destination container name. - DestinationContainerName *string - - // REQUIRED; Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool - - // REQUIRED; The captured virtual hard disk's name prefix. - VhdPrefix *string -} - -// VirtualMachineCaptureResult - Output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - // Resource Id - ID *string - - // READ-ONLY; the version of the content - ContentVersion *string - - // READ-ONLY; parameters of the captured virtual machine - Parameters any - - // READ-ONLY; a list of resource items of the captured virtual machine - Resources []any - - // READ-ONLY; the schema of the captured virtual machine - Schema *string -} - -// VirtualMachineExtension - Describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - // Resource location - Location *string - - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineExtensionHandlerInstanceView - The instance view of a virtual machine extension handler. -type VirtualMachineExtensionHandlerInstanceView struct { - // The extension handler status. - Status *InstanceViewStatus - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionImage - Describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Virtual Machine Extension Image. - Properties *VirtualMachineExtensionImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineExtensionImageProperties - Describes the properties of a Virtual Machine Extension Image. -type VirtualMachineExtensionImageProperties struct { - // REQUIRED; The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string - - // REQUIRED; The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string - - // REQUIRED; The operating system this extension supports. - OperatingSystem *string - - // Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool - - // 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 -} - -// VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // The virtual machine extension name. - Name *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The resource status information. - Substatuses []*InstanceViewStatus - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // 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 - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string - - // The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions []*string - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// VirtualMachineExtensionUpdate - Describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineExtensionUpdateProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // 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 - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionsListResult - The List Extension operation response -type VirtualMachineExtensionsListResult struct { - // The list of extensions - Value []*VirtualMachineExtension -} - -// VirtualMachineHealthStatus - The health status of the VM. -type VirtualMachineHealthStatus struct { - // READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus -} - -// VirtualMachineIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string -} - -// VirtualMachineIdentity - Identity for the virtual machine. -type VirtualMachineIdentity struct { - // 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. - Type *ResourceIdentityType - - // 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]*UserAssignedIdentitiesValue - - // READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string - - // READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned - // identity. - TenantID *string -} - -// VirtualMachineImage - Describes a Virtual Machine Image. -type VirtualMachineImage struct { - // REQUIRED; The supported Azure location of the resource. - Location *string - - // REQUIRED; The name of the resource. - Name *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // Resource Id - ID *string - - // Describes the properties of a Virtual Machine Image. - Properties *VirtualMachineImageProperties - - // 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 -} - -// VirtualMachineImageFeature - Specifies additional capabilities supported by the image -type VirtualMachineImageFeature struct { - // The name of the feature. - Name *string - - // The corresponding value for the feature. - Value *string -} - -// VirtualMachineImageProperties - Describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - // Specifies the Architecture Type - Architecture *ArchitectureTypes - - // Describes automatic OS upgrade properties on the image. - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties - DataDiskImages []*DataDiskImage - - // Specifies disallowed configuration for the VirtualMachine created from the image - Disallowed *DisallowedConfiguration - Features []*VirtualMachineImageFeature - - // Specifies the HyperVGeneration Type - HyperVGeneration *HyperVGenerationTypes - - // Describes image deprecation status properties on the image. - ImageDeprecationStatus *ImageDeprecationStatus - - // Contains the os disk image information. - OSDiskImage *OSDiskImage - - // Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - Plan *PurchasePlan -} - -// VirtualMachineImageResource - Virtual machine image resource information. -type VirtualMachineImageResource struct { - // REQUIRED; The supported Azure location of the resource. - Location *string - - // REQUIRED; The name of the resource. - Name *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // Resource Id - ID *string - - // 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 -} - -// VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API -type VirtualMachineInstallPatchesParameters struct { - // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation. - RebootSetting *VMGuestPatchRebootSetting - - // Input for InstallPatches on a Linux VM, as directly received by the API - LinuxParameters *LinuxParameters - - // Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such - // as PT4H (4 hours) - MaximumDuration *string - - // Input for InstallPatches on a Windows VM, as directly received by the API - WindowsParameters *WindowsParameters -} - -// VirtualMachineInstallPatchesResult - The result summary of an installation operation. -type VirtualMachineInstallPatchesResult struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of patches that were not installed due to the user blocking their installation. - ExcludedPatchCount *int32 - - // READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. - FailedPatchCount *int32 - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string - - // READ-ONLY; The number of patches successfully installed. - InstalledPatchCount *int32 - - // READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. - MaintenanceWindowExceeded *bool - - // READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. - NotSelectedPatchCount *int32 - - // READ-ONLY; The patches that were installed during the operation. - Patches []*PatchInstallationDetail - - // READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. - // Typically this happens when maintenanceWindowExceeded == true. - PendingPatchCount *int32 - - // READ-ONLY; The reboot state of the VM following completion of the operation. - RebootStatus *VMGuestPatchRebootStatus - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// VirtualMachineInstanceView - The instance view of a virtual machine. -type VirtualMachineInstanceView struct { - // 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 - - // The computer name assigned to the virtual machine. - ComputerName *string - - // The virtual machine disk information. - Disks []*DiskInstanceView - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView - - // Specifies the HyperVGeneration Type associated with a resource - HyperVGeneration *HyperVGenerationType - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus - - // The Operating System running on the virtual machine. - OSName *string - - // The version of Operating System running on the virtual machine. - OSVersion *string - - // [Preview Feature] The status of virtual machine patch operations. - PatchStatus *VirtualMachinePatchStatus - - // Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 - - // Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. Minimum api-version: 2020-06-01. - AssignedHost *string - - // READ-ONLY; [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. - IsVMInStandbyPool *bool - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus -} - -// VirtualMachineListResult - The List Virtual Machine operation response. -type VirtualMachineListResult struct { - // REQUIRED; The list of virtual machines. - Value []*VirtualMachine - - // The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string -} - -// VirtualMachineNetworkInterfaceConfiguration - Describes a virtual machine network interface configurations. -type VirtualMachineNetworkInterfaceConfiguration struct { - // REQUIRED; The network interface configuration name. - Name *string - - // Describes a virtual machine network profile's IP configuration. - Properties *VirtualMachineNetworkInterfaceConfigurationProperties -} - -// VirtualMachineNetworkInterfaceConfigurationProperties - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineNetworkInterfaceIPConfiguration - - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - DscpConfiguration *SubResource - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The network security group. - NetworkSecurityGroup *SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// VirtualMachineNetworkInterfaceDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { - // List of DNS servers IP addresses - DNSServers []*string -} - -// VirtualMachineNetworkInterfaceIPConfiguration - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string - - // Describes a virtual machine network interface IP configuration properties. - Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties -} - -// VirtualMachineNetworkInterfaceIPConfigurationProperties - Describes a virtual machine network interface IP configuration -// properties. -type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { - // Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend - // address pools of multiple application gateways. Multiple virtual machines - // cannot use the same application gateway. - ApplicationGatewayBackendAddressPools []*SubResource - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address - // pools of one public and one internal load balancer. [Multiple virtual - // machines cannot use the same basic sku load balancer]. - LoadBalancerBackendAddressPools []*SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool - - // 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'. - PrivateIPAddressVersion *IPVersions - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration - - // Specifies the identifier of the subnet. - Subnet *SubResource -} - -// VirtualMachinePatchStatus - The status of virtual machine patch operations. -type VirtualMachinePatchStatus struct { - // The available patch summary of the latest assessment operation for the virtual machine. - AvailablePatchSummary *AvailablePatchSummary - - // The installation summary of the latest installation operation for the virtual machine. - LastPatchInstallationSummary *LastPatchInstallationSummary - - // READ-ONLY; The enablement status of the specified patchMode - ConfigurationStatuses []*InstanceViewStatus -} - -// VirtualMachineProperties - Describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities - - // Specifies the gallery applications that should be made available to the VM/VMSS. - ApplicationProfile *ApplicationProfile - - // 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure - // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. - // 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 - - // Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, - // both 'Deallocate' and 'Delete' are supported 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. - EvictionPolicy *VirtualMachineEvictionPolicyTypes - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). Minimum api-version: 2020-06-01. - ExtensionsTimeBudget *string - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile - - // Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. - Host *SubResource - - // Specifies information about the dedicated host group that the virtual machine resides in. Note: User cannot specify both - // host and hostGroup properties. Minimum api-version: 2020-06-01. - HostGroup *SubResource - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile - - // Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed - // once VM is provisioned. - OSProfile *OSProfile - - // Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine - // will by automatically assigned to a fault domain that best maintains - // balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual - // Machine is set. The Virtual Machine Scale Set that is referenced, must have - // 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain - // assignment can be viewed in the Virtual Machine Instance View. Minimum - // api‐version: 2020‐12‐01. - PlatformFaultDomain *int32 - - // Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 - Priority *VirtualMachinePriorityTypes - - // Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: - // 2018-04-01. - ProximityPlacementGroup *SubResource - - // Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the - // virtual machine. - ScheduledEventsPolicy *ScheduledEventsPolicy - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: - // 2021-03-01. - UserData *string - - // 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 - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // 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 -} - -// VirtualMachinePublicIPAddressConfiguration - Describes a virtual machines IP Configuration's PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string - - // Describes a virtual machines IP Configuration's PublicIPAddress configuration - Properties *VirtualMachinePublicIPAddressConfigurationProperties - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU -} - -// VirtualMachinePublicIPAddressConfigurationProperties - Describes a virtual machines IP Configuration's PublicIPAddress -// configuration -type VirtualMachinePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration - - // Specify what happens to the public IP address when the VM is deleted - DeleteOption *DeleteOptions - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineIPTag - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // 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'. - PublicIPAddressVersion *IPVersions - - // Specify the public IP allocation type - PublicIPAllocationMethod *PublicIPAllocationMethod - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachinePublicIPAddressDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { - // REQUIRED; The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label - // is the concatenation of the domain name label and vm network profile unique ID. - DomainNameLabel *string - - // The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is the concatenation - // of the hashed domain name label with policy according to the domain - // name label scope and vm network profile unique ID. - DomainNameLabelScope *DomainNameLabelScopeTypes -} - -// VirtualMachineReimageParameters - Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be -// reimaged -type VirtualMachineReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // 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 -} - -// VirtualMachineRunCommand - Describes a Virtual Machine run command. -type VirtualMachineRunCommand struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineRunCommandInstanceView - The instance view of a virtual machine run command. -type VirtualMachineRunCommandInstanceView struct { - // Script end time. - EndTime *time.Time - - // Script error stream. - Error *string - - // Communicate script configuration errors or execution messages. - ExecutionMessage *string - - // Script execution status. - ExecutionState *ExecutionState - - // Exit code returned from script execution. - ExitCode *int32 - - // Script output stream. - Output *string - - // Script start time. - StartTime *time.Time - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// VirtualMachineRunCommandProperties - Describes the properties of a Virtual Machine run command. -type VirtualMachineRunCommandProperties struct { - // Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. - AsyncExecution *bool - - // User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - ErrorBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write - // access OR use managed identity to provide the VM access to the blob. Refer - // errorBlobManagedIdentity parameter. - ErrorBlobURI *string - - // User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - OutputBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - // write access OR use managed identity to provide the VM access to the blob. Refer - // outputBlobManagedIdentity parameter. - OutputBlobURI *string - - // The parameters used by the script. - Parameters []*RunCommandInputParameter - - // The parameters used by the script. - ProtectedParameters []*RunCommandInputParameter - - // Specifies the user account password on the VM when executing the run command. - RunAsPassword *string - - // Specifies the user account on the VM when executing the run command. - RunAsUser *string - - // The source of the run command script. - Source *VirtualMachineRunCommandScriptSource - - // The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 - - // Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. - // If set to false, ProvisioningState would only reflect whether the run - // command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. - // See instance view of run command in case of script failures to see - // executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - TreatFailureAsDeploymentFailure *bool - - // READ-ONLY; The virtual machine run command instance view. - InstanceView *VirtualMachineRunCommandInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, - // any failure in the script will fail the deployment and ProvisioningState will be marked as - // Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was - // run or not by the extensions platform, it would not indicate whether script - // failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, - // output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - ProvisioningState *string -} - -// VirtualMachineRunCommandScriptSource - Describes the script sources for run command. Use only one of script, scriptUri, -// commandId. -type VirtualMachineRunCommandScriptSource struct { - // Specifies a commandId of predefined built-in script. - CommandID *string - - // Specifies the script content to be executed on the VM. - Script *string - - // Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - ScriptURI *string - - // User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - // of system-assigned identity. Make sure the Azure storage blob exists, and managed - // identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned - // identity, make sure you add it under VM's identity. For more info on - // managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - ScriptURIManagedIdentity *RunCommandManagedIdentity -} - -// VirtualMachineRunCommandUpdate - Describes a Virtual Machine run command. -type VirtualMachineRunCommandUpdate struct { - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineRunCommandsListResult - The List run command operation response -type VirtualMachineRunCommandsListResult struct { - // REQUIRED; The list of run commands - Value []*VirtualMachineRunCommand - - // The uri to fetch the next page of run commands. - NextLink *string -} - -// VirtualMachineScaleSet - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - // REQUIRED; Resource location - Location *string - - // The extended location of the Virtual Machine Scale Set. - ExtendedLocation *ExtendedLocation - - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity - - // 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 - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetProperties - - // The virtual machine scale set sku. - SKU *SKU - - // Resource tags - Tags map[string]*string - - // The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones []*string - - // READ-ONLY; Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header - // to ensure optimistic updates - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetDataDisk - Describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // REQUIRED; The create option. - CreateOption *DiskCreateOptionTypes - - // REQUIRED; 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 - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the data disk is deleted when the VMSS Flex VM is deleted. - // Detach If this value is used, the data disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. - DeleteOption *DiskDeleteOptionTypes - - // 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 - - // 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 - - // 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. The property diskSizeGB is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The disk name. - Name *string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetExtension - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - // The name of the extension. - Name *string - - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetExtensionListResult - The List VM scale set extension operation response. -type VirtualMachineScaleSetExtensionListResult struct { - // REQUIRED; The list of VM scale set extensions. - Value []*VirtualMachineScaleSetExtension - - // 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 -} - -// VirtualMachineScaleSetExtensionProfile - Describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // The virtual machine scale set child extension resources. - Extensions []*VirtualMachineScaleSetExtension - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). Minimum api-version: 2020-06-01. - ExtensionsTimeBudget *string -} - -// VirtualMachineScaleSetExtensionProperties - Describes the properties of a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // 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 - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // 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 - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions []*string - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// VirtualMachineScaleSetExtensionUpdate - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set. -type VirtualMachineScaleSetHardwareProfile struct { - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow - // the instructions in VM Customization [https://aka.ms/vmcustomization] for more - // details. - VMSizeProperties *VMSizeProperties -} - -// VirtualMachineScaleSetIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetIPConfigurationProperties -} - -// VirtualMachineScaleSetIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // 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 - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // 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 basic sku load balancer. - LoadBalancerBackendAddressPools []*SubResource - - // 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 basic sku load balancer. - LoadBalancerInboundNatPools []*SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool - - // 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'. - PrivateIPAddressVersion *IPVersion - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration - - // Specifies the identifier of the subnet. - Subnet *APIEntityReference -} - -// VirtualMachineScaleSetIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string -} - -// VirtualMachineScaleSetIdentity - Identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // 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. - Type *ResourceIdentityType - - // 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]*UserAssignedIdentitiesValue - - // READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned - // identity. - PrincipalID *string - - // 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 -} - -// VirtualMachineScaleSetInstanceView - The instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; The extensions information. - Extensions []*VirtualMachineScaleSetVMExtensionsSummary - - // READ-ONLY; The orchestration services information. - OrchestrationServices []*OrchestrationServiceSummary - - // READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary - Instance view statuses summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount -} - -// VirtualMachineScaleSetListOSUpgradeHistory - List of Virtual Machine Scale Set OS Upgrade History operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - // REQUIRED; The list of OS upgrades performed on the virtual machine scale set. - Value []*UpgradeOperationHistoricalStatusInfo - - // 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 -} - -// VirtualMachineScaleSetListResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet - - // 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 -} - -// VirtualMachineScaleSetListSKUsResult - The Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSKUsResult struct { - // REQUIRED; The list of skus available for the virtual machine scale set. - Value []*VirtualMachineScaleSetSKU - - // 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 -} - -// VirtualMachineScaleSetListWithLinkResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet - - // 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 -} - -// VirtualMachineScaleSetManagedDiskParameters - Describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile - - // 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. - StorageAccountType *StorageAccountTypes -} - -// VirtualMachineScaleSetNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // REQUIRED; The network configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration. - Properties *VirtualMachineScaleSetNetworkConfigurationProperties -} - -// VirtualMachineScaleSetNetworkConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // List of DNS servers IP addresses - DNSServers []*string -} - -// VirtualMachineScaleSetNetworkConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineScaleSetIPConfiguration - - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The network security group. - NetworkSecurityGroup *SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// VirtualMachineScaleSetNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // 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 - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration -} - -// VirtualMachineScaleSetOSDisk - Describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // REQUIRED; Specifies how the virtual machines in the scale set should be created. The only allowed value is: FromImage. - // 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. - CreateOption *DiskCreateOptionTypes - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings - - // 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. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The disk name. - Name *string - - // 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. - OSType *OperatingSystemTypes - - // Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers []*string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // 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/troubleshoot/azure/virtual-machines/reset-rdp] - // 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/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // 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 - AdminUsername *string - - // Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set to False - // when no extensions are present on the virtual machine scale set. - AllowExtensionOperations *bool - - // 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 - - // 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/linux/using-cloud-init] - CustomData *string - - // 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/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration - - // Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool - - // Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates - // on a virtual machine it is recommended to use the Azure Key Vault virtual - // machine extension for Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure - // Key Vault virtual machine extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration -} - -// VirtualMachineScaleSetProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // 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 - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy - - // Optional property which must either be set to True or omitted. - ConstrainedMaximumCapacity *bool - - // 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 - - // Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: - // 2020-06-01. - HostGroup *SubResource - - // Specifies the orchestration mode for the virtual machine scale set. - OrchestrationMode *OrchestrationMode - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool - - // Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 - - // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy - - // 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 - - // Policy for Resiliency - ResiliencyPolicy *ResiliencyPolicy - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy - - // The ScheduledEventsPolicy. - ScheduledEventsPolicy *ScheduledEventsPolicy - - // 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 - - // Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy - - // The upgrade policy. - UpgradePolicy *UpgradePolicy - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile - - // Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property - // can only be set if the zones property of the scale set contains more than - // one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. - ZoneBalance *bool - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetPublicIPAddressConfigurationProperties - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // REQUIRED; 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 - - // The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from - // domain name label scope and vm index will be the domain name labels of the - // PublicIPAddress resources that will be created - DomainNameLabelScope *DomainNameLabelScopeTypes -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineScaleSetIPTag - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // 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'. - PublicIPAddressVersion *IPVersion - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachineScaleSetReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Parameter to force update ephemeral OS disk for a virtual machine scale set VM - ForceUpdateOSDiskForEphemeral *bool - - // 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 - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // 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 -} - -// VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSKU struct { - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSKUCapacity - - // READ-ONLY; The type of resource the sku applies to. - ResourceType *string - - // READ-ONLY; The Sku. - SKU *SKU -} - -// VirtualMachineScaleSetSKUCapacity - Describes scaling information of a sku. -type VirtualMachineScaleSetSKUCapacity struct { - // READ-ONLY; The default capacity. - DefaultCapacity *int64 - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 - - // READ-ONLY; The minimum capacity. - Minimum *int64 - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *VirtualMachineScaleSetSKUScaleType -} - -// VirtualMachineScaleSetStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // 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/managed-disks-overview]. - DataDisks []*VirtualMachineScaleSetDataDisk - DiskControllerType *string - - // 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 - - // 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/managed-disks-overview]. - OSDisk *VirtualMachineScaleSetOSDisk -} - -// VirtualMachineScaleSetUpdate - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity - - // The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - Plan *Plan - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetUpdateProperties - - // The virtual machine scale set sku. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineScaleSetUpdateIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -// 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 VirtualMachineScaleSetUpdateIPConfiguration struct { - // The IP configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetUpdateIPConfigurationProperties -} - -// VirtualMachineScaleSetUpdateIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // The application gateway backend address pools. - ApplicationGatewayBackendAddressPools []*SubResource - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // The load balancer backend address pools. - LoadBalancerBackendAddressPools []*SubResource - - // The load balancer inbound nat pools. - LoadBalancerInboundNatPools []*SubResource - - // Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool - - // 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'. - PrivateIPAddressVersion *IPVersion - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - - // The subnet. - Subnet *APIEntityReference -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // The network configuration name. - Name *string - - // Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network - // profile's IP Configuration. - Properties *VirtualMachineScaleSetUpdateNetworkConfigurationProperties -} - -// 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 { - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The virtual machine scale set IP Configuration. - IPConfigurations []*VirtualMachineScaleSetUpdateIPConfiguration - - // The network security group. - NetworkSecurityGroup *SubResource - - // Whether this is a primary NIC on a virtual machine. - Primary *bool -} - -// VirtualMachineScaleSetUpdateNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // 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 - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetUpdateNetworkConfiguration -} - -// VirtualMachineScaleSetUpdateOSDisk - Describes virtual machine scale set operating system disk Update Object. This should -// be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // The caching type. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings - - // 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. - // diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 - - // 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 - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The list of virtual hard disk container uris. - VhdContainers []*string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetUpdateOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // A base-64 encoded string of custom data. - CustomData *string - - // The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration - - // The List of certificates for addition to the VM. - Secrets []*VaultSecretGroup - - // The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration -} - -// VirtualMachineScaleSetUpdateProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // 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 - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy - - // 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 - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool - - // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy - - // 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 - - // Policy for Resiliency - ResiliencyPolicy *ResiliencyPolicy - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy - - // 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 - - // Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy - - // The upgrade policy. - UpgradePolicy *UpgradePolicy - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { - // The publicIP address configuration name. - Name *string - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachineScaleSetUpdateStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // The data disks. - DataDisks []*VirtualMachineScaleSetDataDisk - DiskControllerType *string - - // The image reference. - ImageReference *ImageReference - - // The OS disk. - OSDisk *VirtualMachineScaleSetUpdateOSDisk -} - -// VirtualMachineScaleSetUpdateVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile - - // The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile - - // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile - - // The license type, which is for bring your own license scenario. - LicenseType *string - - // The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile - - // The virtual machine scale set OS profile. - OSProfile *VirtualMachineScaleSetUpdateOSProfile - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // The virtual machine scale set Security profile - SecurityProfile *SecurityProfile - - // The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string -} - -// VirtualMachineScaleSetVM - Describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - // REQUIRED; Resource location - Location *string - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // 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 - - // Describes the properties of a virtual machine scale set virtual machine. - Properties *VirtualMachineScaleSetVMProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header - // to ensure optimistic updates. - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The virtual machine instance ID. - InstanceID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension - - // READ-ONLY; The virtual machine SKU. - SKU *SKU - - // READ-ONLY; Resource type - Type *string - - // READ-ONLY; The virtual machine zones. - Zones []*string -} - -// VirtualMachineScaleSetVMExtension - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtension struct { - // The location of the extension. - Location *string - - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetVMExtensionUpdate - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response -type VirtualMachineScaleSetVMExtensionsListResult struct { - // The list of VMSS VM extensions - Value []*VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsSummary - Extensions summary for virtual machines of a virtual machine scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // READ-ONLY; The extension name. - Name *string - - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount -} - -// VirtualMachineScaleSetVMInstanceIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // 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 -} - -// VirtualMachineScaleSetVMInstanceRequiredIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceRequiredIDs struct { - // REQUIRED; The virtual machine scale set instance ids. - InstanceIDs []*string -} - -// VirtualMachineScaleSetVMInstanceView - The instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - // 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 - - // 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 - - // The disks information. - Disks []*DiskInstanceView - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView - - // The hypervisor generation of the Virtual Machine [V1, V2] - HyperVGeneration *HyperVGeneration - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus - - // The Operating System running on the hybrid machine. - OSName *string - - // The version of Operating System running on the hybrid machine. - OSVersion *string - - // The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string - - // The Fault Domain count. - PlatformFaultDomain *int32 - - // The Update Domain count. - PlatformUpdateDomain *int32 - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. Minimum api-version: 2020-06-01. - AssignedHost *string - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus -} - -// VirtualMachineScaleSetVMListResult - The List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - // REQUIRED; The list of virtual machine scale sets VMs. - Value []*VirtualMachineScaleSetVM - - // 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 -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration - Describes a virtual machine scale set VM network profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration -} - -// VirtualMachineScaleSetVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile - - // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, - // both 'Deallocate' and 'Delete' are supported 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. - EvictionPolicy *VirtualMachineEvictionPolicyTypes - - // Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile - - // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile - - // Specifies the operating system settings for the virtual machines in the scale set. - OSProfile *VirtualMachineScaleSetOSProfile - - // Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. - Priority *VirtualMachinePriorityTypes - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01 - SecurityPostureReference *SecurityPostureReference - - // Specifies the Security related profile settings for the virtual machines in the scale set. - SecurityProfile *SecurityProfile - - // Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when - // using 'latest' image version. Minimum api-version: 2022-11-01 - ServiceArtifactReference *ServiceArtifactReference - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile - - // UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets - // in here. Minimum api-version: 2021-03-01. - UserData *string - - // READ-ONLY; Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version - // for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when - // creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. - TimeCreated *time.Time -} - -// VirtualMachineScaleSetVMProperties - Describes the properties of a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVMProperties struct { - // 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 - - // 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 Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure - // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. - // 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 - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile - - // Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration - - // Specifies the operating system settings for the virtual machine. - OSProfile *OSProfile - - // Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView - - // READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool - - // 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 - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. - // Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; Azure VM unique ID. - VMID *string -} - -// VirtualMachineScaleSetVMProtectionPolicy - The protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool - - // 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 -} - -// VirtualMachineScaleSetVMReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Parameter to force update ephemeral OS disk for a virtual machine scale set VM - ForceUpdateOSDiskForEphemeral *bool - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // 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 -} - -// VirtualMachineSize - Describes the properties of a VM size. -type VirtualMachineSize struct { - // The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 - - // The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 - - // The name of the virtual machine size. - Name *string - - // The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents - // the total vCPUs of quota that the VM uses. For accurate vCPU count, please - // refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list - NumberOfCores *int32 - - // The OS disk size, in MB, allowed by the virtual machine size. - OSDiskSizeInMB *int32 - - // The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 -} - -// VirtualMachineSizeListResult - The List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - // The list of virtual machine sizes. - Value []*VirtualMachineSize -} - -// VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch. -type VirtualMachineSoftwarePatchProperties struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - ActivityID *string - - // READ-ONLY; Describes the availability of a given patch. - AssessmentState *PatchAssessmentState - - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string - - // READ-ONLY; The UTC timestamp of the last update to this patch record. - LastModifiedDateTime *time.Time - - // READ-ONLY; The friendly name of the patch. - Name *string - - // READ-ONLY; A unique identifier for the patch. - PatchID *string - - // READ-ONLY; The UTC timestamp when the repository published this patch. - PublishedDate *time.Time - - // READ-ONLY; Describes the reboot requirements of the patch. - RebootBehavior *VMGuestPatchRebootBehavior - - // READ-ONLY; The version number of the patch. This property applies only to Linux patches. - Version *string -} - -// VirtualMachineStatusCodeCount - The status code and count of the virtual machine scale set instance view status summary. -type VirtualMachineStatusCodeCount struct { - // READ-ONLY; The instance view status code. - Code *string - - // READ-ONLY; The number of instances having a particular status code. - Count *int32 -} - -// VirtualMachineUpdate - Describes a Virtual Machine Update. -type VirtualMachineUpdate struct { - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // 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 - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties - - // Resource tags - Tags map[string]*string - - // The virtual machine zones. - Zones []*string -} - -// WinRMConfiguration - Describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // The list of Windows Remote Management listeners - Listeners []*WinRMListener -} - -// WinRMListener - Describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // 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 the - // Base64 encoding of the following JSON Object which is encoded in UTF-8: - // { - // "data":"", - // "dataType":"pfx", - // "password":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string - - // Specifies the protocol of WinRM listener. Possible values are: http, https. - Protocol *ProtocolTypes -} - -// WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. -type WindowsConfiguration struct { - // 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 - - // 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 - - // Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool - - // [Preview Feature] Specifies settings related to VM Guest Patching on Windows. - PatchSettings *PatchSettings - - // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified - // in the request body, it is set to true by default. This will ensure that VM - // Agent is installed on the VM so that extensions can be added to the VM later. - ProvisionVMAgent *bool - - // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be TimeZoneInfo.Id - // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id] value from time zones returned by - // TimeZoneInfo.GetSystemTimeZones - // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones]. - TimeZone *string - - // Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration -} - -// WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API -type WindowsParameters struct { - // The update classifications to select when installing patches for Windows. - ClassificationsToInclude []*VMGuestPatchClassificationWindows - - // Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - ExcludeKbsRequiringReboot *bool - - // Kbs to exclude in the patch operation - KbNumbersToExclude []*string - - // Kbs to include in the patch operation - KbNumbersToInclude []*string - - // This is used to install patches that were published on or before this given max published date. - MaxPatchPublishDate *time.Time -} - -// WindowsVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Windows patch settings. -type WindowsVMGuestPatchAutomaticByPlatformSettings struct { - // Enables customer to schedule patching without accidental upgrades - BypassPlatformSafetyChecksOnUserSchedule *bool - - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go deleted file mode 100644 index 1bdfcb442268..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go +++ /dev/null @@ -1,19966 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type APIEntityReference. -func (a APIEntityReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityReference. -func (a *APIEntityReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type APIError. -func (a APIError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", a.Code) - populate(objectMap, "details", a.Details) - populate(objectMap, "innererror", a.Innererror) - populate(objectMap, "message", a.Message) - populate(objectMap, "target", a.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIError. -func (a *APIError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &a.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &a.Details) - delete(rawMsg, key) - case "innererror": - err = unpopulate(val, "Innererror", &a.Innererror) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &a.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &a.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type APIErrorBase. -func (a APIErrorBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", a.Code) - populate(objectMap, "message", a.Message) - populate(objectMap, "target", a.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIErrorBase. -func (a *APIErrorBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &a.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &a.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &a.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessURI. -func (a AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "accessSAS", a.AccessSAS) - populate(objectMap, "securityDataAccessSAS", a.SecurityDataAccessSAS) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessURI. -func (a *AccessURI) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "accessSAS": - err = unpopulate(val, "AccessSAS", &a.AccessSAS) - delete(rawMsg, key) - case "securityDataAccessSAS": - err = unpopulate(val, "SecurityDataAccessSAS", &a.SecurityDataAccessSAS) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdditionalCapabilities. -func (a AdditionalCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hibernationEnabled", a.HibernationEnabled) - populate(objectMap, "ultraSSDEnabled", a.UltraSSDEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalCapabilities. -func (a *AdditionalCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hibernationEnabled": - err = unpopulate(val, "HibernationEnabled", &a.HibernationEnabled) - delete(rawMsg, key) - case "ultraSSDEnabled": - err = unpopulate(val, "UltraSSDEnabled", &a.UltraSSDEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdditionalUnattendContent. -func (a AdditionalUnattendContent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["componentName"] = "Microsoft-Windows-Shell-Setup" - populate(objectMap, "content", a.Content) - objectMap["passName"] = "OobeSystem" - populate(objectMap, "settingName", a.SettingName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalUnattendContent. -func (a *AdditionalUnattendContent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "componentName": - err = unpopulate(val, "ComponentName", &a.ComponentName) - delete(rawMsg, key) - case "content": - err = unpopulate(val, "Content", &a.Content) - delete(rawMsg, key) - case "passName": - err = unpopulate(val, "PassName", &a.PassName) - delete(rawMsg, key) - case "settingName": - err = unpopulate(val, "SettingName", &a.SettingName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AlternativeOption. -func (a AlternativeOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "type", a.Type) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlternativeOption. -func (a *AlternativeOption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationProfile. -func (a ApplicationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "galleryApplications", a.GalleryApplications) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProfile. -func (a *ApplicationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "galleryApplications": - err = unpopulate(val, "GalleryApplications", &a.GalleryApplications) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AttachDetachDataDisksRequest. -func (a AttachDetachDataDisksRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisksToAttach", a.DataDisksToAttach) - populate(objectMap, "dataDisksToDetach", a.DataDisksToDetach) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AttachDetachDataDisksRequest. -func (a *AttachDetachDataDisksRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisksToAttach": - err = unpopulate(val, "DataDisksToAttach", &a.DataDisksToAttach) - delete(rawMsg, key) - case "dataDisksToDetach": - err = unpopulate(val, "DataDisksToDetach", &a.DataDisksToDetach) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradePolicy. -func (a AutomaticOSUpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "disableAutomaticRollback", a.DisableAutomaticRollback) - populate(objectMap, "enableAutomaticOSUpgrade", a.EnableAutomaticOSUpgrade) - populate(objectMap, "osRollingUpgradeDeferral", a.OSRollingUpgradeDeferral) - populate(objectMap, "useRollingUpgradePolicy", a.UseRollingUpgradePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradePolicy. -func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disableAutomaticRollback": - err = unpopulate(val, "DisableAutomaticRollback", &a.DisableAutomaticRollback) - delete(rawMsg, key) - case "enableAutomaticOSUpgrade": - err = unpopulate(val, "EnableAutomaticOSUpgrade", &a.EnableAutomaticOSUpgrade) - delete(rawMsg, key) - case "osRollingUpgradeDeferral": - err = unpopulate(val, "OSRollingUpgradeDeferral", &a.OSRollingUpgradeDeferral) - delete(rawMsg, key) - case "useRollingUpgradePolicy": - err = unpopulate(val, "UseRollingUpgradePolicy", &a.UseRollingUpgradePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradeProperties. -func (a AutomaticOSUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticOSUpgradeSupported", a.AutomaticOSUpgradeSupported) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradeProperties. -func (a *AutomaticOSUpgradeProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticOSUpgradeSupported": - err = unpopulate(val, "AutomaticOSUpgradeSupported", &a.AutomaticOSUpgradeSupported) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticRepairsPolicy. -func (a AutomaticRepairsPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "gracePeriod", a.GracePeriod) - populate(objectMap, "repairAction", a.RepairAction) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticRepairsPolicy. -func (a *AutomaticRepairsPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - case "gracePeriod": - err = unpopulate(val, "GracePeriod", &a.GracePeriod) - delete(rawMsg, key) - case "repairAction": - err = unpopulate(val, "RepairAction", &a.RepairAction) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySet. -func (a AvailabilitySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySet. -func (a *AvailabilitySet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListResult. -func (a AvailabilitySetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListResult. -func (a *AvailabilitySetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties. -func (a AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "platformFaultDomainCount", a.PlatformFaultDomainCount) - populate(objectMap, "platformUpdateDomainCount", a.PlatformUpdateDomainCount) - populate(objectMap, "proximityPlacementGroup", a.ProximityPlacementGroup) - populate(objectMap, "statuses", a.Statuses) - populate(objectMap, "virtualMachines", a.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetProperties. -func (a *AvailabilitySetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &a.PlatformFaultDomainCount) - delete(rawMsg, key) - case "platformUpdateDomainCount": - err = unpopulate(val, "PlatformUpdateDomainCount", &a.PlatformUpdateDomainCount) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &a.ProximityPlacementGroup) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &a.Statuses) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &a.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetUpdate. -func (a AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetUpdate. -func (a *AvailabilitySetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailablePatchSummary. -func (a AvailablePatchSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentActivityId", a.AssessmentActivityID) - populate(objectMap, "criticalAndSecurityPatchCount", a.CriticalAndSecurityPatchCount) - populate(objectMap, "error", a.Error) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", a.LastModifiedTime) - populate(objectMap, "otherPatchCount", a.OtherPatchCount) - populate(objectMap, "rebootPending", a.RebootPending) - populateDateTimeRFC3339(objectMap, "startTime", a.StartTime) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePatchSummary. -func (a *AvailablePatchSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &a.AssessmentActivityID) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &a.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &a.Error) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &a.LastModifiedTime) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &a.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &a.RebootPending) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BillingProfile. -func (b BillingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxPrice", b.MaxPrice) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BillingProfile. -func (b *BillingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxPrice": - err = unpopulate(val, "MaxPrice", &b.MaxPrice) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BootDiagnostics. -func (b BootDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", b.Enabled) - populate(objectMap, "storageUri", b.StorageURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnostics. -func (b *BootDiagnostics) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &b.Enabled) - delete(rawMsg, key) - case "storageUri": - err = unpopulate(val, "StorageURI", &b.StorageURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInstanceView. -func (b BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consoleScreenshotBlobUri", b.ConsoleScreenshotBlobURI) - populate(objectMap, "serialConsoleLogBlobUri", b.SerialConsoleLogBlobURI) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInstanceView. -func (b *BootDiagnosticsInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consoleScreenshotBlobUri": - err = unpopulate(val, "ConsoleScreenshotBlobURI", &b.ConsoleScreenshotBlobURI) - delete(rawMsg, key) - case "serialConsoleLogBlobUri": - err = unpopulate(val, "SerialConsoleLogBlobURI", &b.SerialConsoleLogBlobURI) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservation. -func (c CapacityReservation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservation. -func (c *CapacityReservation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup. -func (c CapacityReservationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroup. -func (c *CapacityReservationGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupInstanceView. -func (c CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservations", c.CapacityReservations) - populate(objectMap, "sharedSubscriptionIds", c.SharedSubscriptionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupInstanceView. -func (c *CapacityReservationGroupInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservations": - err = unpopulate(val, "CapacityReservations", &c.CapacityReservations) - delete(rawMsg, key) - case "sharedSubscriptionIds": - err = unpopulate(val, "SharedSubscriptionIDs", &c.SharedSubscriptionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupListResult. -func (c CapacityReservationGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupListResult. -func (c *CapacityReservationGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties. -func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservations", c.CapacityReservations) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "sharingProfile", c.SharingProfile) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupProperties. -func (c *CapacityReservationGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservations": - err = unpopulate(val, "CapacityReservations", &c.CapacityReservations) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &c.InstanceView) - delete(rawMsg, key) - case "sharingProfile": - err = unpopulate(val, "SharingProfile", &c.SharingProfile) - delete(rawMsg, key) - case "virtualMachinesAssociated": - err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupUpdate. -func (c CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupUpdate. -func (c *CapacityReservationGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceView. -func (c CapacityReservationInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceView. -func (c *CapacityReservationInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - case "utilizationInfo": - err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceViewWithName. -func (c CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceViewWithName. -func (c *CapacityReservationInstanceViewWithName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - case "utilizationInfo": - err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationListResult. -func (c CapacityReservationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationListResult. -func (c *CapacityReservationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProfile. -func (c CapacityReservationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservationGroup", c.CapacityReservationGroup) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProfile. -func (c *CapacityReservationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservationGroup": - err = unpopulate(val, "CapacityReservationGroup", &c.CapacityReservationGroup) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties. -func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "platformFaultDomainCount", c.PlatformFaultDomainCount) - populate(objectMap, "provisioningState", c.ProvisioningState) - populateDateTimeRFC3339(objectMap, "provisioningTime", c.ProvisioningTime) - populate(objectMap, "reservationId", c.ReservationID) - populateDateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties. -func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceView": - err = unpopulate(val, "InstanceView", &c.InstanceView) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &c.PlatformFaultDomainCount) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &c.ProvisioningTime) - delete(rawMsg, key) - case "reservationId": - err = unpopulate(val, "ReservationID", &c.ReservationID) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &c.TimeCreated) - delete(rawMsg, key) - case "virtualMachinesAssociated": - err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUpdate. -func (c CapacityReservationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUpdate. -func (c *CapacityReservationUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUtilization. -func (c CapacityReservationUtilization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentCapacity", c.CurrentCapacity) - populate(objectMap, "virtualMachinesAllocated", c.VirtualMachinesAllocated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUtilization. -func (c *CapacityReservationUtilization) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentCapacity": - err = unpopulate(val, "CurrentCapacity", &c.CurrentCapacity) - delete(rawMsg, key) - case "virtualMachinesAllocated": - err = unpopulate(val, "VirtualMachinesAllocated", &c.VirtualMachinesAllocated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudService. -func (c CloudService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudService. -func (c *CloudService) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProfile. -func (c CloudServiceExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", c.Extensions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProfile. -func (c *CloudServiceExtensionProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &c.Extensions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProperties. -func (c CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", c.AutoUpgradeMinorVersion) - populate(objectMap, "forceUpdateTag", c.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", c.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", c.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "rolesAppliedTo", c.RolesAppliedTo) - populateAny(objectMap, "settings", c.Settings) - populate(objectMap, "type", c.Type) - populate(objectMap, "typeHandlerVersion", c.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProperties. -func (c *CloudServiceExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &c.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &c.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &c.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &c.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &c.Publisher) - delete(rawMsg, key) - case "rolesAppliedTo": - err = unpopulate(val, "RolesAppliedTo", &c.RolesAppliedTo) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &c.Settings) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &c.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceInstanceView. -func (c CloudServiceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateIds", c.PrivateIDs) - populate(objectMap, "roleInstance", c.RoleInstance) - populate(objectMap, "sdkVersion", c.SdkVersion) - populate(objectMap, "statuses", c.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceInstanceView. -func (c *CloudServiceInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIds": - err = unpopulate(val, "PrivateIDs", &c.PrivateIDs) - delete(rawMsg, key) - case "roleInstance": - err = unpopulate(val, "RoleInstance", &c.RoleInstance) - delete(rawMsg, key) - case "sdkVersion": - err = unpopulate(val, "SdkVersion", &c.SdkVersion) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceListResult. -func (c CloudServiceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceListResult. -func (c *CloudServiceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceNetworkProfile. -func (c CloudServiceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "loadBalancerConfigurations", c.LoadBalancerConfigurations) - populate(objectMap, "slotType", c.SlotType) - populate(objectMap, "swappableCloudService", c.SwappableCloudService) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceNetworkProfile. -func (c *CloudServiceNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "loadBalancerConfigurations": - err = unpopulate(val, "LoadBalancerConfigurations", &c.LoadBalancerConfigurations) - delete(rawMsg, key) - case "slotType": - err = unpopulate(val, "SlotType", &c.SlotType) - delete(rawMsg, key) - case "swappableCloudService": - err = unpopulate(val, "SwappableCloudService", &c.SwappableCloudService) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceOsProfile. -func (c CloudServiceOsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secrets", c.Secrets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceOsProfile. -func (c *CloudServiceOsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secrets": - err = unpopulate(val, "Secrets", &c.Secrets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceProperties. -func (c CloudServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowModelOverride", c.AllowModelOverride) - populate(objectMap, "configuration", c.Configuration) - populate(objectMap, "configurationUrl", c.ConfigurationURL) - populate(objectMap, "extensionProfile", c.ExtensionProfile) - populate(objectMap, "networkProfile", c.NetworkProfile) - populate(objectMap, "osProfile", c.OSProfile) - populate(objectMap, "packageUrl", c.PackageURL) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "roleProfile", c.RoleProfile) - populate(objectMap, "startCloudService", c.StartCloudService) - populate(objectMap, "uniqueId", c.UniqueID) - populate(objectMap, "upgradeMode", c.UpgradeMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceProperties. -func (c *CloudServiceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowModelOverride": - err = unpopulate(val, "AllowModelOverride", &c.AllowModelOverride) - delete(rawMsg, key) - case "configuration": - err = unpopulate(val, "Configuration", &c.Configuration) - delete(rawMsg, key) - case "configurationUrl": - err = unpopulate(val, "ConfigurationURL", &c.ConfigurationURL) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &c.ExtensionProfile) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &c.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &c.OSProfile) - delete(rawMsg, key) - case "packageUrl": - err = unpopulate(val, "PackageURL", &c.PackageURL) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "roleProfile": - err = unpopulate(val, "RoleProfile", &c.RoleProfile) - delete(rawMsg, key) - case "startCloudService": - err = unpopulate(val, "StartCloudService", &c.StartCloudService) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - case "upgradeMode": - err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRole. -func (c CloudServiceRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRole. -func (c *CloudServiceRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleListResult. -func (c CloudServiceRoleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleListResult. -func (c *CloudServiceRoleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfile. -func (c CloudServiceRoleProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "roles", c.Roles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfile. -func (c *CloudServiceRoleProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "roles": - err = unpopulate(val, "Roles", &c.Roles) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfileProperties. -func (c CloudServiceRoleProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "sku", c.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfileProperties. -func (c *CloudServiceRoleProfileProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProperties. -func (c CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", c.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProperties. -func (c *CloudServiceRoleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleSKU. -func (c CloudServiceRoleSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", c.Capacity) - populate(objectMap, "name", c.Name) - populate(objectMap, "tier", c.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleSKU. -func (c *CloudServiceRoleSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &c.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &c.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceUpdate. -func (c CloudServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceUpdate. -func (c *CloudServiceUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultAndSecretReference. -func (c CloudServiceVaultAndSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", c.SecretURL) - populate(objectMap, "sourceVault", c.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultAndSecretReference. -func (c *CloudServiceVaultAndSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &c.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &c.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultCertificate. -func (c CloudServiceVaultCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateUrl", c.CertificateURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultCertificate. -func (c *CloudServiceVaultCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &c.CertificateURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultSecretGroup. -func (c CloudServiceVaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourceVault", c.SourceVault) - populate(objectMap, "vaultCertificates", c.VaultCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultSecretGroup. -func (c *CloudServiceVaultSecretGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceVault": - err = unpopulate(val, "SourceVault", &c.SourceVault) - delete(rawMsg, key) - case "vaultCertificates": - err = unpopulate(val, "VaultCertificates", &c.VaultCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGallery. -func (c CommunityGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGallery. -func (c *CommunityGallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryIdentifier. -func (c CommunityGalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", c.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryIdentifier. -func (c *CommunityGalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImage. -func (c CommunityGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImage. -func (c *CommunityGalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageIdentifier. -func (c CommunityGalleryImageIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "offer", c.Offer) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "sku", c.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageIdentifier. -func (c *CommunityGalleryImageIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offer": - err = unpopulate(val, "Offer", &c.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &c.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageList. -func (c CommunityGalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageList. -func (c *CommunityGalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageProperties. -func (c CommunityGalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", c.Architecture) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "disallowed", c.Disallowed) - populate(objectMap, "disclaimer", c.Disclaimer) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "features", c.Features) - populate(objectMap, "hyperVGeneration", c.HyperVGeneration) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "osState", c.OSState) - populate(objectMap, "osType", c.OSType) - populate(objectMap, "privacyStatementUri", c.PrivacyStatementURI) - populate(objectMap, "purchasePlan", c.PurchasePlan) - populate(objectMap, "recommended", c.Recommended) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageProperties. -func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &c.Architecture) - delete(rawMsg, key) - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &c.Disallowed) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &c.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &c.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &c.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &c.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &c.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &c.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersion. -func (c CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersion. -func (c *CommunityGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionList. -func (c CommunityGalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionList. -func (c *CommunityGalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionProperties. -func (c CommunityGalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "disclaimer", c.Disclaimer) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", c.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", c.PublishedDate) - populate(objectMap, "storageProfile", c.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionProperties. -func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &c.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &c.PublishedDate) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &c.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryInfo. -func (c CommunityGalleryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryEnabled", c.CommunityGalleryEnabled) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "publicNamePrefix", c.PublicNamePrefix) - populate(objectMap, "publicNames", c.PublicNames) - populate(objectMap, "publisherContact", c.PublisherContact) - populate(objectMap, "publisherUri", c.PublisherURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryInfo. -func (c *CommunityGalleryInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryEnabled": - err = unpopulate(val, "CommunityGalleryEnabled", &c.CommunityGalleryEnabled) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "publicNamePrefix": - err = unpopulate(val, "PublicNamePrefix", &c.PublicNamePrefix) - delete(rawMsg, key) - case "publicNames": - err = unpopulate(val, "PublicNames", &c.PublicNames) - delete(rawMsg, key) - case "publisherContact": - err = unpopulate(val, "PublisherContact", &c.PublisherContact) - delete(rawMsg, key) - case "publisherUri": - err = unpopulate(val, "PublisherURI", &c.PublisherURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryMetadata. -func (c CommunityGalleryMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "privacyStatementUri", c.PrivacyStatementURI) - populate(objectMap, "publicNames", c.PublicNames) - populate(objectMap, "publisherContact", c.PublisherContact) - populate(objectMap, "publisherUri", c.PublisherURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryMetadata. -func (c *CommunityGalleryMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI) - delete(rawMsg, key) - case "publicNames": - err = unpopulate(val, "PublicNames", &c.PublicNames) - delete(rawMsg, key) - case "publisherContact": - err = unpopulate(val, "PublisherContact", &c.PublisherContact) - delete(rawMsg, key) - case "publisherUri": - err = unpopulate(val, "PublisherURI", &c.PublisherURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryProperties. -func (c CommunityGalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "communityMetadata", c.CommunityMetadata) - populate(objectMap, "disclaimer", c.Disclaimer) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryProperties. -func (c *CommunityGalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "communityMetadata": - err = unpopulate(val, "CommunityMetadata", &c.CommunityMetadata) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CopyCompletionError. -func (c CopyCompletionError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errorCode", c.ErrorCode) - populate(objectMap, "errorMessage", c.ErrorMessage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CopyCompletionError. -func (c *CopyCompletionError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &c.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CreationData. -func (c CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "createOption", c.CreateOption) - populate(objectMap, "elasticSanResourceId", c.ElasticSanResourceID) - populate(objectMap, "galleryImageReference", c.GalleryImageReference) - populate(objectMap, "imageReference", c.ImageReference) - populate(objectMap, "logicalSectorSize", c.LogicalSectorSize) - populate(objectMap, "performancePlus", c.PerformancePlus) - populate(objectMap, "provisionedBandwidthCopySpeed", c.ProvisionedBandwidthCopySpeed) - populate(objectMap, "securityDataUri", c.SecurityDataURI) - populate(objectMap, "sourceResourceId", c.SourceResourceID) - populate(objectMap, "sourceUri", c.SourceURI) - populate(objectMap, "sourceUniqueId", c.SourceUniqueID) - populate(objectMap, "storageAccountId", c.StorageAccountID) - populate(objectMap, "uploadSizeBytes", c.UploadSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CreationData. -func (c *CreationData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createOption": - err = unpopulate(val, "CreateOption", &c.CreateOption) - delete(rawMsg, key) - case "elasticSanResourceId": - err = unpopulate(val, "ElasticSanResourceID", &c.ElasticSanResourceID) - delete(rawMsg, key) - case "galleryImageReference": - err = unpopulate(val, "GalleryImageReference", &c.GalleryImageReference) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &c.ImageReference) - delete(rawMsg, key) - case "logicalSectorSize": - err = unpopulate(val, "LogicalSectorSize", &c.LogicalSectorSize) - delete(rawMsg, key) - case "performancePlus": - err = unpopulate(val, "PerformancePlus", &c.PerformancePlus) - delete(rawMsg, key) - case "provisionedBandwidthCopySpeed": - err = unpopulate(val, "ProvisionedBandwidthCopySpeed", &c.ProvisionedBandwidthCopySpeed) - delete(rawMsg, key) - case "securityDataUri": - err = unpopulate(val, "SecurityDataURI", &c.SecurityDataURI) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &c.SourceResourceID) - delete(rawMsg, key) - case "sourceUri": - err = unpopulate(val, "SourceURI", &c.SourceURI) - delete(rawMsg, key) - case "sourceUniqueId": - err = unpopulate(val, "SourceUniqueID", &c.SourceUniqueID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &c.StorageAccountID) - delete(rawMsg, key) - case "uploadSizeBytes": - err = unpopulate(val, "UploadSizeBytes", &c.UploadSizeBytes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisk. -func (d DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", d.Caching) - populate(objectMap, "createOption", d.CreateOption) - populate(objectMap, "deleteOption", d.DeleteOption) - populate(objectMap, "detachOption", d.DetachOption) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "image", d.Image) - populate(objectMap, "lun", d.Lun) - populate(objectMap, "managedDisk", d.ManagedDisk) - populate(objectMap, "name", d.Name) - populate(objectMap, "sourceResource", d.SourceResource) - populate(objectMap, "toBeDetached", d.ToBeDetached) - populate(objectMap, "vhd", d.Vhd) - populate(objectMap, "writeAcceleratorEnabled", d.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisk. -func (d *DataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &d.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &d.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &d.DeleteOption) - delete(rawMsg, key) - case "detachOption": - err = unpopulate(val, "DetachOption", &d.DetachOption) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &d.Image) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &d.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "sourceResource": - err = unpopulate(val, "SourceResource", &d.SourceResource) - delete(rawMsg, key) - case "toBeDetached": - err = unpopulate(val, "ToBeDetached", &d.ToBeDetached) - delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &d.Vhd) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &d.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDiskImage. -func (d DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "lun", d.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImage. -func (d *DataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDiskImageEncryption. -func (d DataDiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID) - populate(objectMap, "lun", d.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImageEncryption. -func (d *DataDiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisksToAttach. -func (d DataDisksToAttach) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", d.Caching) - populate(objectMap, "deleteOption", d.DeleteOption) - populate(objectMap, "diskEncryptionSet", d.DiskEncryptionSet) - populate(objectMap, "diskId", d.DiskID) - populate(objectMap, "lun", d.Lun) - populate(objectMap, "writeAcceleratorEnabled", d.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToAttach. -func (d *DataDisksToAttach) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &d.Caching) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &d.DeleteOption) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &d.DiskEncryptionSet) - delete(rawMsg, key) - case "diskId": - err = unpopulate(val, "DiskID", &d.DiskID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &d.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisksToDetach. -func (d DataDisksToDetach) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "detachOption", d.DetachOption) - populate(objectMap, "diskId", d.DiskID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToDetach. -func (d *DataDisksToDetach) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "detachOption": - err = unpopulate(val, "DetachOption", &d.DetachOption) - delete(rawMsg, key) - case "diskId": - err = unpopulate(val, "DiskID", &d.DiskID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHost. -func (d DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHost. -func (d *DedicatedHost) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAllocatableVM. -func (d DedicatedHostAllocatableVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", d.Count) - populate(objectMap, "vmSize", d.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAllocatableVM. -func (d *DedicatedHostAllocatableVM) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "count": - err = unpopulate(val, "Count", &d.Count) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &d.VMSize) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAvailableCapacity. -func (d DedicatedHostAvailableCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allocatableVMs", d.AllocatableVMs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAvailableCapacity. -func (d *DedicatedHostAvailableCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocatableVMs": - err = unpopulate(val, "AllocatableVMs", &d.AllocatableVMs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroup. -func (d DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroup. -func (d *DedicatedHostGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupInstanceView. -func (d DedicatedHostGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hosts", d.Hosts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupInstanceView. -func (d *DedicatedHostGroupInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hosts": - err = unpopulate(val, "Hosts", &d.Hosts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupListResult. -func (d DedicatedHostGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupListResult. -func (d *DedicatedHostGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupProperties. -func (d DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", d.AdditionalCapabilities) - populate(objectMap, "hosts", d.Hosts) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "platformFaultDomainCount", d.PlatformFaultDomainCount) - populate(objectMap, "supportAutomaticPlacement", d.SupportAutomaticPlacement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupProperties. -func (d *DedicatedHostGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &d.AdditionalCapabilities) - delete(rawMsg, key) - case "hosts": - err = unpopulate(val, "Hosts", &d.Hosts) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &d.InstanceView) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &d.PlatformFaultDomainCount) - delete(rawMsg, key) - case "supportAutomaticPlacement": - err = unpopulate(val, "SupportAutomaticPlacement", &d.SupportAutomaticPlacement) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities. -func (d DedicatedHostGroupPropertiesAdditionalCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ultraSSDEnabled", d.UltraSSDEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities. -func (d *DedicatedHostGroupPropertiesAdditionalCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ultraSSDEnabled": - err = unpopulate(val, "UltraSSDEnabled", &d.UltraSSDEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupUpdate. -func (d DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupUpdate. -func (d *DedicatedHostGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceView. -func (d DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceView. -func (d *DedicatedHostInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assetId": - err = unpopulate(val, "AssetID", &d.AssetID) - delete(rawMsg, key) - case "availableCapacity": - err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceViewWithName. -func (d DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceViewWithName. -func (d *DedicatedHostInstanceViewWithName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assetId": - err = unpopulate(val, "AssetID", &d.AssetID) - delete(rawMsg, key) - case "availableCapacity": - err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostListResult. -func (d DedicatedHostListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostListResult. -func (d *DedicatedHostListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostProperties. -func (d DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoReplaceOnFailure", d.AutoReplaceOnFailure) - populate(objectMap, "hostId", d.HostID) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "platformFaultDomain", d.PlatformFaultDomain) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateDateTimeRFC3339(objectMap, "provisioningTime", d.ProvisioningTime) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "virtualMachines", d.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostProperties. -func (d *DedicatedHostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoReplaceOnFailure": - err = unpopulate(val, "AutoReplaceOnFailure", &d.AutoReplaceOnFailure) - delete(rawMsg, key) - case "hostId": - err = unpopulate(val, "HostID", &d.HostID) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &d.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &d.PlatformFaultDomain) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &d.ProvisioningTime) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &d.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostSizeListResult. -func (d DedicatedHostSizeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostSizeListResult. -func (d *DedicatedHostSizeListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostUpdate. -func (d DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostUpdate. -func (d *DedicatedHostUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsProfile. -func (d DiagnosticsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bootDiagnostics", d.BootDiagnostics) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProfile. -func (d *DiagnosticsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &d.BootDiagnostics) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiffDiskSettings. -func (d DiffDiskSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "option", d.Option) - populate(objectMap, "placement", d.Placement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiffDiskSettings. -func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "option": - err = unpopulate(val, "Option", &d.Option) - delete(rawMsg, key) - case "placement": - err = unpopulate(val, "Placement", &d.Placement) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Disallowed. -func (d Disallowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskTypes", d.DiskTypes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Disallowed. -func (d *Disallowed) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskTypes": - err = unpopulate(val, "DiskTypes", &d.DiskTypes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DisallowedConfiguration. -func (d DisallowedConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmDiskType", d.VMDiskType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DisallowedConfiguration. -func (d *DisallowedConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmDiskType": - err = unpopulate(val, "VMDiskType", &d.VMDiskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "managedBy", d.ManagedBy) - populate(objectMap, "managedByExtended", d.ManagedByExtended) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Disk. -func (d *Disk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &d.ManagedBy) - delete(rawMsg, key) - case "managedByExtended": - err = unpopulate(val, "ManagedByExtended", &d.ManagedByExtended) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccess. -func (d DiskAccess) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccess. -func (d *DiskAccess) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessList. -func (d DiskAccessList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessList. -func (d *DiskAccessList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessProperties. -func (d DiskAccessProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessProperties. -func (d *DiskAccessProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessUpdate. -func (d DiskAccessUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessUpdate. -func (d *DiskAccessUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSet. -func (d DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSet. -func (d *DiskEncryptionSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetList. -func (d DiskEncryptionSetList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetList. -func (d *DiskEncryptionSetList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetParameters. -func (d DiskEncryptionSetParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetParameters. -func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdate. -func (d DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdate. -func (d *DiskEncryptionSetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdateProperties. -func (d DiskEncryptionSetUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activeKey", d.ActiveKey) - populate(objectMap, "encryptionType", d.EncryptionType) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "rotationToLatestKeyVersionEnabled", d.RotationToLatestKeyVersionEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdateProperties. -func (d *DiskEncryptionSetUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeKey": - err = unpopulate(val, "ActiveKey", &d.ActiveKey) - delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &d.EncryptionType) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "rotationToLatestKeyVersionEnabled": - err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &d.RotationToLatestKeyVersionEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSettings. -func (d DiskEncryptionSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionKey", d.DiskEncryptionKey) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "keyEncryptionKey", d.KeyEncryptionKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSettings. -func (d *DiskEncryptionSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionKey": - err = unpopulate(val, "DiskEncryptionKey", &d.DiskEncryptionKey) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) - delete(rawMsg, key) - case "keyEncryptionKey": - err = unpopulate(val, "KeyEncryptionKey", &d.KeyEncryptionKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskImageEncryption. -func (d DiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskImageEncryption. -func (d *DiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskInstanceView. -func (d DiskInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionSettings", d.EncryptionSettings) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInstanceView. -func (d *DiskInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &d.EncryptionSettings) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskList. -func (d DiskList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskList. -func (d *DiskList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskProperties. -func (d DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "burstingEnabled", d.BurstingEnabled) - populateDateTimeRFC3339(objectMap, "burstingEnabledTime", d.BurstingEnabledTime) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "creationData", d.CreationData) - populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeBytes", d.DiskSizeBytes) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "diskState", d.DiskState) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", d.HyperVGeneration) - populateDateTimeRFC3339(objectMap, "LastOwnershipUpdateTime", d.LastOwnershipUpdateTime) - populate(objectMap, "maxShares", d.MaxShares) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach) - populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "securityProfile", d.SecurityProfile) - populate(objectMap, "shareInfo", d.ShareInfo) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populate(objectMap, "tier", d.Tier) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "uniqueId", d.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties. -func (d *DiskProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "burstingEnabled": - err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled) - delete(rawMsg, key) - case "burstingEnabledTime": - err = unpopulateDateTimeRFC3339(val, "BurstingEnabledTime", &d.BurstingEnabledTime) - delete(rawMsg, key) - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &d.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "diskIOPSReadOnly": - err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadOnly": - err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &d.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &d.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "LastOwnershipUpdateTime": - err = unpopulateDateTimeRFC3339(val, "LastOwnershipUpdateTime", &d.LastOwnershipUpdateTime) - delete(rawMsg, key) - case "maxShares": - err = unpopulate(val, "MaxShares", &d.MaxShares) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "optimizedForFrequentAttach": - err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach) - delete(rawMsg, key) - case "propertyUpdatesInProgress": - err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &d.SecurityProfile) - delete(rawMsg, key) - case "shareInfo": - err = unpopulate(val, "ShareInfo", &d.ShareInfo) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &d.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskPurchasePlan. -func (d DiskPurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "product", d.Product) - populate(objectMap, "promotionCode", d.PromotionCode) - populate(objectMap, "publisher", d.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskPurchasePlan. -func (d *DiskPurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &d.Product) - delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &d.PromotionCode) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &d.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePoint. -func (d DiskRestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePoint. -func (d *DiskRestorePoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointAttributes. -func (d DiskRestorePointAttributes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "id", d.ID) - populate(objectMap, "sourceDiskRestorePoint", d.SourceDiskRestorePoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointAttributes. -func (d *DiskRestorePointAttributes) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "sourceDiskRestorePoint": - err = unpopulate(val, "SourceDiskRestorePoint", &d.SourceDiskRestorePoint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointInstanceView. -func (d DiskRestorePointInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "replicationStatus", d.ReplicationStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointInstanceView. -func (d *DiskRestorePointInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &d.ReplicationStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointList. -func (d DiskRestorePointList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointList. -func (d *DiskRestorePointList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointProperties. -func (d DiskRestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "familyId", d.FamilyID) - populate(objectMap, "hyperVGeneration", d.HyperVGeneration) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "replicationState", d.ReplicationState) - populate(objectMap, "securityProfile", d.SecurityProfile) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "sourceResourceLocation", d.SourceResourceLocation) - populate(objectMap, "sourceUniqueId", d.SourceUniqueID) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointProperties. -func (d *DiskRestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "familyId": - err = unpopulate(val, "FamilyID", &d.FamilyID) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &d.ReplicationState) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &d.SecurityProfile) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "sourceResourceLocation": - err = unpopulate(val, "SourceResourceLocation", &d.SourceResourceLocation) - delete(rawMsg, key) - case "sourceUniqueId": - err = unpopulate(val, "SourceUniqueID", &d.SourceUniqueID) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointReplicationStatus. -func (d DiskRestorePointReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "status", d.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointReplicationStatus. -func (d *DiskRestorePointReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskSKU. -func (d DiskSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "tier", d.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU. -func (d *DiskSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskSecurityProfile. -func (d DiskSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secureVMDiskEncryptionSetId", d.SecureVMDiskEncryptionSetID) - populate(objectMap, "securityType", d.SecurityType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSecurityProfile. -func (d *DiskSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secureVMDiskEncryptionSetId": - err = unpopulate(val, "SecureVMDiskEncryptionSetID", &d.SecureVMDiskEncryptionSetID) - delete(rawMsg, key) - case "securityType": - err = unpopulate(val, "SecurityType", &d.SecurityType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskUpdate. -func (d DiskUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdate. -func (d *DiskUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskUpdateProperties. -func (d DiskUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "burstingEnabled", d.BurstingEnabled) - populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection) - populate(objectMap, "maxShares", d.MaxShares) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach) - populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populate(objectMap, "tier", d.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdateProperties. -func (d *DiskUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "burstingEnabled": - err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "diskIOPSReadOnly": - err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadOnly": - err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection) - delete(rawMsg, key) - case "maxShares": - err = unpopulate(val, "MaxShares", &d.MaxShares) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "optimizedForFrequentAttach": - err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach) - delete(rawMsg, key) - case "propertyUpdatesInProgress": - err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Encryption. -func (e Encryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", e.DiskEncryptionSetID) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. -func (e *Encryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &e.DiskEncryptionSetID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity. -func (e EncryptionIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "userAssignedIdentityResourceId", e.UserAssignedIdentityResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity. -func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "userAssignedIdentityResourceId": - err = unpopulate(val, "UserAssignedIdentityResourceID", &e.UserAssignedIdentityResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionImages. -func (e EncryptionImages) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", e.DataDiskImages) - populate(objectMap, "osDiskImage", e.OSDiskImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionImages. -func (e *EncryptionImages) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &e.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &e.OSDiskImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSetIdentity. -func (e EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", e.PrincipalID) - populate(objectMap, "tenantId", e.TenantID) - populate(objectMap, "type", e.Type) - populate(objectMap, "userAssignedIdentities", e.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetIdentity. -func (e *EncryptionSetIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &e.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &e.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &e.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties. -func (e EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activeKey", e.ActiveKey) - populate(objectMap, "autoKeyRotationError", e.AutoKeyRotationError) - populate(objectMap, "encryptionType", e.EncryptionType) - populate(objectMap, "federatedClientId", e.FederatedClientID) - populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp) - populate(objectMap, "previousKeys", e.PreviousKeys) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "rotationToLatestKeyVersionEnabled", e.RotationToLatestKeyVersionEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties. -func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeKey": - err = unpopulate(val, "ActiveKey", &e.ActiveKey) - delete(rawMsg, key) - case "autoKeyRotationError": - err = unpopulate(val, "AutoKeyRotationError", &e.AutoKeyRotationError) - delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &e.EncryptionType) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &e.FederatedClientID) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp) - delete(rawMsg, key) - case "previousKeys": - err = unpopulate(val, "PreviousKeys", &e.PreviousKeys) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "rotationToLatestKeyVersionEnabled": - err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &e.RotationToLatestKeyVersionEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsCollection. -func (e EncryptionSettingsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", e.Enabled) - populate(objectMap, "encryptionSettings", e.EncryptionSettings) - populate(objectMap, "encryptionSettingsVersion", e.EncryptionSettingsVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsCollection. -func (e *EncryptionSettingsCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &e.Enabled) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &e.EncryptionSettings) - delete(rawMsg, key) - case "encryptionSettingsVersion": - err = unpopulate(val, "EncryptionSettingsVersion", &e.EncryptionSettingsVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsElement. -func (e EncryptionSettingsElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionKey", e.DiskEncryptionKey) - populate(objectMap, "keyEncryptionKey", e.KeyEncryptionKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsElement. -func (e *EncryptionSettingsElement) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionKey": - err = unpopulate(val, "DiskEncryptionKey", &e.DiskEncryptionKey) - delete(rawMsg, key) - case "keyEncryptionKey": - err = unpopulate(val, "KeyEncryptionKey", &e.KeyEncryptionKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventGridAndResourceGraph. -func (e EventGridAndResourceGraph) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", e.Enable) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridAndResourceGraph. -func (e *EventGridAndResourceGraph) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &e.Enable) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. -func (e ExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. -func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Extension. -func (e Extension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. -func (e *Extension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Gallery. -func (g *Gallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplication. -func (g GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplication. -func (g *GalleryApplication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomAction. -func (g GalleryApplicationCustomAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "name", g.Name) - populate(objectMap, "parameters", g.Parameters) - populate(objectMap, "script", g.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomAction. -func (g *GalleryApplicationCustomAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &g.Parameters) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &g.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomActionParameter. -func (g GalleryApplicationCustomActionParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultValue", g.DefaultValue) - populate(objectMap, "description", g.Description) - populate(objectMap, "name", g.Name) - populate(objectMap, "required", g.Required) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomActionParameter. -func (g *GalleryApplicationCustomActionParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &g.DefaultValue) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "required": - err = unpopulate(val, "Required", &g.Required) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationList. -func (g GalleryApplicationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationList. -func (g *GalleryApplicationList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationProperties. -func (g GalleryApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customActions", g.CustomActions) - populate(objectMap, "description", g.Description) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - populate(objectMap, "supportedOSType", g.SupportedOSType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationProperties. -func (g *GalleryApplicationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customActions": - err = unpopulate(val, "CustomActions", &g.CustomActions) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - case "supportedOSType": - err = unpopulate(val, "SupportedOSType", &g.SupportedOSType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationUpdate. -func (g GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationUpdate. -func (g *GalleryApplicationUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersion. -func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersion. -func (g *GalleryApplicationVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionList. -func (g GalleryApplicationVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionList. -func (g *GalleryApplicationVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionProperties. -func (g GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "publishingProfile", g.PublishingProfile) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "safetyProfile", g.SafetyProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionProperties. -func (g *GalleryApplicationVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishingProfile": - err = unpopulate(val, "PublishingProfile", &g.PublishingProfile) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "safetyProfile": - err = unpopulate(val, "SafetyProfile", &g.SafetyProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "advancedSettings", g.AdvancedSettings) - populate(objectMap, "customActions", g.CustomActions) - populate(objectMap, "enableHealthCheck", g.EnableHealthCheck) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populate(objectMap, "manageActions", g.ManageActions) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "settings", g.Settings) - populate(objectMap, "source", g.Source) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &g.AdvancedSettings) - delete(rawMsg, key) - case "customActions": - err = unpopulate(val, "CustomActions", &g.CustomActions) - delete(rawMsg, key) - case "enableHealthCheck": - err = unpopulate(val, "EnableHealthCheck", &g.EnableHealthCheck) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "manageActions": - err = unpopulate(val, "ManageActions", &g.ManageActions) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &g.Settings) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionSafetyProfile. -func (g GalleryApplicationVersionSafetyProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionSafetyProfile. -func (g *GalleryApplicationVersionSafetyProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionUpdate. -func (g GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionUpdate. -func (g *GalleryApplicationVersionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactPublishingProfileBase. -func (g GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactPublishingProfileBase. -func (g *GalleryArtifactPublishingProfileBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSafetyProfileBase. -func (g GalleryArtifactSafetyProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSafetyProfileBase. -func (g *GalleryArtifactSafetyProfileBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSource. -func (g GalleryArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "managedImage", g.ManagedImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSource. -func (g *GalleryArtifactSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "managedImage": - err = unpopulate(val, "ManagedImage", &g.ManagedImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionFullSource. -func (g GalleryArtifactVersionFullSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", g.CommunityGalleryImageID) - populate(objectMap, "id", g.ID) - populate(objectMap, "virtualMachineId", g.VirtualMachineID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionFullSource. -func (g *GalleryArtifactVersionFullSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &g.CommunityGalleryImageID) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &g.VirtualMachineID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionSource. -func (g GalleryArtifactVersionSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionSource. -func (g *GalleryArtifactVersionSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDataDiskImage. -func (g GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "lun", g.Lun) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDataDiskImage. -func (g *GalleryDataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &g.Lun) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImage. -func (g GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImage. -func (g *GalleryDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImageSource. -func (g GalleryDiskImageSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "storageAccountId", g.StorageAccountID) - populate(objectMap, "uri", g.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImageSource. -func (g *GalleryDiskImageSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &g.StorageAccountID) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &g.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryExtendedLocation. -func (g GalleryExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", g.Name) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryExtendedLocation. -func (g *GalleryExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryIdentifier. -func (g GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueName", g.UniqueName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryIdentifier. -func (g *GalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueName": - err = unpopulate(val, "UniqueName", &g.UniqueName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImage. -func (g GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage. -func (g *GalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageFeature. -func (g GalleryImageFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", g.Name) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageFeature. -func (g *GalleryImageFeature) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageIdentifier. -func (g GalleryImageIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "offer", g.Offer) - populate(objectMap, "publisher", g.Publisher) - populate(objectMap, "sku", g.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageIdentifier. -func (g *GalleryImageIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offer": - err = unpopulate(val, "Offer", &g.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &g.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &g.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageList. -func (g GalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList. -func (g *GalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. -func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", g.Architecture) - populate(objectMap, "description", g.Description) - populate(objectMap, "disallowed", g.Disallowed) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "features", g.Features) - populate(objectMap, "hyperVGeneration", g.HyperVGeneration) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "osState", g.OSState) - populate(objectMap, "osType", g.OSType) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "purchasePlan", g.PurchasePlan) - populate(objectMap, "recommended", g.Recommended) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties. -func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &g.Architecture) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &g.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &g.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &g.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &g.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &g.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &g.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &g.Recommended) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageUpdate. -func (g GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageUpdate. -func (g *GalleryImageUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersion. -func (g GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersion. -func (g *GalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionList. -func (g GalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionList. -func (g *GalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionProperties. -func (g GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "publishingProfile", g.PublishingProfile) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "safetyProfile", g.SafetyProfile) - populate(objectMap, "securityProfile", g.SecurityProfile) - populate(objectMap, "storageProfile", g.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionProperties. -func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishingProfile": - err = unpopulate(val, "PublishingProfile", &g.PublishingProfile) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "safetyProfile": - err = unpopulate(val, "SafetyProfile", &g.SafetyProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &g.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &g.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionPublishingProfile. -func (g GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionPublishingProfile. -func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionSafetyProfile. -func (g GalleryImageVersionSafetyProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - populate(objectMap, "policyViolations", g.PolicyViolations) - populate(objectMap, "reportedForPolicyViolation", g.ReportedForPolicyViolation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionSafetyProfile. -func (g *GalleryImageVersionSafetyProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - case "policyViolations": - err = unpopulate(val, "PolicyViolations", &g.PolicyViolations) - delete(rawMsg, key) - case "reportedForPolicyViolation": - err = unpopulate(val, "ReportedForPolicyViolation", &g.ReportedForPolicyViolation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionStorageProfile. -func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", g.DataDiskImages) - populate(objectMap, "osDiskImage", g.OSDiskImage) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile. -func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &g.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &g.OSDiskImage) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUefiSettings. -func (g GalleryImageVersionUefiSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalSignatures", g.AdditionalSignatures) - populate(objectMap, "signatureTemplateNames", g.SignatureTemplateNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUefiSettings. -func (g *GalleryImageVersionUefiSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalSignatures": - err = unpopulate(val, "AdditionalSignatures", &g.AdditionalSignatures) - delete(rawMsg, key) - case "signatureTemplateNames": - err = unpopulate(val, "SignatureTemplateNames", &g.SignatureTemplateNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate. -func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate. -func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryList. -func (g GalleryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryList. -func (g *GalleryList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryOSDiskImage. -func (g GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryOSDiskImage. -func (g *GalleryOSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryProperties. -func (g GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "sharingProfile", g.SharingProfile) - populate(objectMap, "sharingStatus", g.SharingStatus) - populate(objectMap, "softDeletePolicy", g.SoftDeletePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties. -func (g *GalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "sharingProfile": - err = unpopulate(val, "SharingProfile", &g.SharingProfile) - delete(rawMsg, key) - case "sharingStatus": - err = unpopulate(val, "SharingStatus", &g.SharingStatus) - delete(rawMsg, key) - case "softDeletePolicy": - err = unpopulate(val, "SoftDeletePolicy", &g.SoftDeletePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryTargetExtendedLocation. -func (g GalleryTargetExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", g.Encryption) - populate(objectMap, "extendedLocation", g.ExtendedLocation) - populate(objectMap, "extendedLocationReplicaCount", g.ExtendedLocationReplicaCount) - populate(objectMap, "name", g.Name) - populate(objectMap, "storageAccountType", g.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryTargetExtendedLocation. -func (g *GalleryTargetExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &g.Encryption) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &g.ExtendedLocation) - delete(rawMsg, key) - case "extendedLocationReplicaCount": - err = unpopulate(val, "ExtendedLocationReplicaCount", &g.ExtendedLocationReplicaCount) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryUpdate. -func (g GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryUpdate. -func (g *GalleryUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GrantAccessData. -func (g GrantAccessData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "access", g.Access) - populate(objectMap, "durationInSeconds", g.DurationInSeconds) - populate(objectMap, "fileFormat", g.FileFormat) - populate(objectMap, "getSecureVMGuestStateSAS", g.GetSecureVMGuestStateSAS) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GrantAccessData. -func (g *GrantAccessData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &g.Access) - delete(rawMsg, key) - case "durationInSeconds": - err = unpopulate(val, "DurationInSeconds", &g.DurationInSeconds) - delete(rawMsg, key) - case "fileFormat": - err = unpopulate(val, "FileFormat", &g.FileFormat) - delete(rawMsg, key) - case "getSecureVMGuestStateSAS": - err = unpopulate(val, "GetSecureVMGuestStateSAS", &g.GetSecureVMGuestStateSAS) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HardwareProfile. -func (h HardwareProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSize", h.VMSize) - populate(objectMap, "vmSizeProperties", h.VMSizeProperties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfile. -func (h *HardwareProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSize": - err = unpopulate(val, "VMSize", &h.VMSize) - delete(rawMsg, key) - case "vmSizeProperties": - err = unpopulate(val, "VMSizeProperties", &h.VMSizeProperties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", i.ExtendedLocation) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Image. -func (i *Image) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &i.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDataDisk. -func (i ImageDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "lun", i.Lun) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDataDisk. -func (i *ImageDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &i.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDeprecationStatus. -func (i ImageDeprecationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "alternativeOption", i.AlternativeOption) - populate(objectMap, "imageState", i.ImageState) - populateDateTimeRFC3339(objectMap, "scheduledDeprecationTime", i.ScheduledDeprecationTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDeprecationStatus. -func (i *ImageDeprecationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "alternativeOption": - err = unpopulate(val, "AlternativeOption", &i.AlternativeOption) - delete(rawMsg, key) - case "imageState": - err = unpopulate(val, "ImageState", &i.ImageState) - delete(rawMsg, key) - case "scheduledDeprecationTime": - err = unpopulateDateTimeRFC3339(val, "ScheduledDeprecationTime", &i.ScheduledDeprecationTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDisk. -func (i ImageDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDisk. -func (i *ImageDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDiskReference. -func (i ImageDiskReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID) - populate(objectMap, "id", i.ID) - populate(objectMap, "lun", i.Lun) - populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDiskReference. -func (i *ImageDiskReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &i.Lun) - delete(rawMsg, key) - case "sharedGalleryImageId": - err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageListResult. -func (i ImageListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageListResult. -func (i *ImageListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageOSDisk. -func (i ImageOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "osState", i.OSState) - populate(objectMap, "osType", i.OSType) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageOSDisk. -func (i *ImageOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &i.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &i.OSType) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageProperties. -func (i ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hyperVGeneration", i.HyperVGeneration) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "sourceVirtualMachine", i.SourceVirtualMachine) - populate(objectMap, "storageProfile", i.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties. -func (i *ImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &i.HyperVGeneration) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "sourceVirtualMachine": - err = unpopulate(val, "SourceVirtualMachine", &i.SourceVirtualMachine) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &i.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImagePurchasePlan. -func (i ImagePurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", i.Name) - populate(objectMap, "product", i.Product) - populate(objectMap, "publisher", i.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImagePurchasePlan. -func (i *ImagePurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &i.Product) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &i.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageReference. -func (i ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID) - populate(objectMap, "exactVersion", i.ExactVersion) - populate(objectMap, "id", i.ID) - populate(objectMap, "offer", i.Offer) - populate(objectMap, "publisher", i.Publisher) - populate(objectMap, "sku", i.SKU) - populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID) - populate(objectMap, "version", i.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference. -func (i *ImageReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID) - delete(rawMsg, key) - case "exactVersion": - err = unpopulate(val, "ExactVersion", &i.ExactVersion) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "offer": - err = unpopulate(val, "Offer", &i.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &i.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &i.SKU) - delete(rawMsg, key) - case "sharedGalleryImageId": - err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &i.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageStorageProfile. -func (i ImageStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", i.DataDisks) - populate(objectMap, "osDisk", i.OSDisk) - populate(objectMap, "zoneResilient", i.ZoneResilient) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageStorageProfile. -func (i *ImageStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &i.DataDisks) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &i.OSDisk) - delete(rawMsg, key) - case "zoneResilient": - err = unpopulate(val, "ZoneResilient", &i.ZoneResilient) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageUpdate. -func (i ImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdate. -func (i *ImageUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageVersionSecurityProfile. -func (i ImageVersionSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uefiSettings", i.UefiSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionSecurityProfile. -func (i *ImageVersionSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uefiSettings": - err = unpopulate(val, "UefiSettings", &i.UefiSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InnerError. -func (i InnerError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errordetail", i.Errordetail) - populate(objectMap, "exceptiontype", i.Exceptiontype) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InnerError. -func (i *InnerError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errordetail": - err = unpopulate(val, "Errordetail", &i.Errordetail) - delete(rawMsg, key) - case "exceptiontype": - err = unpopulate(val, "Exceptiontype", &i.Exceptiontype) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceSKU. -func (i InstanceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", i.Name) - populate(objectMap, "tier", i.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceSKU. -func (i *InstanceSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &i.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatus. -func (i InstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", i.Code) - populate(objectMap, "displayStatus", i.DisplayStatus) - populate(objectMap, "level", i.Level) - populate(objectMap, "message", i.Message) - populateDateTimeRFC3339(objectMap, "time", i.Time) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatus. -func (i *InstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &i.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &i.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &i.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &i.Message) - delete(rawMsg, key) - case "time": - err = unpopulateDateTimeRFC3339(val, "Time", &i.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatusesSummary. -func (i InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statusesSummary", i.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatusesSummary. -func (i *InstanceViewStatusesSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &i.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyForDiskEncryptionSet. -func (k KeyForDiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyForDiskEncryptionSet. -func (k *KeyForDiskEncryptionSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndKeyReference. -func (k KeyVaultAndKeyReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndKeyReference. -func (k *KeyVaultAndKeyReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndSecretReference. -func (k KeyVaultAndSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", k.SecretURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndSecretReference. -func (k *KeyVaultAndSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &k.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultKeyReference. -func (k KeyVaultKeyReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultKeyReference. -func (k *KeyVaultKeyReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultSecretReference. -func (k KeyVaultSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", k.SecretURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReference. -func (k *KeyVaultSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &k.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LastPatchInstallationSummary. -func (l LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", l.Error) - populate(objectMap, "excludedPatchCount", l.ExcludedPatchCount) - populate(objectMap, "failedPatchCount", l.FailedPatchCount) - populate(objectMap, "installationActivityId", l.InstallationActivityID) - populate(objectMap, "installedPatchCount", l.InstalledPatchCount) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) - populate(objectMap, "maintenanceWindowExceeded", l.MaintenanceWindowExceeded) - populate(objectMap, "notSelectedPatchCount", l.NotSelectedPatchCount) - populate(objectMap, "pendingPatchCount", l.PendingPatchCount) - populateDateTimeRFC3339(objectMap, "startTime", l.StartTime) - populate(objectMap, "status", l.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LastPatchInstallationSummary. -func (l *LastPatchInstallationSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &l.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &l.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &l.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &l.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &l.InstalledPatchCount) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &l.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &l.NotSelectedPatchCount) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &l.PendingPatchCount) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LatestGalleryImageVersion. -func (l LatestGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "latestVersionName", l.LatestVersionName) - populate(objectMap, "location", l.Location) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LatestGalleryImageVersion. -func (l *LatestGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "latestVersionName": - err = unpopulate(val, "LatestVersionName", &l.LatestVersionName) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration. -func (l LinuxConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "disablePasswordAuthentication", l.DisablePasswordAuthentication) - populate(objectMap, "enableVMAgentPlatformUpdates", l.EnableVMAgentPlatformUpdates) - populate(objectMap, "patchSettings", l.PatchSettings) - populate(objectMap, "provisionVMAgent", l.ProvisionVMAgent) - populate(objectMap, "ssh", l.SSH) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration. -func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disablePasswordAuthentication": - err = unpopulate(val, "DisablePasswordAuthentication", &l.DisablePasswordAuthentication) - delete(rawMsg, key) - case "enableVMAgentPlatformUpdates": - err = unpopulate(val, "EnableVMAgentPlatformUpdates", &l.EnableVMAgentPlatformUpdates) - delete(rawMsg, key) - case "patchSettings": - err = unpopulate(val, "PatchSettings", &l.PatchSettings) - delete(rawMsg, key) - case "provisionVMAgent": - err = unpopulate(val, "ProvisionVMAgent", &l.ProvisionVMAgent) - delete(rawMsg, key) - case "ssh": - err = unpopulate(val, "SSH", &l.SSH) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxParameters. -func (l LinuxParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classificationsToInclude", l.ClassificationsToInclude) - populate(objectMap, "maintenanceRunId", l.MaintenanceRunID) - populate(objectMap, "packageNameMasksToExclude", l.PackageNameMasksToExclude) - populate(objectMap, "packageNameMasksToInclude", l.PackageNameMasksToInclude) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxParameters. -func (l *LinuxParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classificationsToInclude": - err = unpopulate(val, "ClassificationsToInclude", &l.ClassificationsToInclude) - delete(rawMsg, key) - case "maintenanceRunId": - err = unpopulate(val, "MaintenanceRunID", &l.MaintenanceRunID) - delete(rawMsg, key) - case "packageNameMasksToExclude": - err = unpopulate(val, "PackageNameMasksToExclude", &l.PackageNameMasksToExclude) - delete(rawMsg, key) - case "packageNameMasksToInclude": - err = unpopulate(val, "PackageNameMasksToInclude", &l.PackageNameMasksToInclude) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxPatchSettings. -func (l LinuxPatchSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentMode", l.AssessmentMode) - populate(objectMap, "automaticByPlatformSettings", l.AutomaticByPlatformSettings) - populate(objectMap, "patchMode", l.PatchMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxPatchSettings. -func (l *LinuxPatchSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentMode": - err = unpopulate(val, "AssessmentMode", &l.AssessmentMode) - delete(rawMsg, key) - case "automaticByPlatformSettings": - err = unpopulate(val, "AutomaticByPlatformSettings", &l.AutomaticByPlatformSettings) - delete(rawMsg, key) - case "patchMode": - err = unpopulate(val, "PatchMode", &l.PatchMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings. -func (l LinuxVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", l.BypassPlatformSafetyChecksOnUserSchedule) - populate(objectMap, "rebootSetting", l.RebootSetting) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings. -func (l *LinuxVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bypassPlatformSafetyChecksOnUserSchedule": - err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &l.BypassPlatformSafetyChecksOnUserSchedule) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &l.RebootSetting) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. -func (l ListUsagesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. -func (l *ListUsagesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration. -func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration. -func (l *LoadBalancerConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfigurationProperties. -func (l LoadBalancerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "frontendIpConfigurations", l.FrontendIPConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfigurationProperties. -func (l *LoadBalancerConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "frontendIpConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfiguration. -func (l LoadBalancerFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfiguration. -func (l *LoadBalancerFrontendIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfigurationProperties. -func (l LoadBalancerFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateIPAddress", l.PrivateIPAddress) - populate(objectMap, "publicIPAddress", l.PublicIPAddress) - populate(objectMap, "subnet", l.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfigurationProperties. -func (l *LoadBalancerFrontendIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &l.PrivateIPAddress) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &l.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &l.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsInputBase. -func (l LogAnalyticsInputBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", l.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", l.FromTime) - populate(objectMap, "groupByClientApplicationId", l.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", l.GroupByOperationName) - populate(objectMap, "groupByResourceName", l.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", l.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", l.GroupByUserAgent) - populateDateTimeRFC3339(objectMap, "toTime", l.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsInputBase. -func (l *LogAnalyticsInputBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &l.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &l.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &l.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &l.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &l.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &l.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &l.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &l.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOperationResult. -func (l LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOperationResult. -func (l *LogAnalyticsOperationResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOutput. -func (l LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "output", l.Output) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOutput. -func (l *LogAnalyticsOutput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "output": - err = unpopulate(val, "Output", &l.Output) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceRedeployStatus. -func (m MaintenanceRedeployStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isCustomerInitiatedMaintenanceAllowed", m.IsCustomerInitiatedMaintenanceAllowed) - populate(objectMap, "lastOperationMessage", m.LastOperationMessage) - populate(objectMap, "lastOperationResultCode", m.LastOperationResultCode) - populateDateTimeRFC3339(objectMap, "maintenanceWindowEndTime", m.MaintenanceWindowEndTime) - populateDateTimeRFC3339(objectMap, "maintenanceWindowStartTime", m.MaintenanceWindowStartTime) - populateDateTimeRFC3339(objectMap, "preMaintenanceWindowEndTime", m.PreMaintenanceWindowEndTime) - populateDateTimeRFC3339(objectMap, "preMaintenanceWindowStartTime", m.PreMaintenanceWindowStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceRedeployStatus. -func (m *MaintenanceRedeployStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isCustomerInitiatedMaintenanceAllowed": - err = unpopulate(val, "IsCustomerInitiatedMaintenanceAllowed", &m.IsCustomerInitiatedMaintenanceAllowed) - delete(rawMsg, key) - case "lastOperationMessage": - err = unpopulate(val, "LastOperationMessage", &m.LastOperationMessage) - delete(rawMsg, key) - case "lastOperationResultCode": - err = unpopulate(val, "LastOperationResultCode", &m.LastOperationResultCode) - delete(rawMsg, key) - case "maintenanceWindowEndTime": - err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowEndTime", &m.MaintenanceWindowEndTime) - delete(rawMsg, key) - case "maintenanceWindowStartTime": - err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowStartTime", &m.MaintenanceWindowStartTime) - delete(rawMsg, key) - case "preMaintenanceWindowEndTime": - err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowEndTime", &m.PreMaintenanceWindowEndTime) - delete(rawMsg, key) - case "preMaintenanceWindowStartTime": - err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowStartTime", &m.PreMaintenanceWindowStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedArtifact. -func (m ManagedArtifact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedArtifact. -func (m *ManagedArtifact) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDiskParameters. -func (m ManagedDiskParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", m.DiskEncryptionSet) - populate(objectMap, "id", m.ID) - populate(objectMap, "securityProfile", m.SecurityProfile) - populate(objectMap, "storageAccountType", m.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDiskParameters. -func (m *ManagedDiskParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &m.DiskEncryptionSet) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &m.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReference. -func (n NetworkInterfaceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "properties", n.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReference. -func (n *NetworkInterfaceReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReferenceProperties. -func (n NetworkInterfaceReferenceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "deleteOption", n.DeleteOption) - populate(objectMap, "primary", n.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReferenceProperties. -func (n *NetworkInterfaceReferenceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deleteOption": - err = unpopulate(val, "DeleteOption", &n.DeleteOption) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &n.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkApiVersion", n.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", n.NetworkInterfaceConfigurations) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. -func (n *NetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &n.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &n.NetworkInterfaceConfigurations) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDisk. -func (o OSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", o.Caching) - populate(objectMap, "createOption", o.CreateOption) - populate(objectMap, "deleteOption", o.DeleteOption) - populate(objectMap, "diffDiskSettings", o.DiffDiskSettings) - populate(objectMap, "diskSizeGB", o.DiskSizeGB) - populate(objectMap, "encryptionSettings", o.EncryptionSettings) - populate(objectMap, "image", o.Image) - populate(objectMap, "managedDisk", o.ManagedDisk) - populate(objectMap, "name", o.Name) - populate(objectMap, "osType", o.OSType) - populate(objectMap, "vhd", o.Vhd) - populate(objectMap, "writeAcceleratorEnabled", o.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDisk. -func (o *OSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &o.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &o.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &o.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &o.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &o.DiskSizeGB) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &o.EncryptionSettings) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &o.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &o.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &o.OSType) - delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &o.Vhd) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &o.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImage. -func (o OSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "operatingSystem", o.OperatingSystem) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImage. -func (o *OSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "operatingSystem": - err = unpopulate(val, "OperatingSystem", &o.OperatingSystem) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImageEncryption. -func (o OSDiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", o.DiskEncryptionSetID) - populate(objectMap, "securityProfile", o.SecurityProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageEncryption. -func (o *OSDiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &o.DiskEncryptionSetID) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &o.SecurityProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImageSecurityProfile. -func (o OSDiskImageSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "confidentialVMEncryptionType", o.ConfidentialVMEncryptionType) - populate(objectMap, "secureVMDiskEncryptionSetId", o.SecureVMDiskEncryptionSetID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageSecurityProfile. -func (o *OSDiskImageSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "confidentialVMEncryptionType": - err = unpopulate(val, "ConfidentialVMEncryptionType", &o.ConfidentialVMEncryptionType) - delete(rawMsg, key) - case "secureVMDiskEncryptionSetId": - err = unpopulate(val, "SecureVMDiskEncryptionSetID", &o.SecureVMDiskEncryptionSetID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamily. -func (o OSFamily) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamily. -func (o *OSFamily) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamilyListResult. -func (o OSFamilyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyListResult. -func (o *OSFamilyListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamilyProperties. -func (o OSFamilyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "label", o.Label) - populate(objectMap, "name", o.Name) - populate(objectMap, "versions", o.Versions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyProperties. -func (o *OSFamilyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "versions": - err = unpopulate(val, "Versions", &o.Versions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSImageNotificationProfile. -func (o OSImageNotificationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", o.Enable) - populate(objectMap, "notBeforeTimeout", o.NotBeforeTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSImageNotificationProfile. -func (o *OSImageNotificationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &o.Enable) - delete(rawMsg, key) - case "notBeforeTimeout": - err = unpopulate(val, "NotBeforeTimeout", &o.NotBeforeTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSProfile. -func (o OSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", o.AdminPassword) - populate(objectMap, "adminUsername", o.AdminUsername) - populate(objectMap, "allowExtensionOperations", o.AllowExtensionOperations) - populate(objectMap, "computerName", o.ComputerName) - populate(objectMap, "customData", o.CustomData) - populate(objectMap, "linuxConfiguration", o.LinuxConfiguration) - populate(objectMap, "requireGuestProvisionSignal", o.RequireGuestProvisionSignal) - populate(objectMap, "secrets", o.Secrets) - populate(objectMap, "windowsConfiguration", o.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfile. -func (o *OSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &o.AdminPassword) - delete(rawMsg, key) - case "adminUsername": - err = unpopulate(val, "AdminUsername", &o.AdminUsername) - delete(rawMsg, key) - case "allowExtensionOperations": - err = unpopulate(val, "AllowExtensionOperations", &o.AllowExtensionOperations) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &o.ComputerName) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &o.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &o.LinuxConfiguration) - delete(rawMsg, key) - case "requireGuestProvisionSignal": - err = unpopulate(val, "RequireGuestProvisionSignal", &o.RequireGuestProvisionSignal) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &o.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &o.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSProfileProvisioningData. -func (o OSProfileProvisioningData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", o.AdminPassword) - populate(objectMap, "customData", o.CustomData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfileProvisioningData. -func (o *OSProfileProvisioningData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &o.AdminPassword) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &o.CustomData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersion. -func (o OSVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersion. -func (o *OSVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionListResult. -func (o OSVersionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionListResult. -func (o *OSVersionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionProperties. -func (o OSVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "family", o.Family) - populate(objectMap, "familyLabel", o.FamilyLabel) - populate(objectMap, "isActive", o.IsActive) - populate(objectMap, "isDefault", o.IsDefault) - populate(objectMap, "label", o.Label) - populate(objectMap, "version", o.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionProperties. -func (o *OSVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "family": - err = unpopulate(val, "Family", &o.Family) - delete(rawMsg, key) - case "familyLabel": - err = unpopulate(val, "FamilyLabel", &o.FamilyLabel) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, "IsActive", &o.IsActive) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &o.IsDefault) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &o.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionPropertiesBase. -func (o OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isActive", o.IsActive) - populate(objectMap, "isDefault", o.IsDefault) - populate(objectMap, "label", o.Label) - populate(objectMap, "version", o.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionPropertiesBase. -func (o *OSVersionPropertiesBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isActive": - err = unpopulate(val, "IsActive", &o.IsActive) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &o.IsDefault) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &o.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationValue. -func (o OperationValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValue. -func (o *OperationValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationValueDisplay. -func (o OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValueDisplay. -func (o *OperationValueDisplay) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceStateInput. -func (o OrchestrationServiceStateInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", o.Action) - populate(objectMap, "serviceName", o.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceStateInput. -func (o *OrchestrationServiceStateInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &o.Action) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &o.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceSummary. -func (o OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serviceName", o.ServiceName) - populate(objectMap, "serviceState", o.ServiceState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceSummary. -func (o *OrchestrationServiceSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceName": - err = unpopulate(val, "ServiceName", &o.ServiceName) - delete(rawMsg, key) - case "serviceState": - err = unpopulate(val, "ServiceState", &o.ServiceState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchInstallationDetail. -func (p PatchInstallationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classifications", p.Classifications) - populate(objectMap, "installationState", p.InstallationState) - populate(objectMap, "kbId", p.KbID) - populate(objectMap, "name", p.Name) - populate(objectMap, "patchId", p.PatchID) - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchInstallationDetail. -func (p *PatchInstallationDetail) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classifications": - err = unpopulate(val, "Classifications", &p.Classifications) - delete(rawMsg, key) - case "installationState": - err = unpopulate(val, "InstallationState", &p.InstallationState) - delete(rawMsg, key) - case "kbId": - err = unpopulate(val, "KbID", &p.KbID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "patchId": - err = unpopulate(val, "PatchID", &p.PatchID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &p.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchSettings. -func (p PatchSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentMode", p.AssessmentMode) - populate(objectMap, "automaticByPlatformSettings", p.AutomaticByPlatformSettings) - populate(objectMap, "enableHotpatching", p.EnableHotpatching) - populate(objectMap, "patchMode", p.PatchMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchSettings. -func (p *PatchSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentMode": - err = unpopulate(val, "AssessmentMode", &p.AssessmentMode) - delete(rawMsg, key) - case "automaticByPlatformSettings": - err = unpopulate(val, "AutomaticByPlatformSettings", &p.AutomaticByPlatformSettings) - delete(rawMsg, key) - case "enableHotpatching": - err = unpopulate(val, "EnableHotpatching", &p.EnableHotpatching) - delete(rawMsg, key) - case "patchMode": - err = unpopulate(val, "PatchMode", &p.PatchMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirCommunityGalleryResource. -func (p PirCommunityGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", p.Identifier) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirCommunityGalleryResource. -func (p *PirCommunityGalleryResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &p.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirResource. -func (p PirResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirResource. -func (p *PirResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirSharedGalleryResource. -func (p PirSharedGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", p.Identifier) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirSharedGalleryResource. -func (p *PirSharedGalleryResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &p.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Plan. -func (p Plan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "product", p.Product) - populate(objectMap, "promotionCode", p.PromotionCode) - populate(objectMap, "publisher", p.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Plan. -func (p *Plan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &p.Product) - delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &p.PromotionCode) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &p.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PolicyViolation. -func (p PolicyViolation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "category", p.Category) - populate(objectMap, "details", p.Details) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation. -func (p *PolicyViolation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "category": - err = unpopulate(val, "Category", &p.Category) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &p.Details) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PriorityMixPolicy. -func (p PriorityMixPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseRegularPriorityCount", p.BaseRegularPriorityCount) - populate(objectMap, "regularPriorityPercentageAboveBase", p.RegularPriorityPercentageAboveBase) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PriorityMixPolicy. -func (p *PriorityMixPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseRegularPriorityCount": - err = unpopulate(val, "BaseRegularPriorityCount", &p.BaseRegularPriorityCount) - delete(rawMsg, key) - case "regularPriorityPercentageAboveBase": - err = unpopulate(val, "RegularPriorityPercentageAboveBase", &p.RegularPriorityPercentageAboveBase) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PropertyUpdatesInProgress. -func (p PropertyUpdatesInProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "targetTier", p.TargetTier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyUpdatesInProgress. -func (p *PropertyUpdatesInProgress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetTier": - err = unpopulate(val, "TargetTier", &p.TargetTier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroup. -func (p ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - populate(objectMap, "zones", p.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroup. -func (p *ProximityPlacementGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &p.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupListResult. -func (p ProximityPlacementGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupListResult. -func (p *ProximityPlacementGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupProperties. -func (p ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availabilitySets", p.AvailabilitySets) - populate(objectMap, "colocationStatus", p.ColocationStatus) - populate(objectMap, "intent", p.Intent) - populate(objectMap, "proximityPlacementGroupType", p.ProximityPlacementGroupType) - populate(objectMap, "virtualMachineScaleSets", p.VirtualMachineScaleSets) - populate(objectMap, "virtualMachines", p.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupProperties. -func (p *ProximityPlacementGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availabilitySets": - err = unpopulate(val, "AvailabilitySets", &p.AvailabilitySets) - delete(rawMsg, key) - case "colocationStatus": - err = unpopulate(val, "ColocationStatus", &p.ColocationStatus) - delete(rawMsg, key) - case "intent": - err = unpopulate(val, "Intent", &p.Intent) - delete(rawMsg, key) - case "proximityPlacementGroupType": - err = unpopulate(val, "ProximityPlacementGroupType", &p.ProximityPlacementGroupType) - delete(rawMsg, key) - case "virtualMachineScaleSets": - err = unpopulate(val, "VirtualMachineScaleSets", &p.VirtualMachineScaleSets) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &p.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupPropertiesIntent. -func (p ProximityPlacementGroupPropertiesIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSizes", p.VMSizes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupPropertiesIntent. -func (p *ProximityPlacementGroupPropertiesIntent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSizes": - err = unpopulate(val, "VMSizes", &p.VMSizes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupUpdate. -func (p ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupUpdate. -func (p *ProximityPlacementGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyAgentSettings. -func (p ProxyAgentSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", p.Enabled) - populate(objectMap, "keyIncarnationId", p.KeyIncarnationID) - populate(objectMap, "mode", p.Mode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyAgentSettings. -func (p *ProxyAgentSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &p.Enabled) - delete(rawMsg, key) - case "keyIncarnationId": - err = unpopulate(val, "KeyIncarnationID", &p.KeyIncarnationID) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &p.Mode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyOnlyResource. -func (p ProxyOnlyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyOnlyResource. -func (p *ProxyOnlyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressSKU. -func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "tier", p.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU. -func (p *PublicIPAddressSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PurchasePlan. -func (p PurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "product", p.Product) - populate(objectMap, "publisher", p.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PurchasePlan. -func (p *PurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &p.Product) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &p.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration. -func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "memory", r.Memory) - populate(objectMap, "vCPUs", r.VCPUs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration. -func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "memory": - err = unpopulate(val, "Memory", &r.Memory) - delete(rawMsg, key) - case "vCPUs": - err = unpopulate(val, "VCPUs", &r.VCPUs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecoveryWalkResponse. -func (r RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextPlatformUpdateDomain", r.NextPlatformUpdateDomain) - populate(objectMap, "walkPerformed", r.WalkPerformed) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryWalkResponse. -func (r *RecoveryWalkResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextPlatformUpdateDomain": - err = unpopulate(val, "NextPlatformUpdateDomain", &r.NextPlatformUpdateDomain) - delete(rawMsg, key) - case "walkPerformed": - err = unpopulate(val, "WalkPerformed", &r.WalkPerformed) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionalReplicationStatus. -func (r RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "details", r.Details) - populate(objectMap, "progress", r.Progress) - populate(objectMap, "region", r.Region) - populate(objectMap, "state", r.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalReplicationStatus. -func (r *RegionalReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &r.Progress) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionalSharingStatus. -func (r RegionalSharingStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "details", r.Details) - populate(objectMap, "region", r.Region) - populate(objectMap, "state", r.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalSharingStatus. -func (r *RegionalSharingStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ReplicationStatus. -func (r ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aggregatedState", r.AggregatedState) - populate(objectMap, "summary", r.Summary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationStatus. -func (r *ReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregatedState": - err = unpopulate(val, "AggregatedState", &r.AggregatedState) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &r.Summary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RequestRateByIntervalInput. -func (r RequestRateByIntervalInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", r.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", r.FromTime) - populate(objectMap, "groupByClientApplicationId", r.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", r.GroupByOperationName) - populate(objectMap, "groupByResourceName", r.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", r.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", r.GroupByUserAgent) - populate(objectMap, "intervalLength", r.IntervalLength) - populateDateTimeRFC3339(objectMap, "toTime", r.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestRateByIntervalInput. -func (r *RequestRateByIntervalInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &r.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &r.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &r.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &r.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &r.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &r.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &r.GroupByUserAgent) - delete(rawMsg, key) - case "intervalLength": - err = unpopulate(val, "IntervalLength", &r.IntervalLength) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &r.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResiliencyPolicy. -func (r ResiliencyPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "resilientVMCreationPolicy", r.ResilientVMCreationPolicy) - populate(objectMap, "resilientVMDeletionPolicy", r.ResilientVMDeletionPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResiliencyPolicy. -func (r *ResiliencyPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "resilientVMCreationPolicy": - err = unpopulate(val, "ResilientVMCreationPolicy", &r.ResilientVMCreationPolicy) - delete(rawMsg, key) - case "resilientVMDeletionPolicy": - err = unpopulate(val, "ResilientVMDeletionPolicy", &r.ResilientVMDeletionPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResilientVMCreationPolicy. -func (r ResilientVMCreationPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMCreationPolicy. -func (r *ResilientVMCreationPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResilientVMDeletionPolicy. -func (r ResilientVMDeletionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMDeletionPolicy. -func (r *ResilientVMDeletionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceInstanceViewStatus. -func (r ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", r.Code) - populate(objectMap, "displayStatus", r.DisplayStatus) - populate(objectMap, "level", r.Level) - populate(objectMap, "message", r.Message) - populateDateTimeRFC3339(objectMap, "time", r.Time) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceInstanceViewStatus. -func (r *ResourceInstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &r.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &r.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &r.Message) - delete(rawMsg, key) - case "time": - err = unpopulateDateTimeRFC3339(val, "Time", &r.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceRange. -func (r ResourceRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "max", r.Max) - populate(objectMap, "min", r.Min) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange. -func (r *ResourceRange) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "max": - err = unpopulate(val, "Max", &r.Max) - delete(rawMsg, key) - case "min": - err = unpopulate(val, "Min", &r.Min) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. -func (r ResourceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apiVersions", r.APIVersions) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "capacity", r.Capacity) - populate(objectMap, "costs", r.Costs) - populate(objectMap, "family", r.Family) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "locationInfo", r.LocationInfo) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "name", r.Name) - populate(objectMap, "resourceType", r.ResourceType) - populate(objectMap, "restrictions", r.Restrictions) - populate(objectMap, "size", r.Size) - populate(objectMap, "tier", r.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. -func (r *ResourceSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiVersions": - err = unpopulate(val, "APIVersions", &r.APIVersions) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &r.Capacity) - delete(rawMsg, key) - case "costs": - err = unpopulate(val, "Costs", &r.Costs) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &r.Family) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "locationInfo": - err = unpopulate(val, "LocationInfo", &r.LocationInfo) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &r.ResourceType) - delete(rawMsg, key) - case "restrictions": - err = unpopulate(val, "Restrictions", &r.Restrictions) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &r.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &r.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. -func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities. -func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity. -func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "default", r.Default) - populate(objectMap, "maximum", r.Maximum) - populate(objectMap, "minimum", r.Minimum) - populate(objectMap, "scaleType", r.ScaleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity. -func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "default": - err = unpopulate(val, "Default", &r.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &r.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &r.Minimum) - delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &r.ScaleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts. -func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedUnit", r.ExtendedUnit) - populate(objectMap, "meterID", r.MeterID) - populate(objectMap, "quantity", r.Quantity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts. -func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedUnit": - err = unpopulate(val, "ExtendedUnit", &r.ExtendedUnit) - delete(rawMsg, key) - case "meterID": - err = unpopulate(val, "MeterID", &r.MeterID) - delete(rawMsg, key) - case "quantity": - err = unpopulate(val, "Quantity", &r.Quantity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKULocationInfo. -func (r ResourceSKULocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocations", r.ExtendedLocations) - populate(objectMap, "location", r.Location) - populate(objectMap, "type", r.Type) - populate(objectMap, "zoneDetails", r.ZoneDetails) - populate(objectMap, "zones", r.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKULocationInfo. -func (r *ResourceSKULocationInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - case "zoneDetails": - err = unpopulate(val, "ZoneDetails", &r.ZoneDetails) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictionInfo. -func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "zones", r.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo. -func (r *ResourceSKURestrictionInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions. -func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "reasonCode", r.ReasonCode) - populate(objectMap, "restrictionInfo", r.RestrictionInfo) - populate(objectMap, "type", r.Type) - populate(objectMap, "values", r.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions. -func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "reasonCode": - err = unpopulate(val, "ReasonCode", &r.ReasonCode) - delete(rawMsg, key) - case "restrictionInfo": - err = unpopulate(val, "RestrictionInfo", &r.RestrictionInfo) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &r.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUZoneDetails. -func (r ResourceSKUZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "name", r.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUZoneDetails. -func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult. -func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult. -func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSharingProfile. -func (r ResourceSharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "subscriptionIds", r.SubscriptionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSharingProfile. -func (r *ResourceSharingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptionIds": - err = unpopulate(val, "SubscriptionIDs", &r.SubscriptionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceURIList. -func (r ResourceURIList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceURIList. -func (r *ResourceURIList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceWithOptionalLocation. -func (r ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithOptionalLocation. -func (r *ResourceWithOptionalLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePoint. -func (r RestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint. -func (r *RestorePoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollection. -func (r RestorePointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollection. -func (r *RestorePointCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionListResult. -func (r RestorePointCollectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionListResult. -func (r *RestorePointCollectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionProperties. -func (r RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "restorePointCollectionId", r.RestorePointCollectionID) - populate(objectMap, "restorePoints", r.RestorePoints) - populate(objectMap, "source", r.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionProperties. -func (r *RestorePointCollectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "restorePointCollectionId": - err = unpopulate(val, "RestorePointCollectionID", &r.RestorePointCollectionID) - delete(rawMsg, key) - case "restorePoints": - err = unpopulate(val, "RestorePoints", &r.RestorePoints) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &r.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionSourceProperties. -func (r RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionSourceProperties. -func (r *RestorePointCollectionSourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionUpdate. -func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionUpdate. -func (r *RestorePointCollectionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointEncryption. -func (r RestorePointEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", r.DiskEncryptionSet) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointEncryption. -func (r *RestorePointEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &r.DiskEncryptionSet) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointInstanceView. -func (r RestorePointInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskRestorePoints", r.DiskRestorePoints) - populate(objectMap, "statuses", r.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointInstanceView. -func (r *RestorePointInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskRestorePoints": - err = unpopulate(val, "DiskRestorePoints", &r.DiskRestorePoints) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &r.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consistencyMode", r.ConsistencyMode) - populate(objectMap, "excludeDisks", r.ExcludeDisks) - populate(objectMap, "instanceView", r.InstanceView) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "sourceMetadata", r.SourceMetadata) - populate(objectMap, "sourceRestorePoint", r.SourceRestorePoint) - populateDateTimeRFC3339(objectMap, "timeCreated", r.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consistencyMode": - err = unpopulate(val, "ConsistencyMode", &r.ConsistencyMode) - delete(rawMsg, key) - case "excludeDisks": - err = unpopulate(val, "ExcludeDisks", &r.ExcludeDisks) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &r.InstanceView) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "sourceMetadata": - err = unpopulate(val, "SourceMetadata", &r.SourceMetadata) - delete(rawMsg, key) - case "sourceRestorePoint": - err = unpopulate(val, "SourceRestorePoint", &r.SourceRestorePoint) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &r.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceMetadata. -func (r RestorePointSourceMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diagnosticsProfile", r.DiagnosticsProfile) - populate(objectMap, "hardwareProfile", r.HardwareProfile) - populate(objectMap, "hyperVGeneration", r.HyperVGeneration) - populate(objectMap, "licenseType", r.LicenseType) - populate(objectMap, "location", r.Location) - populate(objectMap, "osProfile", r.OSProfile) - populate(objectMap, "securityProfile", r.SecurityProfile) - populate(objectMap, "storageProfile", r.StorageProfile) - populate(objectMap, "userData", r.UserData) - populate(objectMap, "vmId", r.VMID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceMetadata. -func (r *RestorePointSourceMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &r.DiagnosticsProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &r.HardwareProfile) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &r.HyperVGeneration) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &r.LicenseType) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &r.OSProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &r.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &r.StorageProfile) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &r.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &r.VMID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMDataDisk. -func (r RestorePointSourceVMDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", r.Caching) - populate(objectMap, "diskRestorePoint", r.DiskRestorePoint) - populate(objectMap, "diskSizeGB", r.DiskSizeGB) - populate(objectMap, "lun", r.Lun) - populate(objectMap, "managedDisk", r.ManagedDisk) - populate(objectMap, "name", r.Name) - populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMDataDisk. -func (r *RestorePointSourceVMDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &r.Caching) - delete(rawMsg, key) - case "diskRestorePoint": - err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &r.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &r.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMOSDisk. -func (r RestorePointSourceVMOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", r.Caching) - populate(objectMap, "diskRestorePoint", r.DiskRestorePoint) - populate(objectMap, "diskSizeGB", r.DiskSizeGB) - populate(objectMap, "encryptionSettings", r.EncryptionSettings) - populate(objectMap, "managedDisk", r.ManagedDisk) - populate(objectMap, "name", r.Name) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMOSDisk. -func (r *RestorePointSourceVMOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &r.Caching) - delete(rawMsg, key) - case "diskRestorePoint": - err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &r.EncryptionSettings) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &r.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMStorageProfile. -func (r RestorePointSourceVMStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", r.DataDisks) - populate(objectMap, "diskControllerType", r.DiskControllerType) - populate(objectMap, "osDisk", r.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMStorageProfile. -func (r *RestorePointSourceVMStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &r.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &r.DiskControllerType) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &r.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RetrieveBootDiagnosticsDataResult. -func (r RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consoleScreenshotBlobUri", r.ConsoleScreenshotBlobURI) - populate(objectMap, "serialConsoleLogBlobUri", r.SerialConsoleLogBlobURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveBootDiagnosticsDataResult. -func (r *RetrieveBootDiagnosticsDataResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consoleScreenshotBlobUri": - err = unpopulate(val, "ConsoleScreenshotBlobURI", &r.ConsoleScreenshotBlobURI) - delete(rawMsg, key) - case "serialConsoleLogBlobUri": - err = unpopulate(val, "SerialConsoleLogBlobURI", &r.SerialConsoleLogBlobURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstance. -func (r RoleInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstance. -func (r *RoleInstance) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceListResult. -func (r RoleInstanceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceListResult. -func (r *RoleInstanceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceNetworkProfile. -func (r RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkInterfaces", r.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceNetworkProfile. -func (r *RoleInstanceNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &r.NetworkInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceProperties. -func (r RoleInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceView", r.InstanceView) - populate(objectMap, "networkProfile", r.NetworkProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceProperties. -func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceView": - err = unpopulate(val, "InstanceView", &r.InstanceView) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &r.NetworkProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceView. -func (r RoleInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "platformFaultDomain", r.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", r.PlatformUpdateDomain) - populate(objectMap, "privateId", r.PrivateID) - populate(objectMap, "statuses", r.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceView. -func (r *RoleInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &r.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &r.PlatformUpdateDomain) - delete(rawMsg, key) - case "privateId": - err = unpopulate(val, "PrivateID", &r.PrivateID) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &r.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstances. -func (r RoleInstances) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "roleInstances", r.RoleInstances) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstances. -func (r *RoleInstances) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "roleInstances": - err = unpopulate(val, "RoleInstances", &r.RoleInstances) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollbackStatusInfo. -func (r RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "failedRolledbackInstanceCount", r.FailedRolledbackInstanceCount) - populate(objectMap, "rollbackError", r.RollbackError) - populate(objectMap, "successfullyRolledbackInstanceCount", r.SuccessfullyRolledbackInstanceCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollbackStatusInfo. -func (r *RollbackStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failedRolledbackInstanceCount": - err = unpopulate(val, "FailedRolledbackInstanceCount", &r.FailedRolledbackInstanceCount) - delete(rawMsg, key) - case "rollbackError": - err = unpopulate(val, "RollbackError", &r.RollbackError) - delete(rawMsg, key) - case "successfullyRolledbackInstanceCount": - err = unpopulate(val, "SuccessfullyRolledbackInstanceCount", &r.SuccessfullyRolledbackInstanceCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradePolicy. -func (r RollingUpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enableCrossZoneUpgrade", r.EnableCrossZoneUpgrade) - populate(objectMap, "maxBatchInstancePercent", r.MaxBatchInstancePercent) - populate(objectMap, "maxSurge", r.MaxSurge) - populate(objectMap, "maxUnhealthyInstancePercent", r.MaxUnhealthyInstancePercent) - populate(objectMap, "maxUnhealthyUpgradedInstancePercent", r.MaxUnhealthyUpgradedInstancePercent) - populate(objectMap, "pauseTimeBetweenBatches", r.PauseTimeBetweenBatches) - populate(objectMap, "prioritizeUnhealthyInstances", r.PrioritizeUnhealthyInstances) - populate(objectMap, "rollbackFailedInstancesOnPolicyBreach", r.RollbackFailedInstancesOnPolicyBreach) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradePolicy. -func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableCrossZoneUpgrade": - err = unpopulate(val, "EnableCrossZoneUpgrade", &r.EnableCrossZoneUpgrade) - delete(rawMsg, key) - case "maxBatchInstancePercent": - err = unpopulate(val, "MaxBatchInstancePercent", &r.MaxBatchInstancePercent) - delete(rawMsg, key) - case "maxSurge": - err = unpopulate(val, "MaxSurge", &r.MaxSurge) - delete(rawMsg, key) - case "maxUnhealthyInstancePercent": - err = unpopulate(val, "MaxUnhealthyInstancePercent", &r.MaxUnhealthyInstancePercent) - delete(rawMsg, key) - case "maxUnhealthyUpgradedInstancePercent": - err = unpopulate(val, "MaxUnhealthyUpgradedInstancePercent", &r.MaxUnhealthyUpgradedInstancePercent) - delete(rawMsg, key) - case "pauseTimeBetweenBatches": - err = unpopulate(val, "PauseTimeBetweenBatches", &r.PauseTimeBetweenBatches) - delete(rawMsg, key) - case "prioritizeUnhealthyInstances": - err = unpopulate(val, "PrioritizeUnhealthyInstances", &r.PrioritizeUnhealthyInstances) - delete(rawMsg, key) - case "rollbackFailedInstancesOnPolicyBreach": - err = unpopulate(val, "RollbackFailedInstancesOnPolicyBreach", &r.RollbackFailedInstancesOnPolicyBreach) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeProgressInfo. -func (r RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "failedInstanceCount", r.FailedInstanceCount) - populate(objectMap, "inProgressInstanceCount", r.InProgressInstanceCount) - populate(objectMap, "pendingInstanceCount", r.PendingInstanceCount) - populate(objectMap, "successfulInstanceCount", r.SuccessfulInstanceCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeProgressInfo. -func (r *RollingUpgradeProgressInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failedInstanceCount": - err = unpopulate(val, "FailedInstanceCount", &r.FailedInstanceCount) - delete(rawMsg, key) - case "inProgressInstanceCount": - err = unpopulate(val, "InProgressInstanceCount", &r.InProgressInstanceCount) - delete(rawMsg, key) - case "pendingInstanceCount": - err = unpopulate(val, "PendingInstanceCount", &r.PendingInstanceCount) - delete(rawMsg, key) - case "successfulInstanceCount": - err = unpopulate(val, "SuccessfulInstanceCount", &r.SuccessfulInstanceCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeRunningStatus. -func (r RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", r.Code) - populate(objectMap, "lastAction", r.LastAction) - populateDateTimeRFC3339(objectMap, "lastActionTime", r.LastActionTime) - populateDateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeRunningStatus. -func (r *RollingUpgradeRunningStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "lastAction": - err = unpopulate(val, "LastAction", &r.LastAction) - delete(rawMsg, key) - case "lastActionTime": - err = unpopulateDateTimeRFC3339(val, "LastActionTime", &r.LastActionTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfo. -func (r RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfo. -func (r *RollingUpgradeStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfoProperties. -func (r RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", r.Error) - populate(objectMap, "policy", r.Policy) - populate(objectMap, "progress", r.Progress) - populate(objectMap, "runningStatus", r.RunningStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfoProperties. -func (r *RollingUpgradeStatusInfoProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &r.Error) - delete(rawMsg, key) - case "policy": - err = unpopulate(val, "Policy", &r.Policy) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &r.Progress) - delete(rawMsg, key) - case "runningStatus": - err = unpopulate(val, "RunningStatus", &r.RunningStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandDocument. -func (r RunCommandDocument) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "id", r.ID) - populate(objectMap, "label", r.Label) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "$schema", r.Schema) - populate(objectMap, "script", r.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocument. -func (r *RunCommandDocument) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &r.Label) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &r.Schema) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &r.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandDocumentBase. -func (r RunCommandDocumentBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "id", r.ID) - populate(objectMap, "label", r.Label) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "$schema", r.Schema) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocumentBase. -func (r *RunCommandDocumentBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &r.Label) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &r.Schema) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandInput. -func (r RunCommandInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "commandId", r.CommandID) - populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "script", r.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInput. -func (r *RunCommandInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandId": - err = unpopulate(val, "CommandID", &r.CommandID) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &r.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandInputParameter. -func (r RunCommandInputParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInputParameter. -func (r *RunCommandInputParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandListResult. -func (r RunCommandListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandListResult. -func (r *RunCommandListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandManagedIdentity. -func (r RunCommandManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", r.ClientID) - populate(objectMap, "objectId", r.ObjectID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandManagedIdentity. -func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &r.ClientID) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &r.ObjectID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandParameterDefinition. -func (r RunCommandParameterDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultValue", r.DefaultValue) - populate(objectMap, "name", r.Name) - populate(objectMap, "required", r.Required) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandParameterDefinition. -func (r *RunCommandParameterDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &r.DefaultValue) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "required": - err = unpopulate(val, "Required", &r.Required) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandResult. -func (r RunCommandResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandResult. -func (r *RunCommandResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "publicKeys", s.PublicKeys) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration. -func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "publicKeys": - err = unpopulate(val, "PublicKeys", &s.PublicKeys) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHGenerateKeyPairInputParameters. -func (s SSHGenerateKeyPairInputParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionType", s.EncryptionType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHGenerateKeyPairInputParameters. -func (s *SSHGenerateKeyPairInputParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionType": - err = unpopulate(val, "EncryptionType", &s.EncryptionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. -func (s SSHPublicKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyData", s.KeyData) - populate(objectMap, "path", s.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. -func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyData": - err = unpopulate(val, "KeyData", &s.KeyData) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &s.Path) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyGenerateKeyPairResult. -func (s SSHPublicKeyGenerateKeyPairResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "privateKey", s.PrivateKey) - populate(objectMap, "publicKey", s.PublicKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyGenerateKeyPairResult. -func (s *SSHPublicKeyGenerateKeyPairResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &s.PrivateKey) - delete(rawMsg, key) - case "publicKey": - err = unpopulate(val, "PublicKey", &s.PublicKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResource. -func (s SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResource. -func (s *SSHPublicKeyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResourceProperties. -func (s SSHPublicKeyResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "publicKey", s.PublicKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResourceProperties. -func (s *SSHPublicKeyResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "publicKey": - err = unpopulate(val, "PublicKey", &s.PublicKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyUpdateResource. -func (s SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyUpdateResource. -func (s *SSHPublicKeyUpdateResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeysGroupListResult. -func (s SSHPublicKeysGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeysGroupListResult. -func (s *SSHPublicKeysGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScaleInPolicy. -func (s ScaleInPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "forceDeletion", s.ForceDeletion) - populate(objectMap, "rules", s.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleInPolicy. -func (s *ScaleInPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "forceDeletion": - err = unpopulate(val, "ForceDeletion", &s.ForceDeletion) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &s.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsAdditionalPublishingTargets. -func (s ScheduledEventsAdditionalPublishingTargets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eventGridAndResourceGraph", s.EventGridAndResourceGraph) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsAdditionalPublishingTargets. -func (s *ScheduledEventsAdditionalPublishingTargets) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventGridAndResourceGraph": - err = unpopulate(val, "EventGridAndResourceGraph", &s.EventGridAndResourceGraph) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsPolicy. -func (s ScheduledEventsPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "scheduledEventsAdditionalPublishingTargets", s.ScheduledEventsAdditionalPublishingTargets) - populate(objectMap, "userInitiatedReboot", s.UserInitiatedReboot) - populate(objectMap, "userInitiatedRedeploy", s.UserInitiatedRedeploy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsPolicy. -func (s *ScheduledEventsPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "scheduledEventsAdditionalPublishingTargets": - err = unpopulate(val, "ScheduledEventsAdditionalPublishingTargets", &s.ScheduledEventsAdditionalPublishingTargets) - delete(rawMsg, key) - case "userInitiatedReboot": - err = unpopulate(val, "UserInitiatedReboot", &s.UserInitiatedReboot) - delete(rawMsg, key) - case "userInitiatedRedeploy": - err = unpopulate(val, "UserInitiatedRedeploy", &s.UserInitiatedRedeploy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsProfile. -func (s ScheduledEventsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "osImageNotificationProfile", s.OSImageNotificationProfile) - populate(objectMap, "terminateNotificationProfile", s.TerminateNotificationProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsProfile. -func (s *ScheduledEventsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "osImageNotificationProfile": - err = unpopulate(val, "OSImageNotificationProfile", &s.OSImageNotificationProfile) - delete(rawMsg, key) - case "terminateNotificationProfile": - err = unpopulate(val, "TerminateNotificationProfile", &s.TerminateNotificationProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPostureReference. -func (s SecurityPostureReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "excludeExtensions", s.ExcludeExtensions) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPostureReference. -func (s *SecurityPostureReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "excludeExtensions": - err = unpopulate(val, "ExcludeExtensions", &s.ExcludeExtensions) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityProfile. -func (s SecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionAtHost", s.EncryptionAtHost) - populate(objectMap, "encryptionIdentity", s.EncryptionIdentity) - populate(objectMap, "proxyAgentSettings", s.ProxyAgentSettings) - populate(objectMap, "securityType", s.SecurityType) - populate(objectMap, "uefiSettings", s.UefiSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityProfile. -func (s *SecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionAtHost": - err = unpopulate(val, "EncryptionAtHost", &s.EncryptionAtHost) - delete(rawMsg, key) - case "encryptionIdentity": - err = unpopulate(val, "EncryptionIdentity", &s.EncryptionIdentity) - delete(rawMsg, key) - case "proxyAgentSettings": - err = unpopulate(val, "ProxyAgentSettings", &s.ProxyAgentSettings) - delete(rawMsg, key) - case "securityType": - err = unpopulate(val, "SecurityType", &s.SecurityType) - delete(rawMsg, key) - case "uefiSettings": - err = unpopulate(val, "UefiSettings", &s.UefiSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceArtifactReference. -func (s ServiceArtifactReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceArtifactReference. -func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ShareInfoElement. -func (s ShareInfoElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmUri", s.VMURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ShareInfoElement. -func (s *ShareInfoElement) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmUri": - err = unpopulate(val, "VMURI", &s.VMURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGallery. -func (s SharedGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGallery. -func (s *SharedGallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDataDiskImage. -func (s SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - populate(objectMap, "lun", s.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDataDiskImage. -func (s *SharedGalleryDataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &s.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDiskImage. -func (s SharedGalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDiskImage. -func (s *SharedGalleryDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryIdentifier. -func (s SharedGalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", s.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryIdentifier. -func (s *SharedGalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &s.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImage. -func (s SharedGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImage. -func (s *SharedGalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageList. -func (s SharedGalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageList. -func (s *SharedGalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageProperties. -func (s SharedGalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", s.Architecture) - populate(objectMap, "artifactTags", s.ArtifactTags) - populate(objectMap, "disallowed", s.Disallowed) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate) - populate(objectMap, "eula", s.Eula) - populate(objectMap, "features", s.Features) - populate(objectMap, "hyperVGeneration", s.HyperVGeneration) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "osState", s.OSState) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "privacyStatementUri", s.PrivacyStatementURI) - populate(objectMap, "purchasePlan", s.PurchasePlan) - populate(objectMap, "recommended", s.Recommended) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageProperties. -func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &s.Architecture) - delete(rawMsg, key) - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &s.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &s.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &s.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &s.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &s.PrivacyStatementURI) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &s.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersion. -func (s SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersion. -func (s *SharedGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionList. -func (s SharedGalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionList. -func (s *SharedGalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionProperties. -func (s SharedGalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", s.ArtifactTags) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", s.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", s.PublishedDate) - populate(objectMap, "storageProfile", s.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionProperties. -func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &s.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &s.PublishedDate) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionStorageProfile. -func (s SharedGalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", s.DataDiskImages) - populate(objectMap, "osDiskImage", s.OSDiskImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionStorageProfile. -func (s *SharedGalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &s.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &s.OSDiskImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryList. -func (s SharedGalleryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryList. -func (s *SharedGalleryList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryOSDiskImage. -func (s SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryOSDiskImage. -func (s *SharedGalleryOSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryProperties. -func (s SharedGalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", s.ArtifactTags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryProperties. -func (s *SharedGalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfile. -func (s SharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryInfo", s.CommunityGalleryInfo) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "permissions", s.Permissions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfile. -func (s *SharingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryInfo": - err = unpopulate(val, "CommunityGalleryInfo", &s.CommunityGalleryInfo) - delete(rawMsg, key) - case "groups": - err = unpopulate(val, "Groups", &s.Groups) - delete(rawMsg, key) - case "permissions": - err = unpopulate(val, "Permissions", &s.Permissions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfileGroup. -func (s SharingProfileGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ids", s.IDs) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfileGroup. -func (s *SharingProfileGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ids": - err = unpopulate(val, "IDs", &s.IDs) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingStatus. -func (s SharingStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aggregatedState", s.AggregatedState) - populate(objectMap, "summary", s.Summary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingStatus. -func (s *SharingStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregatedState": - err = unpopulate(val, "AggregatedState", &s.AggregatedState) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &s.Summary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingUpdate. -func (s SharingUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "operationType", s.OperationType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingUpdate. -func (s *SharingUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groups": - err = unpopulate(val, "Groups", &s.Groups) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &s.OperationType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", s.ExtendedLocation) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "managedBy", s.ManagedBy) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Snapshot. -func (s *Snapshot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &s.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &s.ManagedBy) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotList. -func (s SnapshotList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotList. -func (s *SnapshotList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotProperties. -func (s SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", s.CompletionPercent) - populate(objectMap, "copyCompletionError", s.CopyCompletionError) - populate(objectMap, "creationData", s.CreationData) - populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode) - populate(objectMap, "diskAccessId", s.DiskAccessID) - populate(objectMap, "diskSizeBytes", s.DiskSizeBytes) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "diskState", s.DiskState) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", s.HyperVGeneration) - populate(objectMap, "incremental", s.Incremental) - populate(objectMap, "incrementalSnapshotFamilyId", s.IncrementalSnapshotFamilyID) - populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "purchasePlan", s.PurchasePlan) - populate(objectMap, "securityProfile", s.SecurityProfile) - populate(objectMap, "supportedCapabilities", s.SupportedCapabilities) - populate(objectMap, "supportsHibernation", s.SupportsHibernation) - populateDateTimeRFC3339(objectMap, "timeCreated", s.TimeCreated) - populate(objectMap, "uniqueId", s.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotProperties. -func (s *SnapshotProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &s.CompletionPercent) - delete(rawMsg, key) - case "copyCompletionError": - err = unpopulate(val, "CopyCompletionError", &s.CopyCompletionError) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &s.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &s.DiskAccessID) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &s.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &s.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "incremental": - err = unpopulate(val, "Incremental", &s.Incremental) - delete(rawMsg, key) - case "incrementalSnapshotFamilyId": - err = unpopulate(val, "IncrementalSnapshotFamilyID", &s.IncrementalSnapshotFamilyID) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &s.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &s.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotSKU. -func (s SnapshotSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotSKU. -func (s *SnapshotSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdate. -func (s SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdate. -func (s *SnapshotUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdateProperties. -func (s SnapshotUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode) - populate(objectMap, "diskAccessId", s.DiskAccessID) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection) - populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "supportedCapabilities", s.SupportedCapabilities) - populate(objectMap, "supportsHibernation", s.SupportsHibernation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdateProperties. -func (s *SnapshotUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &s.DiskAccessID) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy. -func (s SoftDeletePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isSoftDeleteEnabled", s.IsSoftDeleteEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy. -func (s *SoftDeletePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isSoftDeleteEnabled": - err = unpopulate(val, "IsSoftDeleteEnabled", &s.IsSoftDeleteEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SourceVault. -func (s SourceVault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceVault. -func (s *SourceVault) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SpotRestorePolicy. -func (s SpotRestorePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", s.Enabled) - populate(objectMap, "restoreTimeout", s.RestoreTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SpotRestorePolicy. -func (s *SpotRestorePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &s.Enabled) - delete(rawMsg, key) - case "restoreTimeout": - err = unpopulate(val, "RestoreTimeout", &s.RestoreTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StatusCodeCount. -func (s StatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", s.Code) - populate(objectMap, "count", s.Count) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatusCodeCount. -func (s *StatusCodeCount) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &s.Code) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &s.Count) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StorageProfile. -func (s StorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", s.DataDisks) - populate(objectMap, "diskControllerType", s.DiskControllerType) - populate(objectMap, "imageReference", s.ImageReference) - populate(objectMap, "osDisk", s.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile. -func (s *StorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &s.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &s.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &s.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &s.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResource. -func (s SubResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. -func (s *SubResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResourceReadOnly. -func (s SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceReadOnly. -func (s *SubResourceReadOnly) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResourceWithColocationStatus. -func (s SubResourceWithColocationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "colocationStatus", s.ColocationStatus) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceWithColocationStatus. -func (s *SubResourceWithColocationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "colocationStatus": - err = unpopulate(val, "ColocationStatus", &s.ColocationStatus) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SupportedCapabilities. -func (s SupportedCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "acceleratedNetwork", s.AcceleratedNetwork) - populate(objectMap, "architecture", s.Architecture) - populate(objectMap, "diskControllerTypes", s.DiskControllerTypes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedCapabilities. -func (s *SupportedCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "acceleratedNetwork": - err = unpopulate(val, "AcceleratedNetwork", &s.AcceleratedNetwork) - delete(rawMsg, key) - case "architecture": - err = unpopulate(val, "Architecture", &s.Architecture) - delete(rawMsg, key) - case "diskControllerTypes": - err = unpopulate(val, "DiskControllerTypes", &s.DiskControllerTypes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TargetRegion. -func (t TargetRegion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", t.Encryption) - populate(objectMap, "excludeFromLatest", t.ExcludeFromLatest) - populate(objectMap, "name", t.Name) - populate(objectMap, "regionalReplicaCount", t.RegionalReplicaCount) - populate(objectMap, "storageAccountType", t.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TargetRegion. -func (t *TargetRegion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &t.Encryption) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &t.ExcludeFromLatest) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "regionalReplicaCount": - err = unpopulate(val, "RegionalReplicaCount", &t.RegionalReplicaCount) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &t.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TerminateNotificationProfile. -func (t TerminateNotificationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", t.Enable) - populate(objectMap, "notBeforeTimeout", t.NotBeforeTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TerminateNotificationProfile. -func (t *TerminateNotificationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &t.Enable) - delete(rawMsg, key) - case "notBeforeTimeout": - err = unpopulate(val, "NotBeforeTimeout", &t.NotBeforeTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ThrottledRequestsInput. -func (t ThrottledRequestsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", t.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", t.FromTime) - populate(objectMap, "groupByClientApplicationId", t.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", t.GroupByOperationName) - populate(objectMap, "groupByResourceName", t.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", t.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", t.GroupByUserAgent) - populateDateTimeRFC3339(objectMap, "toTime", t.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottledRequestsInput. -func (t *ThrottledRequestsInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &t.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &t.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &t.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &t.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &t.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &t.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &t.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &t.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiKey. -func (u UefiKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "type", u.Type) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiKey. -func (u *UefiKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiKeySignatures. -func (u UefiKeySignatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "db", u.Db) - populate(objectMap, "dbx", u.Dbx) - populate(objectMap, "kek", u.Kek) - populate(objectMap, "pk", u.Pk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiKeySignatures. -func (u *UefiKeySignatures) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "db": - err = unpopulate(val, "Db", &u.Db) - delete(rawMsg, key) - case "dbx": - err = unpopulate(val, "Dbx", &u.Dbx) - delete(rawMsg, key) - case "kek": - err = unpopulate(val, "Kek", &u.Kek) - delete(rawMsg, key) - case "pk": - err = unpopulate(val, "Pk", &u.Pk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiSettings. -func (u UefiSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secureBootEnabled", u.SecureBootEnabled) - populate(objectMap, "vTpmEnabled", u.VTpmEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiSettings. -func (u *UefiSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secureBootEnabled": - err = unpopulate(val, "SecureBootEnabled", &u.SecureBootEnabled) - delete(rawMsg, key) - case "vTpmEnabled": - err = unpopulate(val, "VTpmEnabled", &u.VTpmEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateDomain. -func (u UpdateDomain) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomain. -func (u *UpdateDomain) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &u.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateDomainListResult. -func (u UpdateDomainListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomainListResult. -func (u *UpdateDomainListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &u.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResource. -func (u UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource. -func (u *UpdateResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &u.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResourceDefinition. -func (u UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - populate(objectMap, "tags", u.Tags) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResourceDefinition. -func (u *UpdateResourceDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &u.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &u.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfo. -func (u UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "location", u.Location) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfo. -func (u *UpgradeOperationHistoricalStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &u.Location) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &u.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfoProperties. -func (u UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", u.Error) - populate(objectMap, "progress", u.Progress) - populate(objectMap, "rollbackInfo", u.RollbackInfo) - populate(objectMap, "runningStatus", u.RunningStatus) - populate(objectMap, "startedBy", u.StartedBy) - populate(objectMap, "targetImageReference", u.TargetImageReference) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfoProperties. -func (u *UpgradeOperationHistoricalStatusInfoProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &u.Error) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &u.Progress) - delete(rawMsg, key) - case "rollbackInfo": - err = unpopulate(val, "RollbackInfo", &u.RollbackInfo) - delete(rawMsg, key) - case "runningStatus": - err = unpopulate(val, "RunningStatus", &u.RunningStatus) - delete(rawMsg, key) - case "startedBy": - err = unpopulate(val, "StartedBy", &u.StartedBy) - delete(rawMsg, key) - case "targetImageReference": - err = unpopulate(val, "TargetImageReference", &u.TargetImageReference) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoryStatus. -func (u UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", u.Code) - populateDateTimeRFC3339(objectMap, "endTime", u.EndTime) - populateDateTimeRFC3339(objectMap, "startTime", u.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoryStatus. -func (u *UpgradeOperationHistoryStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &u.Code) - delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &u.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &u.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradePolicy. -func (u UpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticOSUpgradePolicy", u.AutomaticOSUpgradePolicy) - populate(objectMap, "mode", u.Mode) - populate(objectMap, "rollingUpgradePolicy", u.RollingUpgradePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradePolicy. -func (u *UpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticOSUpgradePolicy": - err = unpopulate(val, "AutomaticOSUpgradePolicy", &u.AutomaticOSUpgradePolicy) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &u.Mode) - delete(rawMsg, key) - case "rollingUpgradePolicy": - err = unpopulate(val, "RollingUpgradePolicy", &u.RollingUpgradePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentValue", u.CurrentValue) - populate(objectMap, "limit", u.Limit) - populate(objectMap, "name", u.Name) - objectMap["unit"] = "Count" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. -func (u *Usage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &u.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &u.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &u.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UsageName. -func (u UsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "localizedValue", u.LocalizedValue) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. -func (u *UsageName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactManage. -func (u UserArtifactManage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "install", u.Install) - populate(objectMap, "remove", u.Remove) - populate(objectMap, "update", u.Update) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactManage. -func (u *UserArtifactManage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "install": - err = unpopulate(val, "Install", &u.Install) - delete(rawMsg, key) - case "remove": - err = unpopulate(val, "Remove", &u.Remove) - delete(rawMsg, key) - case "update": - err = unpopulate(val, "Update", &u.Update) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactSettings. -func (u UserArtifactSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configFileName", u.ConfigFileName) - populate(objectMap, "packageFileName", u.PackageFileName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSettings. -func (u *UserArtifactSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configFileName": - err = unpopulate(val, "ConfigFileName", &u.ConfigFileName) - delete(rawMsg, key) - case "packageFileName": - err = unpopulate(val, "PackageFileName", &u.PackageFileName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactSource. -func (u UserArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultConfigurationLink", u.DefaultConfigurationLink) - populate(objectMap, "mediaLink", u.MediaLink) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSource. -func (u *UserArtifactSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultConfigurationLink": - err = unpopulate(val, "DefaultConfigurationLink", &u.DefaultConfigurationLink) - delete(rawMsg, key) - case "mediaLink": - err = unpopulate(val, "MediaLink", &u.MediaLink) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentitiesValue. -func (u UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", u.ClientID) - populate(objectMap, "principalId", u.PrincipalID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentitiesValue. -func (u *UserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &u.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &u.PrincipalID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserInitiatedReboot. -func (u UserInitiatedReboot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticallyApprove", u.AutomaticallyApprove) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedReboot. -func (u *UserInitiatedReboot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticallyApprove": - err = unpopulate(val, "AutomaticallyApprove", &u.AutomaticallyApprove) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserInitiatedRedeploy. -func (u UserInitiatedRedeploy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticallyApprove", u.AutomaticallyApprove) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedRedeploy. -func (u *UserInitiatedRedeploy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticallyApprove": - err = unpopulate(val, "AutomaticallyApprove", &u.AutomaticallyApprove) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMDiskSecurityProfile. -func (v VMDiskSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet) - populate(objectMap, "securityEncryptionType", v.SecurityEncryptionType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMDiskSecurityProfile. -func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet) - delete(rawMsg, key) - case "securityEncryptionType": - err = unpopulate(val, "SecurityEncryptionType", &v.SecurityEncryptionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMGalleryApplication. -func (v VMGalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configurationReference", v.ConfigurationReference) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "order", v.Order) - populate(objectMap, "packageReferenceId", v.PackageReferenceID) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMGalleryApplication. -func (v *VMGalleryApplication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationReference": - err = unpopulate(val, "ConfigurationReference", &v.ConfigurationReference) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &v.Order) - delete(rawMsg, key) - case "packageReferenceId": - err = unpopulate(val, "PackageReferenceID", &v.PackageReferenceID) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "treatFailureAsDeploymentFailure": - err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMImagesInEdgeZoneListResult. -func (v VMImagesInEdgeZoneListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMImagesInEdgeZoneListResult. -func (v *VMImagesInEdgeZoneListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput. -func (v VMScaleSetConvertToSinglePlacementGroupInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activePlacementGroupId", v.ActivePlacementGroupID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput. -func (v *VMScaleSetConvertToSinglePlacementGroupInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activePlacementGroupId": - err = unpopulate(val, "ActivePlacementGroupID", &v.ActivePlacementGroupID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMSizeProperties. -func (v VMSizeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vCPUsAvailable", v.VCPUsAvailable) - populate(objectMap, "vCPUsPerCore", v.VCPUsPerCore) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMSizeProperties. -func (v *VMSizeProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vCPUsAvailable": - err = unpopulate(val, "VCPUsAvailable", &v.VCPUsAvailable) - delete(rawMsg, key) - case "vCPUsPerCore": - err = unpopulate(val, "VCPUsPerCore", &v.VCPUsPerCore) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultCertificate. -func (v VaultCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateStore", v.CertificateStore) - populate(objectMap, "certificateUrl", v.CertificateURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificate. -func (v *VaultCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateStore": - err = unpopulate(val, "CertificateStore", &v.CertificateStore) - delete(rawMsg, key) - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &v.CertificateURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultSecretGroup. -func (v VaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourceVault", v.SourceVault) - populate(objectMap, "vaultCertificates", v.VaultCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultSecretGroup. -func (v *VaultSecretGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceVault": - err = unpopulate(val, "SourceVault", &v.SourceVault) - delete(rawMsg, key) - case "vaultCertificates": - err = unpopulate(val, "VaultCertificates", &v.VaultCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHardDisk. -func (v VirtualHardDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uri", v.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHardDisk. -func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uri": - err = unpopulate(val, "URI", &v.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachine. -func (v VirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "managedBy", v.ManagedBy) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine. -func (v *VirtualMachine) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &v.ManagedBy) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAgentInstanceView. -func (v VirtualMachineAgentInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensionHandlers", v.ExtensionHandlers) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgentVersion", v.VMAgentVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAgentInstanceView. -func (v *VirtualMachineAgentInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensionHandlers": - err = unpopulate(val, "ExtensionHandlers", &v.ExtensionHandlers) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgentVersion": - err = unpopulate(val, "VMAgentVersion", &v.VMAgentVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAssessPatchesResult. -func (v VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentActivityId", v.AssessmentActivityID) - populate(objectMap, "availablePatches", v.AvailablePatches) - populate(objectMap, "criticalAndSecurityPatchCount", v.CriticalAndSecurityPatchCount) - populate(objectMap, "error", v.Error) - populate(objectMap, "otherPatchCount", v.OtherPatchCount) - populate(objectMap, "rebootPending", v.RebootPending) - populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAssessPatchesResult. -func (v *VirtualMachineAssessPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &v.AssessmentActivityID) - delete(rawMsg, key) - case "availablePatches": - err = unpopulate(val, "AvailablePatches", &v.AvailablePatches) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &v.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &v.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &v.RebootPending) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureParameters. -func (v VirtualMachineCaptureParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinationContainerName", v.DestinationContainerName) - populate(objectMap, "overwriteVhds", v.OverwriteVhds) - populate(objectMap, "vhdPrefix", v.VhdPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureParameters. -func (v *VirtualMachineCaptureParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationContainerName": - err = unpopulate(val, "DestinationContainerName", &v.DestinationContainerName) - delete(rawMsg, key) - case "overwriteVhds": - err = unpopulate(val, "OverwriteVhds", &v.OverwriteVhds) - delete(rawMsg, key) - case "vhdPrefix": - err = unpopulate(val, "VhdPrefix", &v.VhdPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureResult. -func (v VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "contentVersion", v.ContentVersion) - populate(objectMap, "id", v.ID) - populateAny(objectMap, "parameters", v.Parameters) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "$schema", v.Schema) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureResult. -func (v *VirtualMachineCaptureResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contentVersion": - err = unpopulate(val, "ContentVersion", &v.ContentVersion) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &v.Parameters) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &v.Schema) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtension. -func (v VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtension. -func (v *VirtualMachineExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionHandlerInstanceView. -func (v VirtualMachineExtensionHandlerInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", v.Status) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionHandlerInstanceView. -func (v *VirtualMachineExtensionHandlerInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImage. -func (v VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImage. -func (v *VirtualMachineExtensionImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImageProperties. -func (v VirtualMachineExtensionImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "computeRole", v.ComputeRole) - populate(objectMap, "handlerSchema", v.HandlerSchema) - populate(objectMap, "operatingSystem", v.OperatingSystem) - populate(objectMap, "supportsMultipleExtensions", v.SupportsMultipleExtensions) - populate(objectMap, "vmScaleSetEnabled", v.VMScaleSetEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImageProperties. -func (v *VirtualMachineExtensionImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "computeRole": - err = unpopulate(val, "ComputeRole", &v.ComputeRole) - delete(rawMsg, key) - case "handlerSchema": - err = unpopulate(val, "HandlerSchema", &v.HandlerSchema) - delete(rawMsg, key) - case "operatingSystem": - err = unpopulate(val, "OperatingSystem", &v.OperatingSystem) - delete(rawMsg, key) - case "supportsMultipleExtensions": - err = unpopulate(val, "SupportsMultipleExtensions", &v.SupportsMultipleExtensions) - delete(rawMsg, key) - case "vmScaleSetEnabled": - err = unpopulate(val, "VMScaleSetEnabled", &v.VMScaleSetEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionInstanceView. -func (v VirtualMachineExtensionInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "substatuses", v.Substatuses) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionInstanceView. -func (v *VirtualMachineExtensionInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "substatuses": - err = unpopulate(val, "Substatuses", &v.Substatuses) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionProperties. -func (v VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populate(objectMap, "instanceView", v.InstanceView) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionProperties. -func (v *VirtualMachineExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisionAfterExtensions": - err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdate. -func (v VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdate. -func (v *VirtualMachineExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdateProperties. -func (v VirtualMachineExtensionUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdateProperties. -func (v *VirtualMachineExtensionUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionsListResult. -func (v VirtualMachineExtensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionsListResult. -func (v *VirtualMachineExtensionsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineHealthStatus. -func (v VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineHealthStatus. -func (v *VirtualMachineHealthStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIPTag. -func (v VirtualMachineIPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ipTagType", v.IPTagType) - populate(objectMap, "tag", v.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIPTag. -func (v *VirtualMachineIPTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &v.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &v.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIdentity. -func (v VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIdentity. -func (v *VirtualMachineIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &v.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &v.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImage. -func (v VirtualMachineImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImage. -func (v *VirtualMachineImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageFeature. -func (v VirtualMachineImageFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageFeature. -func (v *VirtualMachineImageFeature) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageProperties. -func (v VirtualMachineImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", v.Architecture) - populate(objectMap, "automaticOSUpgradeProperties", v.AutomaticOSUpgradeProperties) - populate(objectMap, "dataDiskImages", v.DataDiskImages) - populate(objectMap, "disallowed", v.Disallowed) - populate(objectMap, "features", v.Features) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "imageDeprecationStatus", v.ImageDeprecationStatus) - populate(objectMap, "osDiskImage", v.OSDiskImage) - populate(objectMap, "plan", v.Plan) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageProperties. -func (v *VirtualMachineImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &v.Architecture) - delete(rawMsg, key) - case "automaticOSUpgradeProperties": - err = unpopulate(val, "AutomaticOSUpgradeProperties", &v.AutomaticOSUpgradeProperties) - delete(rawMsg, key) - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &v.DataDiskImages) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &v.Disallowed) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &v.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "imageDeprecationStatus": - err = unpopulate(val, "ImageDeprecationStatus", &v.ImageDeprecationStatus) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &v.OSDiskImage) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageResource. -func (v VirtualMachineImageResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageResource. -func (v *VirtualMachineImageResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesParameters. -func (v VirtualMachineInstallPatchesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "linuxParameters", v.LinuxParameters) - populate(objectMap, "maximumDuration", v.MaximumDuration) - populate(objectMap, "rebootSetting", v.RebootSetting) - populate(objectMap, "windowsParameters", v.WindowsParameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesParameters. -func (v *VirtualMachineInstallPatchesParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linuxParameters": - err = unpopulate(val, "LinuxParameters", &v.LinuxParameters) - delete(rawMsg, key) - case "maximumDuration": - err = unpopulate(val, "MaximumDuration", &v.MaximumDuration) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &v.RebootSetting) - delete(rawMsg, key) - case "windowsParameters": - err = unpopulate(val, "WindowsParameters", &v.WindowsParameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesResult. -func (v VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", v.Error) - populate(objectMap, "excludedPatchCount", v.ExcludedPatchCount) - populate(objectMap, "failedPatchCount", v.FailedPatchCount) - populate(objectMap, "installationActivityId", v.InstallationActivityID) - populate(objectMap, "installedPatchCount", v.InstalledPatchCount) - populate(objectMap, "maintenanceWindowExceeded", v.MaintenanceWindowExceeded) - populate(objectMap, "notSelectedPatchCount", v.NotSelectedPatchCount) - populate(objectMap, "patches", v.Patches) - populate(objectMap, "pendingPatchCount", v.PendingPatchCount) - populate(objectMap, "rebootStatus", v.RebootStatus) - populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesResult. -func (v *VirtualMachineInstallPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &v.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &v.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &v.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &v.InstalledPatchCount) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &v.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &v.NotSelectedPatchCount) - delete(rawMsg, key) - case "patches": - err = unpopulate(val, "Patches", &v.Patches) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &v.PendingPatchCount) - delete(rawMsg, key) - case "rebootStatus": - err = unpopulate(val, "RebootStatus", &v.RebootStatus) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstanceView. -func (v VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "computerName", v.ComputerName) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "isVMInStandbyPool", v.IsVMInStandbyPool) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "osName", v.OSName) - populate(objectMap, "osVersion", v.OSVersion) - populate(objectMap, "patchStatus", v.PatchStatus) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstanceView. -func (v *VirtualMachineInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assignedHost": - err = unpopulate(val, "AssignedHost", &v.AssignedHost) - delete(rawMsg, key) - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &v.ComputerName) - delete(rawMsg, key) - case "disks": - err = unpopulate(val, "Disks", &v.Disks) - delete(rawMsg, key) - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "isVMInStandbyPool": - err = unpopulate(val, "IsVMInStandbyPool", &v.IsVMInStandbyPool) - delete(rawMsg, key) - case "maintenanceRedeployStatus": - err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus) - delete(rawMsg, key) - case "osName": - err = unpopulate(val, "OSName", &v.OSName) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &v.OSVersion) - delete(rawMsg, key) - case "patchStatus": - err = unpopulate(val, "PatchStatus", &v.PatchStatus) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain) - delete(rawMsg, key) - case "rdpThumbPrint": - err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgent": - err = unpopulate(val, "VMAgent", &v.VMAgent) - delete(rawMsg, key) - case "vmHealth": - err = unpopulate(val, "VMHealth", &v.VMHealth) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult. -func (v VirtualMachineListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult. -func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfiguration. -func (v VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfiguration. -func (v *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties. -func (v VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "dscpConfiguration", v.DscpConfiguration) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties. -func (v *VirtualMachineNetworkInterfaceConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "dscpConfiguration": - err = unpopulate(val, "DscpConfiguration", &v.DscpConfiguration) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration. -func (v VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration. -func (v *VirtualMachineNetworkInterfaceDNSSettingsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &v.DNSServers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration. -func (v VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration. -func (v *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties. -func (v VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties. -func (v *VirtualMachineNetworkInterfaceIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePatchStatus. -func (v VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availablePatchSummary", v.AvailablePatchSummary) - populate(objectMap, "configurationStatuses", v.ConfigurationStatuses) - populate(objectMap, "lastPatchInstallationSummary", v.LastPatchInstallationSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePatchStatus. -func (v *VirtualMachinePatchStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availablePatchSummary": - err = unpopulate(val, "AvailablePatchSummary", &v.AvailablePatchSummary) - delete(rawMsg, key) - case "configurationStatuses": - err = unpopulate(val, "ConfigurationStatuses", &v.ConfigurationStatuses) - delete(rawMsg, key) - case "lastPatchInstallationSummary": - err = unpopulate(val, "LastPatchInstallationSummary", &v.LastPatchInstallationSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties. -func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "applicationProfile", v.ApplicationProfile) - populate(objectMap, "availabilitySet", v.AvailabilitySet) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "capacityReservation", v.CapacityReservation) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "evictionPolicy", v.EvictionPolicy) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "host", v.Host) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "scheduledEventsPolicy", v.ScheduledEventsPolicy) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - populate(objectMap, "vmId", v.VMID) - populate(objectMap, "virtualMachineScaleSet", v.VirtualMachineScaleSet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties. -func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "applicationProfile": - err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile) - delete(rawMsg, key) - case "availabilitySet": - err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet) - delete(rawMsg, key) - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "capacityReservation": - err = unpopulate(val, "CapacityReservation", &v.CapacityReservation) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy) - delete(rawMsg, key) - case "extensionsTimeBudget": - err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &v.Host) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "scheduledEventsPolicy": - err = unpopulate(val, "ScheduledEventsPolicy", &v.ScheduledEventsPolicy) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - case "virtualMachineScaleSet": - err = unpopulate(val, "VirtualMachineScaleSet", &v.VirtualMachineScaleSet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfiguration. -func (v VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfiguration. -func (v *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties. -func (v VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPAllocationMethod", v.PublicIPAllocationMethod) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties. -func (v *VirtualMachinePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &v.IPTags) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPAllocationMethod": - err = unpopulate(val, "PublicIPAllocationMethod", &v.PublicIPAllocationMethod) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration. -func (v VirtualMachinePublicIPAddressDNSSettingsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "domainNameLabel", v.DomainNameLabel) - populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration. -func (v *VirtualMachinePublicIPAddressDNSSettingsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "domainNameLabel": - err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel) - delete(rawMsg, key) - case "domainNameLabelScope": - err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineReimageParameters. -func (v VirtualMachineReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineReimageParameters. -func (v *VirtualMachineReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommand. -func (v VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommand. -func (v *VirtualMachineRunCommand) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandInstanceView. -func (v VirtualMachineRunCommandInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "error", v.Error) - populate(objectMap, "executionMessage", v.ExecutionMessage) - populate(objectMap, "executionState", v.ExecutionState) - populate(objectMap, "exitCode", v.ExitCode) - populate(objectMap, "output", v.Output) - populateDateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "statuses", v.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandInstanceView. -func (v *VirtualMachineRunCommandInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "executionMessage": - err = unpopulate(val, "ExecutionMessage", &v.ExecutionMessage) - delete(rawMsg, key) - case "executionState": - err = unpopulate(val, "ExecutionState", &v.ExecutionState) - delete(rawMsg, key) - case "exitCode": - err = unpopulate(val, "ExitCode", &v.ExitCode) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandProperties. -func (v VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "asyncExecution", v.AsyncExecution) - populate(objectMap, "errorBlobManagedIdentity", v.ErrorBlobManagedIdentity) - populate(objectMap, "errorBlobUri", v.ErrorBlobURI) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "outputBlobManagedIdentity", v.OutputBlobManagedIdentity) - populate(objectMap, "outputBlobUri", v.OutputBlobURI) - populate(objectMap, "parameters", v.Parameters) - populate(objectMap, "protectedParameters", v.ProtectedParameters) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "runAsPassword", v.RunAsPassword) - populate(objectMap, "runAsUser", v.RunAsUser) - populate(objectMap, "source", v.Source) - populate(objectMap, "timeoutInSeconds", v.TimeoutInSeconds) - populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandProperties. -func (v *VirtualMachineRunCommandProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asyncExecution": - err = unpopulate(val, "AsyncExecution", &v.AsyncExecution) - delete(rawMsg, key) - case "errorBlobManagedIdentity": - err = unpopulate(val, "ErrorBlobManagedIdentity", &v.ErrorBlobManagedIdentity) - delete(rawMsg, key) - case "errorBlobUri": - err = unpopulate(val, "ErrorBlobURI", &v.ErrorBlobURI) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "outputBlobManagedIdentity": - err = unpopulate(val, "OutputBlobManagedIdentity", &v.OutputBlobManagedIdentity) - delete(rawMsg, key) - case "outputBlobUri": - err = unpopulate(val, "OutputBlobURI", &v.OutputBlobURI) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &v.Parameters) - delete(rawMsg, key) - case "protectedParameters": - err = unpopulate(val, "ProtectedParameters", &v.ProtectedParameters) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "runAsPassword": - err = unpopulate(val, "RunAsPassword", &v.RunAsPassword) - delete(rawMsg, key) - case "runAsUser": - err = unpopulate(val, "RunAsUser", &v.RunAsUser) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &v.Source) - delete(rawMsg, key) - case "timeoutInSeconds": - err = unpopulate(val, "TimeoutInSeconds", &v.TimeoutInSeconds) - delete(rawMsg, key) - case "treatFailureAsDeploymentFailure": - err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandScriptSource. -func (v VirtualMachineRunCommandScriptSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "commandId", v.CommandID) - populate(objectMap, "script", v.Script) - populate(objectMap, "scriptUri", v.ScriptURI) - populate(objectMap, "scriptUriManagedIdentity", v.ScriptURIManagedIdentity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandScriptSource. -func (v *VirtualMachineRunCommandScriptSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandId": - err = unpopulate(val, "CommandID", &v.CommandID) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &v.Script) - delete(rawMsg, key) - case "scriptUri": - err = unpopulate(val, "ScriptURI", &v.ScriptURI) - delete(rawMsg, key) - case "scriptUriManagedIdentity": - err = unpopulate(val, "ScriptURIManagedIdentity", &v.ScriptURIManagedIdentity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandUpdate. -func (v VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandUpdate. -func (v *VirtualMachineRunCommandUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandsListResult. -func (v VirtualMachineRunCommandsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandsListResult. -func (v *VirtualMachineRunCommandsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet. -func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSet. -func (v *VirtualMachineScaleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetDataDisk. -func (v VirtualMachineScaleSetDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "createOption", v.CreateOption) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diskIOPSReadWrite", v.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadWrite", v.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "lun", v.Lun) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "name", v.Name) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetDataDisk. -func (v *VirtualMachineScaleSetDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &v.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &v.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &v.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &v.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtension. -func (v VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtension. -func (v *VirtualMachineScaleSetExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionListResult. -func (v VirtualMachineScaleSetExtensionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionListResult. -func (v *VirtualMachineScaleSetExtensionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProfile. -func (v VirtualMachineScaleSetExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProfile. -func (v *VirtualMachineScaleSetExtensionProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "extensionsTimeBudget": - err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProperties. -func (v VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProperties. -func (v *VirtualMachineScaleSetExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisionAfterExtensions": - err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionUpdate. -func (v VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionUpdate. -func (v *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetHardwareProfile. -func (v VirtualMachineScaleSetHardwareProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSizeProperties", v.VMSizeProperties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetHardwareProfile. -func (v *VirtualMachineScaleSetHardwareProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSizeProperties": - err = unpopulate(val, "VMSizeProperties", &v.VMSizeProperties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfiguration. -func (v VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfiguration. -func (v *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfigurationProperties. -func (v VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfigurationProperties. -func (v *VirtualMachineScaleSetIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "loadBalancerInboundNatPools": - err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPTag. -func (v VirtualMachineScaleSetIPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ipTagType", v.IPTagType) - populate(objectMap, "tag", v.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPTag. -func (v *VirtualMachineScaleSetIPTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &v.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &v.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIdentity. -func (v VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIdentity. -func (v *VirtualMachineScaleSetIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &v.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &v.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceView. -func (v VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "orchestrationServices", v.OrchestrationServices) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "virtualMachine", v.VirtualMachine) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceView. -func (v *VirtualMachineScaleSetInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "orchestrationServices": - err = unpopulate(val, "OrchestrationServices", &v.OrchestrationServices) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "virtualMachine": - err = unpopulate(val, "VirtualMachine", &v.VirtualMachine) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary. -func (v VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statusesSummary", v.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary. -func (v *VirtualMachineScaleSetInstanceViewStatusesSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &v.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory. -func (v VirtualMachineScaleSetListOSUpgradeHistory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory. -func (v *VirtualMachineScaleSetListOSUpgradeHistory) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListResult. -func (v VirtualMachineScaleSetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListResult. -func (v *VirtualMachineScaleSetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListSKUsResult. -func (v VirtualMachineScaleSetListSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListSKUsResult. -func (v *VirtualMachineScaleSetListSKUsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListWithLinkResult. -func (v VirtualMachineScaleSetListWithLinkResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListWithLinkResult. -func (v *VirtualMachineScaleSetListWithLinkResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetManagedDiskParameters. -func (v VirtualMachineScaleSetManagedDiskParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageAccountType", v.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetManagedDiskParameters. -func (v *VirtualMachineScaleSetManagedDiskParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &v.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfiguration. -func (v VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfiguration. -func (v *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings. -func (v VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings. -func (v *VirtualMachineScaleSetNetworkConfigurationDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &v.DNSServers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties. -func (v VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties. -func (v *VirtualMachineScaleSetNetworkConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkProfile. -func (v VirtualMachineScaleSetNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkProfile. -func (v *VirtualMachineScaleSetNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "healthProbe": - err = unpopulate(val, "HealthProbe", &v.HealthProbe) - delete(rawMsg, key) - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSDisk. -func (v VirtualMachineScaleSetOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "createOption", v.CreateOption) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diffDiskSettings", v.DiffDiskSettings) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "name", v.Name) - populate(objectMap, "osType", v.OSType) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSDisk. -func (v *VirtualMachineScaleSetOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &v.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &v.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &v.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &v.OSType) - delete(rawMsg, key) - case "vhdContainers": - err = unpopulate(val, "VhdContainers", &v.VhdContainers) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSProfile. -func (v VirtualMachineScaleSetOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", v.AdminPassword) - populate(objectMap, "adminUsername", v.AdminUsername) - populate(objectMap, "allowExtensionOperations", v.AllowExtensionOperations) - populate(objectMap, "computerNamePrefix", v.ComputerNamePrefix) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "requireGuestProvisionSignal", v.RequireGuestProvisionSignal) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSProfile. -func (v *VirtualMachineScaleSetOSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &v.AdminPassword) - delete(rawMsg, key) - case "adminUsername": - err = unpopulate(val, "AdminUsername", &v.AdminUsername) - delete(rawMsg, key) - case "allowExtensionOperations": - err = unpopulate(val, "AllowExtensionOperations", &v.AllowExtensionOperations) - delete(rawMsg, key) - case "computerNamePrefix": - err = unpopulate(val, "ComputerNamePrefix", &v.ComputerNamePrefix) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &v.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration) - delete(rawMsg, key) - case "requireGuestProvisionSignal": - err = unpopulate(val, "RequireGuestProvisionSignal", &v.RequireGuestProvisionSignal) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &v.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetProperties. -func (v VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy) - populate(objectMap, "constrainedMaximumCapacity", v.ConstrainedMaximumCapacity) - populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "orchestrationMode", v.OrchestrationMode) - populate(objectMap, "overprovision", v.Overprovision) - populate(objectMap, "platformFaultDomainCount", v.PlatformFaultDomainCount) - populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "resiliencyPolicy", v.ResiliencyPolicy) - populate(objectMap, "scaleInPolicy", v.ScaleInPolicy) - populate(objectMap, "scheduledEventsPolicy", v.ScheduledEventsPolicy) - populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup) - populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "uniqueId", v.UniqueID) - populate(objectMap, "upgradePolicy", v.UpgradePolicy) - populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile) - populate(objectMap, "zoneBalance", v.ZoneBalance) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetProperties. -func (v *VirtualMachineScaleSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "automaticRepairsPolicy": - err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy) - delete(rawMsg, key) - case "constrainedMaximumCapacity": - err = unpopulate(val, "ConstrainedMaximumCapacity", &v.ConstrainedMaximumCapacity) - delete(rawMsg, key) - case "doNotRunExtensionsOnOverprovisionedVMs": - err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "orchestrationMode": - err = unpopulate(val, "OrchestrationMode", &v.OrchestrationMode) - delete(rawMsg, key) - case "overprovision": - err = unpopulate(val, "Overprovision", &v.Overprovision) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &v.PlatformFaultDomainCount) - delete(rawMsg, key) - case "priorityMixPolicy": - err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "resiliencyPolicy": - err = unpopulate(val, "ResiliencyPolicy", &v.ResiliencyPolicy) - delete(rawMsg, key) - case "scaleInPolicy": - err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy) - delete(rawMsg, key) - case "scheduledEventsPolicy": - err = unpopulate(val, "ScheduledEventsPolicy", &v.ScheduledEventsPolicy) - delete(rawMsg, key) - case "singlePlacementGroup": - err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup) - delete(rawMsg, key) - case "spotRestorePolicy": - err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &v.UniqueID) - delete(rawMsg, key) - case "upgradePolicy": - err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy) - delete(rawMsg, key) - case "virtualMachineProfile": - err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile) - delete(rawMsg, key) - case "zoneBalance": - err = unpopulate(val, "ZoneBalance", &v.ZoneBalance) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration. -func (v VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration. -func (v *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings. -func (v VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "domainNameLabel", v.DomainNameLabel) - populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings. -func (v *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "domainNameLabel": - err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel) - delete(rawMsg, key) - case "domainNameLabelScope": - err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties. -func (v VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties. -func (v *VirtualMachineScaleSetPublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &v.IPTags) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetReimageParameters. -func (v VirtualMachineScaleSetReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "forceUpdateOSDiskForEphemeral", v.ForceUpdateOSDiskForEphemeral) - populate(objectMap, "instanceIds", v.InstanceIDs) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetReimageParameters. -func (v *VirtualMachineScaleSetReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "forceUpdateOSDiskForEphemeral": - err = unpopulate(val, "ForceUpdateOSDiskForEphemeral", &v.ForceUpdateOSDiskForEphemeral) - delete(rawMsg, key) - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKU. -func (v VirtualMachineScaleSetSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", v.Capacity) - populate(objectMap, "resourceType", v.ResourceType) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKU. -func (v *VirtualMachineScaleSetSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &v.Capacity) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &v.ResourceType) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKUCapacity. -func (v VirtualMachineScaleSetSKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultCapacity", v.DefaultCapacity) - populate(objectMap, "maximum", v.Maximum) - populate(objectMap, "minimum", v.Minimum) - populate(objectMap, "scaleType", v.ScaleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKUCapacity. -func (v *VirtualMachineScaleSetSKUCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultCapacity": - err = unpopulate(val, "DefaultCapacity", &v.DefaultCapacity) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &v.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &v.Minimum) - delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &v.ScaleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetStorageProfile. -func (v VirtualMachineScaleSetStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "diskControllerType", v.DiskControllerType) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetStorageProfile. -func (v *VirtualMachineScaleSetStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &v.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &v.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &v.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &v.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdate. -func (v VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdate. -func (v *VirtualMachineScaleSetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration. -func (v VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration. -func (v *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties. -func (v VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties. -func (v *VirtualMachineScaleSetUpdateIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "loadBalancerInboundNatPools": - err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration. -func (v VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration. -func (v *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties. -func (v VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties. -func (v *VirtualMachineScaleSetUpdateNetworkConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile. -func (v VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile. -func (v *VirtualMachineScaleSetUpdateNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "healthProbe": - err = unpopulate(val, "HealthProbe", &v.HealthProbe) - delete(rawMsg, key) - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSDisk. -func (v VirtualMachineScaleSetUpdateOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diffDiskSettings", v.DiffDiskSettings) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSDisk. -func (v *VirtualMachineScaleSetUpdateOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &v.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &v.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "vhdContainers": - err = unpopulate(val, "VhdContainers", &v.VhdContainers) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSProfile. -func (v VirtualMachineScaleSetUpdateOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSProfile. -func (v *VirtualMachineScaleSetUpdateOSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customData": - err = unpopulate(val, "CustomData", &v.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &v.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateProperties. -func (v VirtualMachineScaleSetUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy) - populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs) - populate(objectMap, "overprovision", v.Overprovision) - populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "resiliencyPolicy", v.ResiliencyPolicy) - populate(objectMap, "scaleInPolicy", v.ScaleInPolicy) - populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup) - populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy) - populate(objectMap, "upgradePolicy", v.UpgradePolicy) - populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateProperties. -func (v *VirtualMachineScaleSetUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "automaticRepairsPolicy": - err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy) - delete(rawMsg, key) - case "doNotRunExtensionsOnOverprovisionedVMs": - err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs) - delete(rawMsg, key) - case "overprovision": - err = unpopulate(val, "Overprovision", &v.Overprovision) - delete(rawMsg, key) - case "priorityMixPolicy": - err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "resiliencyPolicy": - err = unpopulate(val, "ResiliencyPolicy", &v.ResiliencyPolicy) - delete(rawMsg, key) - case "scaleInPolicy": - err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy) - delete(rawMsg, key) - case "singlePlacementGroup": - err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup) - delete(rawMsg, key) - case "spotRestorePolicy": - err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy) - delete(rawMsg, key) - case "upgradePolicy": - err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy) - delete(rawMsg, key) - case "virtualMachineProfile": - err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (v VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties. -func (v VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties. -func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateStorageProfile. -func (v VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "diskControllerType", v.DiskControllerType) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateStorageProfile. -func (v *VirtualMachineScaleSetUpdateStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &v.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &v.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &v.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &v.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateVMProfile. -func (v VirtualMachineScaleSetUpdateVMProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "extensionProfile", v.ExtensionProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populate(objectMap, "userData", v.UserData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateVMProfile. -func (v *VirtualMachineScaleSetUpdateVMProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVM. -func (v VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "instanceId", v.InstanceID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVM. -func (v *VirtualMachineScaleSetVM) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "instanceId": - err = unpopulate(val, "InstanceID", &v.InstanceID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtension. -func (v VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtension. -func (v *VirtualMachineScaleSetVMExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionUpdate. -func (v VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionUpdate. -func (v *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsListResult. -func (v VirtualMachineScaleSetVMExtensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsListResult. -func (v *VirtualMachineScaleSetVMExtensionsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsSummary. -func (v VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "statusesSummary", v.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsSummary. -func (v *VirtualMachineScaleSetVMExtensionsSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &v.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceIDs. -func (v VirtualMachineScaleSetVMInstanceIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceIDs. -func (v *VirtualMachineScaleSetVMInstanceIDs) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs. -func (v VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs. -func (v *VirtualMachineScaleSetVMInstanceRequiredIDs) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceView. -func (v VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "computerName", v.ComputerName) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "osName", v.OSName) - populate(objectMap, "osVersion", v.OSVersion) - populate(objectMap, "placementGroupId", v.PlacementGroupID) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceView. -func (v *VirtualMachineScaleSetVMInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assignedHost": - err = unpopulate(val, "AssignedHost", &v.AssignedHost) - delete(rawMsg, key) - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &v.ComputerName) - delete(rawMsg, key) - case "disks": - err = unpopulate(val, "Disks", &v.Disks) - delete(rawMsg, key) - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "maintenanceRedeployStatus": - err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus) - delete(rawMsg, key) - case "osName": - err = unpopulate(val, "OSName", &v.OSName) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &v.OSVersion) - delete(rawMsg, key) - case "placementGroupId": - err = unpopulate(val, "PlacementGroupID", &v.PlacementGroupID) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain) - delete(rawMsg, key) - case "rdpThumbPrint": - err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgent": - err = unpopulate(val, "VMAgent", &v.VMAgent) - delete(rawMsg, key) - case "vmHealth": - err = unpopulate(val, "VMHealth", &v.VMHealth) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMListResult. -func (v VirtualMachineScaleSetVMListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMListResult. -func (v *VirtualMachineScaleSetVMListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration. -func (v VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration. -func (v *VirtualMachineScaleSetVMNetworkProfileConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProfile. -func (v VirtualMachineScaleSetVMProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationProfile", v.ApplicationProfile) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "capacityReservation", v.CapacityReservation) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "evictionPolicy", v.EvictionPolicy) - populate(objectMap, "extensionProfile", v.ExtensionProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityPostureReference", v.SecurityPostureReference) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "serviceArtifactReference", v.ServiceArtifactReference) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProfile. -func (v *VirtualMachineScaleSetVMProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationProfile": - err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile) - delete(rawMsg, key) - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "capacityReservation": - err = unpopulate(val, "CapacityReservation", &v.CapacityReservation) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityPostureReference": - err = unpopulate(val, "SecurityPostureReference", &v.SecurityPostureReference) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "serviceArtifactReference": - err = unpopulate(val, "ServiceArtifactReference", &v.ServiceArtifactReference) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProperties. -func (v VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "availabilitySet", v.AvailabilitySet) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "latestModelApplied", v.LatestModelApplied) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "modelDefinitionApplied", v.ModelDefinitionApplied) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "networkProfileConfiguration", v.NetworkProfileConfiguration) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "protectionPolicy", v.ProtectionPolicy) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - populate(objectMap, "vmId", v.VMID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProperties. -func (v *VirtualMachineScaleSetVMProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "availabilitySet": - err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "latestModelApplied": - err = unpopulate(val, "LatestModelApplied", &v.LatestModelApplied) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "modelDefinitionApplied": - err = unpopulate(val, "ModelDefinitionApplied", &v.ModelDefinitionApplied) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "networkProfileConfiguration": - err = unpopulate(val, "NetworkProfileConfiguration", &v.NetworkProfileConfiguration) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "protectionPolicy": - err = unpopulate(val, "ProtectionPolicy", &v.ProtectionPolicy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProtectionPolicy. -func (v VirtualMachineScaleSetVMProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "protectFromScaleIn", v.ProtectFromScaleIn) - populate(objectMap, "protectFromScaleSetActions", v.ProtectFromScaleSetActions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProtectionPolicy. -func (v *VirtualMachineScaleSetVMProtectionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "protectFromScaleIn": - err = unpopulate(val, "ProtectFromScaleIn", &v.ProtectFromScaleIn) - delete(rawMsg, key) - case "protectFromScaleSetActions": - err = unpopulate(val, "ProtectFromScaleSetActions", &v.ProtectFromScaleSetActions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMReimageParameters. -func (v VirtualMachineScaleSetVMReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "forceUpdateOSDiskForEphemeral", v.ForceUpdateOSDiskForEphemeral) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMReimageParameters. -func (v *VirtualMachineScaleSetVMReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "forceUpdateOSDiskForEphemeral": - err = unpopulate(val, "ForceUpdateOSDiskForEphemeral", &v.ForceUpdateOSDiskForEphemeral) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSize. -func (v VirtualMachineSize) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxDataDiskCount", v.MaxDataDiskCount) - populate(objectMap, "memoryInMB", v.MemoryInMB) - populate(objectMap, "name", v.Name) - populate(objectMap, "numberOfCores", v.NumberOfCores) - populate(objectMap, "osDiskSizeInMB", v.OSDiskSizeInMB) - populate(objectMap, "resourceDiskSizeInMB", v.ResourceDiskSizeInMB) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSize. -func (v *VirtualMachineSize) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxDataDiskCount": - err = unpopulate(val, "MaxDataDiskCount", &v.MaxDataDiskCount) - delete(rawMsg, key) - case "memoryInMB": - err = unpopulate(val, "MemoryInMB", &v.MemoryInMB) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "numberOfCores": - err = unpopulate(val, "NumberOfCores", &v.NumberOfCores) - delete(rawMsg, key) - case "osDiskSizeInMB": - err = unpopulate(val, "OSDiskSizeInMB", &v.OSDiskSizeInMB) - delete(rawMsg, key) - case "resourceDiskSizeInMB": - err = unpopulate(val, "ResourceDiskSizeInMB", &v.ResourceDiskSizeInMB) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSizeListResult. -func (v VirtualMachineSizeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSizeListResult. -func (v *VirtualMachineSizeListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSoftwarePatchProperties. -func (v VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activityId", v.ActivityID) - populate(objectMap, "assessmentState", v.AssessmentState) - populate(objectMap, "classifications", v.Classifications) - populate(objectMap, "kbId", v.KbID) - populateDateTimeRFC3339(objectMap, "lastModifiedDateTime", v.LastModifiedDateTime) - populate(objectMap, "name", v.Name) - populate(objectMap, "patchId", v.PatchID) - populateDateTimeRFC3339(objectMap, "publishedDate", v.PublishedDate) - populate(objectMap, "rebootBehavior", v.RebootBehavior) - populate(objectMap, "version", v.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSoftwarePatchProperties. -func (v *VirtualMachineSoftwarePatchProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activityId": - err = unpopulate(val, "ActivityID", &v.ActivityID) - delete(rawMsg, key) - case "assessmentState": - err = unpopulate(val, "AssessmentState", &v.AssessmentState) - delete(rawMsg, key) - case "classifications": - err = unpopulate(val, "Classifications", &v.Classifications) - delete(rawMsg, key) - case "kbId": - err = unpopulate(val, "KbID", &v.KbID) - delete(rawMsg, key) - case "lastModifiedDateTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedDateTime", &v.LastModifiedDateTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "patchId": - err = unpopulate(val, "PatchID", &v.PatchID) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &v.PublishedDate) - delete(rawMsg, key) - case "rebootBehavior": - err = unpopulate(val, "RebootBehavior", &v.RebootBehavior) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &v.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineStatusCodeCount. -func (v VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", v.Code) - populate(objectMap, "count", v.Count) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineStatusCodeCount. -func (v *VirtualMachineStatusCodeCount) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &v.Code) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &v.Count) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate. -func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdate. -func (v *VirtualMachineUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WinRMConfiguration. -func (w WinRMConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "listeners", w.Listeners) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMConfiguration. -func (w *WinRMConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "listeners": - err = unpopulate(val, "Listeners", &w.Listeners) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WinRMListener. -func (w WinRMListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateUrl", w.CertificateURL) - populate(objectMap, "protocol", w.Protocol) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMListener. -func (w *WinRMListener) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &w.CertificateURL) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &w.Protocol) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration. -func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalUnattendContent", w.AdditionalUnattendContent) - populate(objectMap, "enableAutomaticUpdates", w.EnableAutomaticUpdates) - populate(objectMap, "enableVMAgentPlatformUpdates", w.EnableVMAgentPlatformUpdates) - populate(objectMap, "patchSettings", w.PatchSettings) - populate(objectMap, "provisionVMAgent", w.ProvisionVMAgent) - populate(objectMap, "timeZone", w.TimeZone) - populate(objectMap, "winRM", w.WinRM) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsConfiguration. -func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalUnattendContent": - err = unpopulate(val, "AdditionalUnattendContent", &w.AdditionalUnattendContent) - delete(rawMsg, key) - case "enableAutomaticUpdates": - err = unpopulate(val, "EnableAutomaticUpdates", &w.EnableAutomaticUpdates) - delete(rawMsg, key) - case "enableVMAgentPlatformUpdates": - err = unpopulate(val, "EnableVMAgentPlatformUpdates", &w.EnableVMAgentPlatformUpdates) - delete(rawMsg, key) - case "patchSettings": - err = unpopulate(val, "PatchSettings", &w.PatchSettings) - delete(rawMsg, key) - case "provisionVMAgent": - err = unpopulate(val, "ProvisionVMAgent", &w.ProvisionVMAgent) - delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &w.TimeZone) - delete(rawMsg, key) - case "winRM": - err = unpopulate(val, "WinRM", &w.WinRM) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsParameters. -func (w WindowsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classificationsToInclude", w.ClassificationsToInclude) - populate(objectMap, "excludeKbsRequiringReboot", w.ExcludeKbsRequiringReboot) - populate(objectMap, "kbNumbersToExclude", w.KbNumbersToExclude) - populate(objectMap, "kbNumbersToInclude", w.KbNumbersToInclude) - populateDateTimeRFC3339(objectMap, "maxPatchPublishDate", w.MaxPatchPublishDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsParameters. -func (w *WindowsParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classificationsToInclude": - err = unpopulate(val, "ClassificationsToInclude", &w.ClassificationsToInclude) - delete(rawMsg, key) - case "excludeKbsRequiringReboot": - err = unpopulate(val, "ExcludeKbsRequiringReboot", &w.ExcludeKbsRequiringReboot) - delete(rawMsg, key) - case "kbNumbersToExclude": - err = unpopulate(val, "KbNumbersToExclude", &w.KbNumbersToExclude) - delete(rawMsg, key) - case "kbNumbersToInclude": - err = unpopulate(val, "KbNumbersToInclude", &w.KbNumbersToInclude) - delete(rawMsg, key) - case "maxPatchPublishDate": - err = unpopulateDateTimeRFC3339(val, "MaxPatchPublishDate", &w.MaxPatchPublishDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings. -func (w WindowsVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", w.BypassPlatformSafetyChecksOnUserSchedule) - populate(objectMap, "rebootSetting", w.RebootSetting) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings. -func (w *WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bypassPlatformSafetyChecksOnUserSchedule": - err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &w.BypassPlatformSafetyChecksOnUserSchedule) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &w.RebootSetting) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -func populate(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func populateAny(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil || string(data) == "null" { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go deleted file mode 100644 index 7c438a561554..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - internal *arm.Client -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - internal: cl, - } - return client, nil -} - -// NewListPager - Gets a list of compute operations. -// -// Generated from API version 2024-03-01 -// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Compute/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go deleted file mode 100644 index 5ea3446d0611..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go +++ /dev/null @@ -1,1986 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -type AvailabilitySetsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -type AvailabilitySetsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -type AvailabilitySetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager -// method. -type AvailabilitySetsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager -// method. -type AvailabilitySetsClientListBySubscriptionOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string -} - -// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method. -type AvailabilitySetsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -type AvailabilitySetsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -type CapacityReservationGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -type CapacityReservationGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -type CapacityReservationGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity - // reservations under the capacity reservation group which is a snapshot of the - // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. - Expand *CapacityReservationGroupInstanceViewTypes -} - -// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager -// method. -type CapacityReservationGroupsClientListByResourceGroupOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager -// method. -type CapacityReservationGroupsClientListBySubscriptionOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups - - // The query option to fetch Capacity Reservation Group Resource Ids. - // 'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription. - // 'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription. - // 'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created - // in the subscription. - ResourceIDsOnly *ResourceIDOptionsForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -type CapacityReservationGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -type CapacityReservationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -type CapacityReservationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -type CapacityReservationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method. -type CapacityReservationsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity - // reservation that is managed by the platform and can change outside of - // control plane operations. - Expand *CapacityReservationInstanceViewTypes -} - -// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager -// method. -type CapacityReservationsClientListByCapacityReservationGroupOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager -// method. -type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager -// method. -type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -type CloudServiceRoleInstancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -type CloudServiceRoleInstancesClientBeginRebuildOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -type CloudServiceRoleInstancesClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -type CloudServiceRoleInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -type CloudServiceRoleInstancesClientGetOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager -// method. -type CloudServiceRoleInstancesClientListOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -type CloudServiceRolesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method. -type CloudServiceRolesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -type CloudServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -type CloudServicesClientBeginDeleteInstancesOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method. -type CloudServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method. -type CloudServicesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method. -type CloudServicesClientBeginRebuildOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method. -type CloudServicesClientBeginReimageOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method. -type CloudServicesClientBeginRestartOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method. -type CloudServicesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method. -type CloudServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -type CloudServicesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -type CloudServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method. -type CloudServicesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. -type CloudServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager -// method. -type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -type CommunityGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -type CommunityGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager -// method. -type CommunityGalleryImageVersionsClientListOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. -type CommunityGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager -// method. -type CommunityGalleryImagesClientListOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -type DedicatedHostGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method. -type DedicatedHostGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -type DedicatedHostGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // hosts under the dedicated host group. 'UserData' is not supported for - // dedicated host group. - Expand *InstanceViewTypes -} - -// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager -// method. -type DedicatedHostGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager -// method. -type DedicatedHostGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method. -type DedicatedHostGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -type DedicatedHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method. -type DedicatedHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy method. -type DedicatedHostsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method. -type DedicatedHostsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method. -type DedicatedHostsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -type DedicatedHostsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // host. 'UserData' is not supported for dedicated host. - Expand *InstanceViewTypes -} - -// DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager -// method. -type DedicatedHostsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager -// method. -type DedicatedHostsClientListByHostGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -type DiskAccessesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method. -type DiskAccessesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method. -type DiskAccessesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -type DiskAccessesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -type DiskAccessesClientGetPrivateLinkResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager -// method. -type DiskAccessesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. -type DiskAccessesClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager -// method. -type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -type DiskEncryptionSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -type DiskEncryptionSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -type DiskEncryptionSetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager -// method. -type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager -// method. -type DiskEncryptionSetsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method. -type DiskEncryptionSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -type DiskRestorePointClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -type DiskRestorePointClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -type DiskRestorePointClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager -// method. -type DiskRestorePointClientListByRestorePointOptions struct { - // placeholder for future optional parameters -} - -// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method. -type DisksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -type DisksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -type DisksClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -type DisksClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -type DisksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -type DisksClientGetOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager -// method. -type DisksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. -type DisksClientListOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -type GalleriesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -type GalleriesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -type GalleriesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -type GalleriesClientGetOptions struct { - // The expand query option to apply on the operation. - Expand *GalleryExpandParams - - // The select expression to apply on the operation. - Select *SelectPermissions -} - -// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager -// method. -type GalleriesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. -type GalleriesClientListOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -type GalleryApplicationVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -type GalleryApplicationVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -type GalleryApplicationVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager -// method. -type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -type GalleryApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -type GalleryApplicationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -type GalleryApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager -// method. -type GalleryApplicationsClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -type GalleryImageVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -type GalleryImageVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method. -type GalleryImageVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager -// method. -type GalleryImageVersionsClientListByGalleryImageOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -type GalleryImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method. -type GalleryImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method. -type GalleryImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -type GalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager -// method. -type GalleryImagesClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -type GallerySharingProfileClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method. -type ImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -type ImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -type ImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -type ImagesClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager -// method. -type ImagesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. -type ImagesClientListOptions struct { - // placeholder for future optional parameters -} - -// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -type ProximityPlacementGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method. -type ProximityPlacementGroupsClientGetOptions struct { - // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. - IncludeColocationStatus *string -} - -// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager -// method. -type ProximityPlacementGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager -// method. -type ProximityPlacementGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -type ProximityPlacementGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. -type ResourceSKUsClientListOptions struct { - // The filter to apply on the operation. Only location filter is supported currently. - Filter *string - - // To Include Extended Locations information or not in the response. - IncludeExtendedLocations *string -} - -// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -type RestorePointCollectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -type RestorePointCollectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method. -type RestorePointCollectionsClientGetOptions struct { - // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points - // in the restorePointCollection. - Expand *RestorePointCollectionExpandOptions -} - -// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager -// method. -type RestorePointCollectionsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager -// method. -type RestorePointCollectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -type RestorePointCollectionsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. -type RestorePointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method. -type RestorePointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -type RestorePointsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore - // point. - Expand *RestorePointExpandOptions -} - -// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -type SSHPublicKeysClientCreateOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -type SSHPublicKeysClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -type SSHPublicKeysClientGenerateKeyPairOptions struct { - // Parameters supplied to generate the SSH public key. - Parameters *SSHGenerateKeyPairInputParameters -} - -// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -type SSHPublicKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager -// method. -type SSHPublicKeysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager -// method. -type SSHPublicKeysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -type SSHPublicKeysClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -type SharedGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method. -type SharedGalleriesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -type SharedGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager -// method. -type SharedGalleryImageVersionsClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -type SharedGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method. -type SharedGalleryImagesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -type SnapshotsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -type SnapshotsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method. -type SnapshotsClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method. -type SnapshotsClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -type SnapshotsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -type SnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. -type UsageClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -type VirtualMachineExtensionImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -type VirtualMachineExtensionImagesClientListTypesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -type VirtualMachineExtensionImagesClientListVersionsOptions struct { - // The filter to apply on the operation. - Filter *string - Orderby *string - Top *int32 -} - -// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -type VirtualMachineExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -type VirtualMachineExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method. -type VirtualMachineExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -type VirtualMachineExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method. -type VirtualMachineImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone -// method. -type VirtualMachineImagesClientListByEdgeZoneOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -type VirtualMachineImagesClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method. -type VirtualMachineImagesClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - Orderby *string - Top *int32 -} - -// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -type VirtualMachineImagesClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -type VirtualMachineImagesClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -type VirtualMachineImagesEdgeZoneClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -type VirtualMachineImagesEdgeZoneClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - - // Specifies the order of the results returned. Formatted as an OData query. - Orderby *string - - // An integer value specifying the number of images to return that matches supplied values. - Top *int32 -} - -// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -type VirtualMachineRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -type VirtualMachineRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -type VirtualMachineRunCommandsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager -// method. -type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager -// method. -type VirtualMachineRunCommandsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -type VirtualMachineScaleSetExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager -// method. -type VirtualMachineScaleSetExtensionsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -type VirtualMachineScaleSetVMExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager -// method. -type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade -// method. -type VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks -// method. -type VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { - // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // 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 - SkipShutdown *bool -} - -// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // Parameters for the Reimaging Virtual machine in ScaleSet. - VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters -} - -// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -type VirtualMachineScaleSetVMsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { - // 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. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -type VirtualMachineScaleSetVMsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. - // 'UserData' will retrieve the UserData of the virtual machine. - Expand *InstanceViewTypes -} - -// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager -// method. -type VirtualMachineScaleSetVMsClientListOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string - - // 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'. - Filter *string - - // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - Select *string -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade -// method. -type VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { - // 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. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible - // OrchestrationMode only) - Hibernate *bool - - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { - // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -type VirtualMachineScaleSetsClientBeginDeleteOptions struct { - // Optional parameter to force delete a VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // 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 - SkipShutdown *bool - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply -// method. -type VirtualMachineScaleSetsClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -type VirtualMachineScaleSetsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // Parameters for Reimaging VM ScaleSet. - VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters -} - -// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -type VirtualMachineScaleSetsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState -// method. -type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -type VirtualMachineScaleSetsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -type VirtualMachineScaleSetsClientBeginUpdateOptions struct { - // 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. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters -// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { - // The placement group id for which the manual recovery walk is requested. - PlacementGroupID *string - - // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set - Zone *string -} - -// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager -// method. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method. -type VirtualMachineScaleSetsClientGetOptions struct { - // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was - // provided by the user during the VM scale set Create/Update operation - Expand *ExpandTypesForGetVMScaleSets -} - -// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager -// method. -type VirtualMachineScaleSetsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager -// method. -type VirtualMachineScaleSetsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager -// method. -type VirtualMachineScaleSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager -// method. -type VirtualMachineScaleSetsClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method. -type VirtualMachineSizesClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -type VirtualMachinesClientBeginAssessPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks -// method. -type VirtualMachinesClientBeginAttachDetachDataDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method. -type VirtualMachinesClientBeginCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -type VirtualMachinesClientBeginCreateOrUpdateOptions struct { - // 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. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -type VirtualMachinesClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine. (Feature in Preview) - Hibernate *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method. -type VirtualMachinesClientBeginDeleteOptions struct { - // Optional parameter to force delete virtual machines. - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -type VirtualMachinesClientBeginInstallPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -type VirtualMachinesClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -type VirtualMachinesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // 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 - SkipShutdown *bool -} - -// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method. -type VirtualMachinesClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -type VirtualMachinesClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method. -type VirtualMachinesClientBeginReimageOptions struct { - // Parameters supplied to the Reimage Virtual Machine operation. - Parameters *VirtualMachineReimageParameters - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method. -type VirtualMachinesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -type VirtualMachinesClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method. -type VirtualMachinesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method. -type VirtualMachinesClientBeginUpdateOptions struct { - // 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. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method. -type VirtualMachinesClientGeneralizeOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -type VirtualMachinesClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual - // machine that is managed by the platform and can change outside of control - // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user - // during the VM Create/Update operation. - Expand *InstanceViewTypes -} - -// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method. -type VirtualMachinesClientInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method. -type VirtualMachinesClientListAllOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypesForListVMs - - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string - - // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - StatusOnly *string -} - -// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager -// method. -type VirtualMachinesClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager -// method. -type VirtualMachinesClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method. -type VirtualMachinesClientListOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypeForListVMs - - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -type VirtualMachinesClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go deleted file mode 100644 index c186592038fa..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go +++ /dev/null @@ -1,421 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ProximityPlacementGroupsClient contains the methods for the ProximityPlacementGroups group. -// Don't use this type directly, use NewProximityPlacementGroupsClient() instead. -type ProximityPlacementGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProximityPlacementGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ProximityPlacementGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProximityPlacementGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ProximityPlacementGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - result := ProximityPlacementGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (ProximityPlacementGroupsClientDeleteResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - return ProximityPlacementGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a proximity placement group . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get -// method. -func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (ProximityPlacementGroupsClientGetResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ProximityPlacementGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.IncludeColocationStatus != nil { - reqQP.Set("includeColocationStatus", *options.IncludeColocationStatus) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ProximityPlacementGroupsClient) getHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientGetResponse, error) { - result := ProximityPlacementGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all proximity placement groups in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager -// method. -func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListByResourceGroupResponse]{ - More: func(page ProximityPlacementGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListByResourceGroupResponse) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ProximityPlacementGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ProximityPlacementGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - result := ProximityPlacementGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all proximity placement groups in a subscription. -// -// Generated from API version 2024-03-01 -// - options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager -// method. -func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListBySubscriptionResponse]{ - More: func(page ProximityPlacementGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListBySubscriptionResponse) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ProximityPlacementGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ProximityPlacementGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ProximityPlacementGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - result := ProximityPlacementGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (ProximityPlacementGroupsClientUpdateResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *ProximityPlacementGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *ProximityPlacementGroupsClient) updateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientUpdateResponse, error) { - result := ProximityPlacementGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go deleted file mode 100644 index f716c1ccf077..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ResourceSKUsClient contains the methods for the ResourceSKUs group. -// Don't use this type directly, use NewResourceSKUsClient() instead. -type ResourceSKUsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ResourceSKUsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Gets the list of Microsoft.Compute SKUs available for your Subscription. -// -// Generated from API version 2021-07-01 -// - options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. -func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListResponse]{ - More: func(page ResourceSKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ResourceSKUsClientListResponse) (ResourceSKUsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceSKUsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return ResourceSKUsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ResourceSKUsClient) listCreateRequest(ctx context.Context, options *ResourceSKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.IncludeExtendedLocations != nil { - reqQP.Set("includeExtendedLocations", *options.IncludeExtendedLocations) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ResourceSKUsClient) listHandleResponse(resp *http.Response) (ResourceSKUsClientListResponse, error) { - result := ResourceSKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceSKUsResult); err != nil { - return ResourceSKUsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go deleted file mode 100644 index db4fc2bd38ee..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go +++ /dev/null @@ -1,1673 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "io" - -// AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate. -type AvailabilitySetsClientCreateOrUpdateResponse struct { - // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete. -type AvailabilitySetsClientDeleteResponse struct { - // placeholder for future response values -} - -// AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get. -type AvailabilitySetsClientGetResponse struct { - // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.NewListAvailableSizesPager. -type AvailabilitySetsClientListAvailableSizesResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager. -type AvailabilitySetsClientListBySubscriptionResponse struct { - // The List Availability Set operation response. - AvailabilitySetListResult -} - -// AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.NewListPager. -type AvailabilitySetsClientListResponse struct { - // The List Availability Set operation response. - AvailabilitySetListResult -} - -// AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update. -type AvailabilitySetsClientUpdateResponse struct { - // 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 [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate. -type CapacityReservationGroupsClientCreateOrUpdateResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete. -type CapacityReservationGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get. -type CapacityReservationGroupsClientGetResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.NewListByResourceGroupPager. -type CapacityReservationGroupsClientListByResourceGroupResponse struct { - // The List capacity reservation group with resource group response. - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager. -type CapacityReservationGroupsClientListBySubscriptionResponse struct { - // The List capacity reservation group with resource group response. - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update. -type CapacityReservationGroupsClientUpdateResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.BeginCreateOrUpdate. -type CapacityReservationsClientCreateOrUpdateResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CapacityReservationsClientDeleteResponse contains the response from method CapacityReservationsClient.BeginDelete. -type CapacityReservationsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get. -type CapacityReservationsClientGetResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.NewListByCapacityReservationGroupPager. -type CapacityReservationsClientListByCapacityReservationGroupResponse struct { - // The list capacity reservation operation response. - CapacityReservationListResult -} - -// CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.BeginUpdate. -type CapacityReservationsClientUpdateResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily. -type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct { - // Describes a cloud service OS family. - OSFamily -} - -// CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion. -type CloudServiceOperatingSystemsClientGetOSVersionResponse struct { - // Describes a cloud service OS version. - OSVersion -} - -// CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSFamiliesPager. -type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct { - // The list operation result. - OSFamilyListResult -} - -// CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSVersionsPager. -type CloudServiceOperatingSystemsClientListOSVersionsResponse struct { - // The list operation result. - OSVersionListResult -} - -// CloudServiceRoleInstancesClientDeleteResponse contains the response from method CloudServiceRoleInstancesClient.BeginDelete. -type CloudServiceRoleInstancesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView. -type CloudServiceRoleInstancesClientGetInstanceViewResponse struct { - // The instance view of the role instance. - RoleInstanceView -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse contains the response from method CloudServiceRoleInstancesClient.GetRemoteDesktopFile. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct { - // Body contains the streaming response. - Body io.ReadCloser -} - -// CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get. -type CloudServiceRoleInstancesClientGetResponse struct { - // Describes the cloud service role instance. - RoleInstance -} - -// CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.NewListPager. -type CloudServiceRoleInstancesClientListResponse struct { - // The list operation result. - RoleInstanceListResult -} - -// CloudServiceRoleInstancesClientRebuildResponse contains the response from method CloudServiceRoleInstancesClient.BeginRebuild. -type CloudServiceRoleInstancesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientReimageResponse contains the response from method CloudServiceRoleInstancesClient.BeginReimage. -type CloudServiceRoleInstancesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientRestartResponse contains the response from method CloudServiceRoleInstancesClient.BeginRestart. -type CloudServiceRoleInstancesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get. -type CloudServiceRolesClientGetResponse struct { - // Describes a role of the cloud service. - CloudServiceRole -} - -// CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.NewListPager. -type CloudServiceRolesClientListResponse struct { - // The list operation result. - CloudServiceRoleListResult -} - -// CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.BeginCreateOrUpdate. -type CloudServicesClientCreateOrUpdateResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesClientDeleteInstancesResponse contains the response from method CloudServicesClient.BeginDeleteInstances. -type CloudServicesClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// CloudServicesClientDeleteResponse contains the response from method CloudServicesClient.BeginDelete. -type CloudServicesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView. -type CloudServicesClientGetInstanceViewResponse struct { - // InstanceView of CloudService as a whole - CloudServiceInstanceView -} - -// CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get. -type CloudServicesClientGetResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesClientListAllResponse contains the response from method CloudServicesClient.NewListAllPager. -type CloudServicesClientListAllResponse struct { - // The list operation result. - CloudServiceListResult -} - -// CloudServicesClientListResponse contains the response from method CloudServicesClient.NewListPager. -type CloudServicesClientListResponse struct { - // The list operation result. - CloudServiceListResult -} - -// CloudServicesClientPowerOffResponse contains the response from method CloudServicesClient.BeginPowerOff. -type CloudServicesClientPowerOffResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRebuildResponse contains the response from method CloudServicesClient.BeginRebuild. -type CloudServicesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServicesClientReimageResponse contains the response from method CloudServicesClient.BeginReimage. -type CloudServicesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRestartResponse contains the response from method CloudServicesClient.BeginRestart. -type CloudServicesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientStartResponse contains the response from method CloudServicesClient.BeginStart. -type CloudServicesClientStartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.BeginUpdate. -type CloudServicesClientUpdateResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain. -type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct { - // Defines an update domain for the cloud service. - UpdateDomain -} - -// CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.NewListUpdateDomainsPager. -type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct { - // The list operation result. - UpdateDomainListResult -} - -// CloudServicesUpdateDomainClientWalkUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.BeginWalkUpdateDomain. -type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct { - // placeholder for future response values -} - -// CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get. -type CommunityGalleriesClientGetResponse struct { - // Specifies information about the Community Gallery that you want to create or update. - CommunityGallery -} - -// CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get. -type CommunityGalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - CommunityGalleryImageVersion -} - -// CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.NewListPager. -type CommunityGalleryImageVersionsClientListResponse struct { - // The List Community Gallery Image versions operation response. - CommunityGalleryImageVersionList -} - -// CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get. -type CommunityGalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - CommunityGalleryImage -} - -// CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.NewListPager. -type CommunityGalleryImagesClientListResponse struct { - // The List Community Gallery Images operation response. - CommunityGalleryImageList -} - -// DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate. -type DedicatedHostGroupsClientCreateOrUpdateResponse struct { - // 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. - DedicatedHostGroup -} - -// DedicatedHostGroupsClientDeleteResponse contains the response from method DedicatedHostGroupsClient.Delete. -type DedicatedHostGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get. -type DedicatedHostGroupsClientGetResponse struct { - // 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. - DedicatedHostGroup -} - -// DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.NewListByResourceGroupPager. -type DedicatedHostGroupsClientListByResourceGroupResponse struct { - // The List Dedicated Host Group with resource group response. - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.NewListBySubscriptionPager. -type DedicatedHostGroupsClientListBySubscriptionResponse struct { - // The List Dedicated Host Group with resource group response. - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update. -type DedicatedHostGroupsClientUpdateResponse struct { - // 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. - DedicatedHostGroup -} - -// DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.BeginCreateOrUpdate. -type DedicatedHostsClientCreateOrUpdateResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DedicatedHostsClientDeleteResponse contains the response from method DedicatedHostsClient.BeginDelete. -type DedicatedHostsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get. -type DedicatedHostsClientGetResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DedicatedHostsClientListAvailableSizesResponse contains the response from method DedicatedHostsClient.NewListAvailableSizesPager. -type DedicatedHostsClientListAvailableSizesResponse struct { - // The List Dedicated Host sizes operation response. - DedicatedHostSizeListResult -} - -// DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.NewListByHostGroupPager. -type DedicatedHostsClientListByHostGroupResponse struct { - // The list dedicated host operation response. - DedicatedHostListResult -} - -// DedicatedHostsClientRedeployResponse contains the response from method DedicatedHostsClient.BeginRedeploy. -type DedicatedHostsClientRedeployResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientRestartResponse contains the response from method DedicatedHostsClient.BeginRestart. -type DedicatedHostsClientRestartResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.BeginUpdate. -type DedicatedHostsClientUpdateResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.BeginCreateOrUpdate. -type DiskAccessesClientCreateOrUpdateResponse struct { - // disk access resource. - DiskAccess -} - -// DiskAccessesClientDeleteAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginDeleteAPrivateEndpointConnection. -type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientDeleteResponse contains the response from method DiskAccessesClient.BeginDelete. -type DiskAccessesClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection. -type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources. -type DiskAccessesClientGetPrivateLinkResourcesResponse struct { - // A list of private link resources - PrivateLinkResourceListResult -} - -// DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get. -type DiskAccessesClientGetResponse struct { - // disk access resource. - DiskAccess -} - -// DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.NewListByResourceGroupPager. -type DiskAccessesClientListByResourceGroupResponse struct { - // The List disk access operation response. - DiskAccessList -} - -// DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.NewListPrivateEndpointConnectionsPager. -type DiskAccessesClientListPrivateEndpointConnectionsResponse struct { - // A list of private link resources - PrivateEndpointConnectionListResult -} - -// DiskAccessesClientListResponse contains the response from method DiskAccessesClient.NewListPager. -type DiskAccessesClientListResponse struct { - // The List disk access operation response. - DiskAccessList -} - -// DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginUpdateAPrivateEndpointConnection. -type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.BeginUpdate. -type DiskAccessesClientUpdateResponse struct { - // disk access resource. - DiskAccess -} - -// DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginCreateOrUpdate. -type DiskEncryptionSetsClientCreateOrUpdateResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskEncryptionSetsClientDeleteResponse contains the response from method DiskEncryptionSetsClient.BeginDelete. -type DiskEncryptionSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get. -type DiskEncryptionSetsClientGetResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.NewListAssociatedResourcesPager. -type DiskEncryptionSetsClientListAssociatedResourcesResponse struct { - // The List resources which are encrypted with the disk encryption set. - ResourceURIList -} - -// DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.NewListByResourceGroupPager. -type DiskEncryptionSetsClientListByResourceGroupResponse struct { - // The List disk encryption set operation response. - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.NewListPager. -type DiskEncryptionSetsClientListResponse struct { - // The List disk encryption set operation response. - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginUpdate. -type DiskEncryptionSetsClientUpdateResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get. -type DiskRestorePointClientGetResponse struct { - // Properties of disk restore point - DiskRestorePoint -} - -// DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.BeginGrantAccess. -type DiskRestorePointClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.NewListByRestorePointPager. -type DiskRestorePointClientListByRestorePointResponse struct { - // The List Disk Restore Points operation response. - DiskRestorePointList -} - -// DiskRestorePointClientRevokeAccessResponse contains the response from method DiskRestorePointClient.BeginRevokeAccess. -type DiskRestorePointClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate. -type DisksClientCreateOrUpdateResponse struct { - // Disk resource. - Disk -} - -// DisksClientDeleteResponse contains the response from method DisksClient.BeginDelete. -type DisksClientDeleteResponse struct { - // placeholder for future response values -} - -// DisksClientGetResponse contains the response from method DisksClient.Get. -type DisksClientGetResponse struct { - // Disk resource. - Disk -} - -// DisksClientGrantAccessResponse contains the response from method DisksClient.BeginGrantAccess. -type DisksClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// DisksClientListByResourceGroupResponse contains the response from method DisksClient.NewListByResourceGroupPager. -type DisksClientListByResourceGroupResponse struct { - // The List Disks operation response. - DiskList -} - -// DisksClientListResponse contains the response from method DisksClient.NewListPager. -type DisksClientListResponse struct { - // The List Disks operation response. - DiskList -} - -// DisksClientRevokeAccessResponse contains the response from method DisksClient.BeginRevokeAccess. -type DisksClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientUpdateResponse contains the response from method DisksClient.BeginUpdate. -type DisksClientUpdateResponse struct { - // Disk resource. - Disk -} - -// GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.BeginCreateOrUpdate. -type GalleriesClientCreateOrUpdateResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleriesClientDeleteResponse contains the response from method GalleriesClient.BeginDelete. -type GalleriesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleriesClientGetResponse contains the response from method GalleriesClient.Get. -type GalleriesClientGetResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.NewListByResourceGroupPager. -type GalleriesClientListByResourceGroupResponse struct { - // The List Galleries operation response. - GalleryList -} - -// GalleriesClientListResponse contains the response from method GalleriesClient.NewListPager. -type GalleriesClientListResponse struct { - // The List Galleries operation response. - GalleryList -} - -// GalleriesClientUpdateResponse contains the response from method GalleriesClient.BeginUpdate. -type GalleriesClientUpdateResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginCreateOrUpdate. -type GalleryApplicationVersionsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientDeleteResponse contains the response from method GalleryApplicationVersionsClient.BeginDelete. -type GalleryApplicationVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get. -type GalleryApplicationVersionsClientGetResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.NewListByGalleryApplicationPager. -type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct { - // The List Gallery Application version operation response. - GalleryApplicationVersionList -} - -// GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginUpdate. -type GalleryApplicationVersionsClientUpdateResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.BeginCreateOrUpdate. -type GalleryApplicationsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryApplicationsClientDeleteResponse contains the response from method GalleryApplicationsClient.BeginDelete. -type GalleryApplicationsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get. -type GalleryApplicationsClientGetResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.NewListByGalleryPager. -type GalleryApplicationsClientListByGalleryResponse struct { - // The List Gallery Applications operation response. - GalleryApplicationList -} - -// GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.BeginUpdate. -type GalleryApplicationsClientUpdateResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.BeginCreateOrUpdate. -type GalleryImageVersionsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImageVersionsClientDeleteResponse contains the response from method GalleryImageVersionsClient.BeginDelete. -type GalleryImageVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get. -type GalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.NewListByGalleryImagePager. -type GalleryImageVersionsClientListByGalleryImageResponse struct { - // The List Gallery Image version operation response. - GalleryImageVersionList -} - -// GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.BeginUpdate. -type GalleryImageVersionsClientUpdateResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.BeginCreateOrUpdate. -type GalleryImagesClientCreateOrUpdateResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GalleryImagesClientDeleteResponse contains the response from method GalleryImagesClient.BeginDelete. -type GalleryImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get. -type GalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.NewListByGalleryPager. -type GalleryImagesClientListByGalleryResponse struct { - // The List Gallery Images operation response. - GalleryImageList -} - -// GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.BeginUpdate. -type GalleryImagesClientUpdateResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate. -type GallerySharingProfileClientUpdateResponse struct { - // Specifies information about the gallery sharing profile update. - SharingUpdate -} - -// ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.BeginCreateOrUpdate. -type ImagesClientCreateOrUpdateResponse struct { - // 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 -} - -// ImagesClientDeleteResponse contains the response from method ImagesClient.BeginDelete. -type ImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// ImagesClientGetResponse contains the response from method ImagesClient.Get. -type ImagesClientGetResponse struct { - // 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 -} - -// ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.NewListByResourceGroupPager. -type ImagesClientListByResourceGroupResponse struct { - // The List Image operation response. - ImageListResult -} - -// ImagesClientListResponse contains the response from method ImagesClient.NewListPager. -type ImagesClientListResponse struct { - // The List Image operation response. - ImageListResult -} - -// ImagesClientUpdateResponse contains the response from method ImagesClient.BeginUpdate. -type ImagesClientUpdateResponse struct { - // 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 -} - -// LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.BeginExportRequestRateByInterval. -type LogAnalyticsClientExportRequestRateByIntervalResponse struct { - // LogAnalytics operation status response - LogAnalyticsOperationResult -} - -// LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.BeginExportThrottledRequests. -type LogAnalyticsClientExportThrottledRequestsResponse struct { - // LogAnalytics operation status response - LogAnalyticsOperationResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - // The List Compute Operation operation response. - OperationListResult -} - -// ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate. -type ProximityPlacementGroupsClientCreateOrUpdateResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientDeleteResponse contains the response from method ProximityPlacementGroupsClient.Delete. -type ProximityPlacementGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get. -type ProximityPlacementGroupsClientGetResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.NewListByResourceGroupPager. -type ProximityPlacementGroupsClientListByResourceGroupResponse struct { - // The List Proximity Placement Group operation response. - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.NewListBySubscriptionPager. -type ProximityPlacementGroupsClientListBySubscriptionResponse struct { - // The List Proximity Placement Group operation response. - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update. -type ProximityPlacementGroupsClientUpdateResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager. -type ResourceSKUsClientListResponse struct { - // The List Resource Skus operation response. - ResourceSKUsResult -} - -// RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate. -type RestorePointCollectionsClientCreateOrUpdateResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointCollectionsClientDeleteResponse contains the response from method RestorePointCollectionsClient.BeginDelete. -type RestorePointCollectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get. -type RestorePointCollectionsClientGetResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.NewListAllPager. -type RestorePointCollectionsClientListAllResponse struct { - // The List restore point collection operation response. - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.NewListPager. -type RestorePointCollectionsClientListResponse struct { - // The List restore point collection operation response. - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update. -type RestorePointCollectionsClientUpdateResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate. -type RestorePointsClientCreateResponse struct { - // Restore Point details. - RestorePoint -} - -// RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.BeginDelete. -type RestorePointsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get. -type RestorePointsClientGetResponse struct { - // Restore Point details. - RestorePoint -} - -// SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create. -type SSHPublicKeysClientCreateResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SSHPublicKeysClientDeleteResponse contains the response from method SSHPublicKeysClient.Delete. -type SSHPublicKeysClientDeleteResponse struct { - // placeholder for future response values -} - -// SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair. -type SSHPublicKeysClientGenerateKeyPairResponse struct { - // Response from generation of an SSH key pair. - SSHPublicKeyGenerateKeyPairResult -} - -// SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get. -type SSHPublicKeysClientGetResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.NewListByResourceGroupPager. -type SSHPublicKeysClientListByResourceGroupResponse struct { - // The list SSH public keys operation response. - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.NewListBySubscriptionPager. -type SSHPublicKeysClientListBySubscriptionResponse struct { - // The list SSH public keys operation response. - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update. -type SSHPublicKeysClientUpdateResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get. -type SharedGalleriesClientGetResponse struct { - // Specifies information about the Shared Gallery that you want to create or update. - SharedGallery -} - -// SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.NewListPager. -type SharedGalleriesClientListResponse struct { - // The List Shared Galleries operation response. - SharedGalleryList -} - -// SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get. -type SharedGalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - SharedGalleryImageVersion -} - -// SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.NewListPager. -type SharedGalleryImageVersionsClientListResponse struct { - // The List Shared Gallery Image versions operation response. - SharedGalleryImageVersionList -} - -// SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get. -type SharedGalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - SharedGalleryImage -} - -// SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.NewListPager. -type SharedGalleryImagesClientListResponse struct { - // The List Shared Gallery Images operation response. - SharedGalleryImageList -} - -// SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.BeginCreateOrUpdate. -type SnapshotsClientCreateOrUpdateResponse struct { - // Snapshot resource. - Snapshot -} - -// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.BeginDelete. -type SnapshotsClientDeleteResponse struct { - // placeholder for future response values -} - -// SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. -type SnapshotsClientGetResponse struct { - // Snapshot resource. - Snapshot -} - -// SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.BeginGrantAccess. -type SnapshotsClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager. -type SnapshotsClientListByResourceGroupResponse struct { - // The List Snapshots operation response. - SnapshotList -} - -// SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. -type SnapshotsClientListResponse struct { - // The List Snapshots operation response. - SnapshotList -} - -// SnapshotsClientRevokeAccessResponse contains the response from method SnapshotsClient.BeginRevokeAccess. -type SnapshotsClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate. -type SnapshotsClientUpdateResponse struct { - // Snapshot resource. - Snapshot -} - -// UsageClientListResponse contains the response from method UsageClient.NewListPager. -type UsageClientListResponse struct { - // The List Usages operation response. - ListUsagesResult -} - -// VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get. -type VirtualMachineExtensionImagesClientGetResponse struct { - // Describes a Virtual Machine Extension Image. - VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListTypesResponse contains the response from method VirtualMachineExtensionImagesClient.ListTypes. -type VirtualMachineExtensionImagesClientListTypesResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListVersionsResponse contains the response from method VirtualMachineExtensionImagesClient.ListVersions. -type VirtualMachineExtensionImagesClientListVersionsResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineExtensionsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientDeleteResponse contains the response from method VirtualMachineExtensionsClient.BeginDelete. -type VirtualMachineExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get. -type VirtualMachineExtensionsClientGetResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List. -type VirtualMachineExtensionsClientListResponse struct { - // The List Extension operation response - VirtualMachineExtensionsListResult -} - -// VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginUpdate. -type VirtualMachineExtensionsClientUpdateResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get. -type VirtualMachineImagesClientGetResponse struct { - // Describes a Virtual Machine Image. - VirtualMachineImage -} - -// VirtualMachineImagesClientListByEdgeZoneResponse contains the response from method VirtualMachineImagesClient.ListByEdgeZone. -type VirtualMachineImagesClientListByEdgeZoneResponse struct { - // The List VmImages in EdgeZone operation response. - VMImagesInEdgeZoneListResult -} - -// VirtualMachineImagesClientListOffersResponse contains the response from method VirtualMachineImagesClient.ListOffers. -type VirtualMachineImagesClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListPublishersResponse contains the response from method VirtualMachineImagesClient.ListPublishers. -type VirtualMachineImagesClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListResponse contains the response from method VirtualMachineImagesClient.List. -type VirtualMachineImagesClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListSKUsResponse contains the response from method VirtualMachineImagesClient.ListSKUs. -type VirtualMachineImagesClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get. -type VirtualMachineImagesEdgeZoneClientGetResponse struct { - // Describes a Virtual Machine Image. - VirtualMachineImage -} - -// VirtualMachineImagesEdgeZoneClientListOffersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListOffers. -type VirtualMachineImagesEdgeZoneClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListPublishersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListPublishers. -type VirtualMachineImagesEdgeZoneClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListResponse contains the response from method VirtualMachineImagesEdgeZoneClient.List. -type VirtualMachineImagesEdgeZoneClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListSKUsResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListSKUs. -type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginCreateOrUpdate. -type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientDeleteResponse contains the response from method VirtualMachineRunCommandsClient.BeginDelete. -type VirtualMachineRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine. -type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get. -type VirtualMachineRunCommandsClientGetResponse struct { - // Describes the properties of a Run Command. - RunCommandDocument -} - -// VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.NewListByVirtualMachinePager. -type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct { - // The List run command operation response - VirtualMachineRunCommandsListResult -} - -// VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.NewListPager. -type VirtualMachineRunCommandsClientListResponse struct { - // The List Virtual Machine operation response. - RunCommandListResult -} - -// VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginUpdate. -type VirtualMachineRunCommandsClientUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginDelete. -type VirtualMachineScaleSetExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get. -type VirtualMachineScaleSetExtensionsClientGetResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.NewListPager. -type VirtualMachineScaleSetExtensionsClientListResponse struct { - // The List VM scale set extension operation response. - VirtualMachineScaleSetExtensionListResult -} - -// VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginUpdate. -type VirtualMachineScaleSetExtensionsClientUpdateResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetRollingUpgradesClientCancelResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginCancel. -type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct { - // The status of the latest virtual machine scale set rolling upgrade. - RollingUpgradeStatusInfo -} - -// VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginDelete. -type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get. -type VirtualMachineScaleSetVMExtensionsClientGetResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List. -type VirtualMachineScaleSetVMExtensionsClientListResponse struct { - // The List VMSS VM Extension operation response - VirtualMachineScaleSetVMExtensionsListResult -} - -// VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginUpdate. -type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginDelete. -type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get. -type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.NewListPager. -type VirtualMachineScaleSetVMRunCommandsClientListResponse struct { - // The List run command operation response - VirtualMachineRunCommandsListResult -} - -// VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate. -type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade. -type VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks. -type VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse struct { - // Specifies the storage settings for the virtual machine disks. - StorageProfile -} - -// VirtualMachineScaleSetVMsClientDeallocateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDeallocate. -type VirtualMachineScaleSetVMsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDelete. -type VirtualMachineScaleSetVMsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView. -type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct { - // The instance view of a virtual machine scale set VM. - VirtualMachineScaleSetVMInstanceView -} - -// VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get. -type VirtualMachineScaleSetVMsClientGetResponse struct { - // Describes a virtual machine scale set virtual machine. - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.NewListPager. -type VirtualMachineScaleSetVMsClientListResponse struct { - // The List Virtual Machine Scale Set VMs operation response. - VirtualMachineScaleSetVMListResult -} - -// VirtualMachineScaleSetVMsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPerformMaintenance. -type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientPowerOffResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPowerOff. -type VirtualMachineScaleSetVMsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRedeployResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRedeploy. -type VirtualMachineScaleSetVMsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageAllResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimageAll. -type VirtualMachineScaleSetVMsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimage. -type VirtualMachineScaleSetVMsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRestartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRestart. -type VirtualMachineScaleSetVMsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct { - // The SAS URIs of the console screenshot and serial log blobs. - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachineScaleSetVMsClientRunCommandResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRunCommand. -type VirtualMachineScaleSetVMsClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionResponse contains the response from method VirtualMachineScaleSetVMsClient.SimulateEviction. -type VirtualMachineScaleSetVMsClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientStartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginStart. -type VirtualMachineScaleSetVMsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginUpdate. -type VirtualMachineScaleSetVMsClientUpdateResponse struct { - // Describes a virtual machine scale set virtual machine. - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade. -type VirtualMachineScaleSetsClientApproveRollingUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse contains the response from method VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientDeallocateResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeallocate. -type VirtualMachineScaleSetsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeleteInstances. -type VirtualMachineScaleSetsClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteResponse contains the response from method VirtualMachineScaleSetsClient.BeginDelete. -type VirtualMachineScaleSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method -// VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct { - // Response after calling a manual recovery walk - RecoveryWalkResponse -} - -// VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView. -type VirtualMachineScaleSetsClientGetInstanceViewResponse struct { - // The instance view of a virtual machine scale set. - VirtualMachineScaleSetInstanceView -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct { - // List of Virtual Machine Scale Set OS Upgrade History operation response. - VirtualMachineScaleSetListOSUpgradeHistory -} - -// VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get. -type VirtualMachineScaleSetsClientGetResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.NewListAllPager. -type VirtualMachineScaleSetsClientListAllResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListWithLinkResult -} - -// VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.NewListByLocationPager. -type VirtualMachineScaleSetsClientListByLocationResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.NewListPager. -type VirtualMachineScaleSetsClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.NewListSKUsPager. -type VirtualMachineScaleSetsClientListSKUsResponse struct { - // The Virtual Machine Scale Set List Skus operation response. - VirtualMachineScaleSetListSKUsResult -} - -// VirtualMachineScaleSetsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetsClient.BeginPerformMaintenance. -type VirtualMachineScaleSetsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientPowerOffResponse contains the response from method VirtualMachineScaleSetsClient.BeginPowerOff. -type VirtualMachineScaleSetsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReapplyResponse contains the response from method VirtualMachineScaleSetsClient.BeginReapply. -type VirtualMachineScaleSetsClientReapplyResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRedeployResponse contains the response from method VirtualMachineScaleSetsClient.BeginRedeploy. -type VirtualMachineScaleSetsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageAllResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimageAll. -type VirtualMachineScaleSetsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimage. -type VirtualMachineScaleSetsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRestartResponse contains the response from method VirtualMachineScaleSetsClient.BeginRestart. -type VirtualMachineScaleSetsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse contains the response from method VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState. -type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientStartResponse contains the response from method VirtualMachineScaleSetsClient.BeginStart. -type VirtualMachineScaleSetsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdateInstances. -type VirtualMachineScaleSetsClientUpdateInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdate. -type VirtualMachineScaleSetsClientUpdateResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.NewListPager. -type VirtualMachineSizesClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.BeginAssessPatches. -type VirtualMachinesClientAssessPatchesResponse struct { - // Describes the properties of an AssessPatches result. - VirtualMachineAssessPatchesResult -} - -// VirtualMachinesClientAttachDetachDataDisksResponse contains the response from method VirtualMachinesClient.BeginAttachDetachDataDisks. -type VirtualMachinesClientAttachDetachDataDisksResponse struct { - // Specifies the storage settings for the virtual machine disks. - StorageProfile -} - -// VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.BeginCapture. -type VirtualMachinesClientCaptureResponse struct { - // Output of virtual machine capture operation. - VirtualMachineCaptureResult -} - -// VirtualMachinesClientConvertToManagedDisksResponse contains the response from method VirtualMachinesClient.BeginConvertToManagedDisks. -type VirtualMachinesClientConvertToManagedDisksResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate. -type VirtualMachinesClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} - -// VirtualMachinesClientDeallocateResponse contains the response from method VirtualMachinesClient.BeginDeallocate. -type VirtualMachinesClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete. -type VirtualMachinesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGeneralizeResponse contains the response from method VirtualMachinesClient.Generalize. -type VirtualMachinesClientGeneralizeResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get. -type VirtualMachinesClientGetResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} - -// VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.BeginInstallPatches. -type VirtualMachinesClientInstallPatchesResponse struct { - // The result summary of an installation operation. - VirtualMachineInstallPatchesResult -} - -// VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView. -type VirtualMachinesClientInstanceViewResponse struct { - // The instance view of a virtual machine. - VirtualMachineInstanceView -} - -// VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.NewListAllPager. -type VirtualMachinesClientListAllResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.NewListAvailableSizesPager. -type VirtualMachinesClientListAvailableSizesResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.NewListByLocationPager. -type VirtualMachinesClientListByLocationResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager. -type VirtualMachinesClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientPerformMaintenanceResponse contains the response from method VirtualMachinesClient.BeginPerformMaintenance. -type VirtualMachinesClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientPowerOffResponse contains the response from method VirtualMachinesClient.BeginPowerOff. -type VirtualMachinesClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReapplyResponse contains the response from method VirtualMachinesClient.BeginReapply. -type VirtualMachinesClientReapplyResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.BeginRedeploy. -type VirtualMachinesClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReimageResponse contains the response from method VirtualMachinesClient.BeginReimage. -type VirtualMachinesClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart. -type VirtualMachinesClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData. -type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct { - // The SAS URIs of the console screenshot and serial log blobs. - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachinesClientRunCommandResponse contains the response from method VirtualMachinesClient.BeginRunCommand. -type VirtualMachinesClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachinesClientSimulateEvictionResponse contains the response from method VirtualMachinesClient.SimulateEviction. -type VirtualMachinesClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart. -type VirtualMachinesClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate. -type VirtualMachinesClientUpdateResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go deleted file mode 100644 index f53e3a7d4008..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go +++ /dev/null @@ -1,447 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointCollectionsClient contains the methods for the RestorePointCollections group. -// Don't use this type directly, use NewRestorePointCollectionsClient() instead. -type RestorePointCollectionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointCollectionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RestorePointCollectionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints -// for more details. When updating a restore point collection, only tags may be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - parameters - Parameters supplied to the Create or Update restore point collection operation. -// - options - RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RestorePointCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RestorePointCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - result := RestorePointCollectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the Restore Point Collection. -// - options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointCollectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointCollectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointCollectionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get -// method. -func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (RestorePointCollectionsClientGetResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RestorePointCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointCollectionsClient) getHandleResponse(resp *http.Response) (RestorePointCollectionsClientGetResponse, error) { - result := RestorePointCollectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets the list of restore point collections in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager -// method. -func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListResponse]{ - More: func(page RestorePointCollectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListResponse) (RestorePointCollectionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *RestorePointCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RestorePointCollectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorePointCollectionsClient) listHandleResponse(resp *http.Response) (RestorePointCollectionsClientListResponse, error) { - result := RestorePointCollectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets the list of restore point collections in the subscription. Use nextLink property in the response -// to get the next page of restore point collections. Do this till nextLink is not null to fetch all -// the restore point collections. -// -// Generated from API version 2024-03-01 -// - options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager -// method. -func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListAllResponse]{ - More: func(page RestorePointCollectionsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListAllResponse) (RestorePointCollectionsClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *RestorePointCollectionsClient) listAllCreateRequest(ctx context.Context, options *RestorePointCollectionsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *RestorePointCollectionsClient) listAllHandleResponse(resp *http.Response) (RestorePointCollectionsClientListAllResponse, error) { - result := RestorePointCollectionsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - return result, nil -} - -// Update - The operation to update the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - parameters - Parameters supplied to the Update restore point collection operation. -// - options - RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (RestorePointCollectionsClientUpdateResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *RestorePointCollectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *RestorePointCollectionsClient) updateHandleResponse(resp *http.Response) (RestorePointCollectionsClientUpdateResponse, error) { - result := RestorePointCollectionsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go deleted file mode 100644 index dffafe2da354..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go +++ /dev/null @@ -1,283 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointsClient contains the methods for the RestorePoints group. -// Don't use this type directly, use NewRestorePointsClient() instead. -type RestorePointsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RestorePointsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - restorePointName - The name of the restore point. -// - parameters - Parameters supplied to the Create restore point operation. -// - options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate -// method. -func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointsClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *RestorePointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the Restore Point Collection. -// - restorePointName - The name of the restore point. -// - options - RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete -// method. -func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*runtime.Poller[RestorePointsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - restorePointName - The name of the restore point. -// - options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) { - var err error - const operationName = "RestorePointsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (RestorePointsClientGetResponse, error) { - result := RestorePointsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePoint); err != nil { - return RestorePointsClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go deleted file mode 100644 index ee8172bae84c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleriesClient contains the methods for the SharedGalleries group. -// Don't use this type directly, use NewSharedGalleriesClient() instead. -type SharedGalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error) { - var err error - const operationName = "SharedGalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, options) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (SharedGalleriesClientGetResponse, error) { - result := SharedGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { - return SharedGalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared galleries by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager -// method. -func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleriesClientListResponse]{ - More: func(page SharedGalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleriesClientListResponse) (SharedGalleriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleriesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return SharedGalleriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, location string, options *SharedGalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleriesClient) listHandleResponse(resp *http.Response) (SharedGalleriesClientListResponse, error) { - result := SharedGalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryList); err != nil { - return SharedGalleriesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go deleted file mode 100644 index 8f0ef79cfe0e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImagesClient contains the methods for the SharedGalleryImages group. -// Don't use this type directly, use NewSharedGalleryImagesClient() instead. -type SharedGalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery image by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - options - SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (SharedGalleryImagesClientGetResponse, error) { - var err error - const operationName = "SharedGalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) (SharedGalleryImagesClientGetResponse, error) { - result := SharedGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImage); err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery images by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager -// method. -func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImagesClientListResponse]{ - More: func(page SharedGalleryImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImagesClientListResponse) (SharedGalleryImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, galleryUniqueName, options) - }, nil) - if err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImagesClient) listHandleResponse(resp *http.Response) (SharedGalleryImagesClientListResponse, error) { - result := SharedGalleryImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageList); err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go deleted file mode 100644 index 729b0e3c5d54..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImageVersionsClient contains the methods for the SharedGalleryImageVersions group. -// Don't use this type directly, use NewSharedGalleryImageVersionsClient() instead. -type SharedGalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery image version by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - 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: .. -// - options - SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (SharedGalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "SharedGalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientGetResponse, error) { - result := SharedGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersion); err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery image versions by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - options - SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager -// method. -func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImageVersionsClientListResponse]{ - More: func(page SharedGalleryImageVersionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImageVersionsClientListResponse) (SharedGalleryImageVersionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImageVersionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - }, nil) - if err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientListResponse, error) { - result := SharedGalleryImageVersionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersionList); err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go deleted file mode 100644 index 8c73f7709e6c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go +++ /dev/null @@ -1,625 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SnapshotsClient contains the methods for the Snapshots group. -// Don't use this type directly, use NewSnapshotsClient() instead. -type SnapshotsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SnapshotsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) createOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, snapshot); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { - var err error - const operationName = "SnapshotsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SnapshotsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (SnapshotsClientGetResponse, error) { - result := SnapshotsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { - return SnapshotsClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess -// method. -func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) grantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *SnapshotsClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListPager - Lists snapshots under a subscription. -// -// Generated from API version 2023-10-02 -// - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ - More: func(page SnapshotsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return SnapshotsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *SnapshotsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (SnapshotsClientListResponse, error) { - result := SnapshotsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists snapshots under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListByResourceGroupResponse]{ - More: func(page SnapshotsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (SnapshotsClientListByResourceGroupResponse, error) { - result := SnapshotsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess -// method. -func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) revokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *SnapshotsClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - 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. -// - options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, snapshot); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go deleted file mode 100644 index 58d8d18ba95c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go +++ /dev/null @@ -1,489 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SSHPublicKeysClient contains the methods for the SSHPublicKeys group. -// Don't use this type directly, use NewSSHPublicKeysClient() instead. -type SSHPublicKeysClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SSHPublicKeysClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SSHPublicKeysClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Create - Creates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - parameters - Parameters supplied to create the SSH public key. -// - options - SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (SSHPublicKeysClientCreateResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Create" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err -} - -// createCreateRequest creates the Create request. -func (client *SSHPublicKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createHandleResponse handles the Create response. -func (client *SSHPublicKeysClient) createHandleResponse(resp *http.Response) (SSHPublicKeysClientCreateResponse, error) { - result := SSHPublicKeysClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - return result, nil -} - -// Delete - Delete an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (SSHPublicKeysClientDeleteResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientDeleteResponse{}, err - } - return SSHPublicKeysClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GenerateKeyPair - Generates and returns a public/private key pair and populates the SSH public key resource with the public -// key. The length of the key will be 3072 bits. This operation can only be performed once per -// SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.GenerateKeyPair" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.generateKeyPairCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - resp, err := client.generateKeyPairHandleResponse(httpResp) - return resp, err -} - -// generateKeyPairCreateRequest creates the GenerateKeyPair request. -func (client *SSHPublicKeysClient) generateKeyPairCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// generateKeyPairHandleResponse handles the GenerateKeyPair response. -func (client *SSHPublicKeysClient) generateKeyPairHandleResponse(resp *http.Response) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - result := SSHPublicKeysClientGenerateKeyPairResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyGenerateKeyPairResult); err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - return result, nil -} - -// Get - Retrieves information about an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (SSHPublicKeysClientGetResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SSHPublicKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SSHPublicKeysClient) getHandleResponse(resp *http.Response) (SSHPublicKeysClientGetResponse, error) { - result := SSHPublicKeysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property -// in the response to get the next page of SSH public keys. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager -// method. -func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListByResourceGroupResponse]{ - More: func(page SSHPublicKeysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListByResourceGroupResponse) (SSHPublicKeysClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SSHPublicKeysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SSHPublicKeysClient) listByResourceGroupHandleResponse(resp *http.Response) (SSHPublicKeysClientListByResourceGroupResponse, error) { - result := SSHPublicKeysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response -// to get the next page of SSH public keys. -// -// Generated from API version 2024-03-01 -// - options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager -// method. -func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListBySubscriptionResponse]{ - More: func(page SSHPublicKeysClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListBySubscriptionResponse) (SSHPublicKeysClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SSHPublicKeysClient) listBySubscriptionCreateRequest(ctx context.Context, options *SSHPublicKeysClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *SSHPublicKeysClient) listBySubscriptionHandleResponse(resp *http.Response) (SSHPublicKeysClientListBySubscriptionResponse, error) { - result := SSHPublicKeysClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Updates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - parameters - Parameters supplied to update the SSH public key. -// - options - SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (SSHPublicKeysClientUpdateResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *SSHPublicKeysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *SSHPublicKeysClient) updateHandleResponse(resp *http.Response) (SSHPublicKeysClientUpdateResponse, error) { - result := SSHPublicKeysClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go deleted file mode 100644 index ae4e62dd4271..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go deleted file mode 100644 index e251486e972d..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// UsageClient contains the methods for the Usage group. -// Don't use this type directly, use NewUsageClient() instead. -type UsageClient struct { - internal *arm.Client - subscriptionID string -} - -// NewUsageClient creates a new instance of UsageClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &UsageClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// -// Generated from API version 2024-03-01 -// - location - The location for which resource usage is queried. -// - options - UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. -func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[UsageClientListResponse]{ - More: func(page UsageClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *UsageClientListResponse) (UsageClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsageClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return UsageClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *UsageClient) listCreateRequest(ctx context.Context, location string, options *UsageClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *UsageClient) listHandleResponse(resp *http.Response) (UsageClientListResponse, error) { - result := UsageClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListUsagesResult); err != nil { - return UsageClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go deleted file mode 100644 index a337d2453923..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go +++ /dev/null @@ -1,259 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineExtensionImagesClient contains the methods for the VirtualMachineExtensionImages group. -// Don't use this type directly, use NewVirtualMachineExtensionImagesClient() instead. -type VirtualMachineExtensionImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine extension image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (VirtualMachineExtensionImagesClientGetResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publisherName, typeParam, version, options) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientGetResponse, error) { - result := VirtualMachineExtensionImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImage); err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - return result, nil -} - -// ListTypes - Gets a list of virtual machine extension image types. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.ListTypes" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listTypesCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - resp, err := client.listTypesHandleResponse(httpResp) - return resp, err -} - -// listTypesCreateRequest creates the ListTypes request. -func (client *VirtualMachineExtensionImagesClient) listTypesCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listTypesHandleResponse handles the ListTypes response. -func (client *VirtualMachineExtensionImagesClient) listTypesHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - result := VirtualMachineExtensionImagesClientListTypesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - return result, nil -} - -// ListVersions - Gets a list of virtual machine extension image versions. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.ListVersions" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listVersionsCreateRequest(ctx, location, publisherName, typeParam, options) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - resp, err := client.listVersionsHandleResponse(httpResp) - return resp, err -} - -// listVersionsCreateRequest creates the ListVersions request. -func (client *VirtualMachineExtensionImagesClient) listVersionsCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVersionsHandleResponse handles the ListVersions response. -func (client *VirtualMachineExtensionImagesClient) listVersionsHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - result := VirtualMachineExtensionImagesClientListVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go deleted file mode 100644 index bd62e8137a1c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go +++ /dev/null @@ -1,437 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineExtensionsClient contains the methods for the VirtualMachineExtensions group. -// Don't use this type directly, use NewVirtualMachineExtensionsClient() instead. -type VirtualMachineExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get -// method. -func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (VirtualMachineExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientGetResponse, error) { - result := VirtualMachineExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtension); err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of a Virtual Machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the extension. -// - options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (VirtualMachineExtensionsClientListResponse, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientListResponse, error) { - result := VirtualMachineExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionsListResult); err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) update(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go deleted file mode 100644 index d2557d0d454b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go +++ /dev/null @@ -1,470 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesClient contains the methods for the VirtualMachineImages group. -// Don't use this type directly, use NewVirtualMachineImagesClient() instead. -type VirtualMachineImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get -// method. -func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (VirtualMachineImagesClientGetResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesClientGetResponse, error) { - result := VirtualMachineImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - options - VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List -// method. -func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (VirtualMachineImagesClientListResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, location, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesClient) listCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesClientListResponse, error) { - result := VirtualMachineImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - return result, nil -} - -// ListByEdgeZone - Gets a list of all virtual machine image versions for the specified edge zone -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - options - VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone -// method. -func (client *VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListByEdgeZone" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listByEdgeZoneCreateRequest(ctx, location, edgeZone, options) - if err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - resp, err := client.listByEdgeZoneHandleResponse(httpResp) - return resp, err -} - -// listByEdgeZoneCreateRequest creates the ListByEdgeZone request. -func (client *VirtualMachineImagesClient) listByEdgeZoneCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByEdgeZoneHandleResponse handles the ListByEdgeZone response. -func (client *VirtualMachineImagesClient) listByEdgeZoneHandleResponse(resp *http.Response) (VirtualMachineImagesClientListByEdgeZoneResponse, error) { - result := VirtualMachineImagesClientListByEdgeZoneResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VMImagesInEdgeZoneListResult); err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (VirtualMachineImagesClientListOffersResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListOffers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listOffersCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListOffersResponse{}, err - } - resp, err := client.listOffersHandleResponse(httpResp) - return resp, err -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesClient) listOffersCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListOffersResponse, error) { - result := VirtualMachineImagesClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (VirtualMachineImagesClientListPublishersResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListPublishers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listPublishersCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListPublishersResponse{}, err - } - resp, err := client.listPublishersHandleResponse(httpResp) - return resp, err -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesClient) listPublishersCreateRequest(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListPublishersResponse, error) { - result := VirtualMachineImagesClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - options - VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (VirtualMachineImagesClientListSKUsResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListSKUs" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listSKUsCreateRequest(ctx, location, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListSKUsResponse{}, err - } - resp, err := client.listSKUsHandleResponse(httpResp) - return resp, err -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesClient) listSKUsCreateRequest(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesClientListSKUsResponse, error) { - result := VirtualMachineImagesClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go deleted file mode 100644 index 8558798f5e2f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go +++ /dev/null @@ -1,430 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesEdgeZoneClient contains the methods for the VirtualMachineImagesEdgeZone group. -// Don't use this type directly, use NewVirtualMachineImagesEdgeZoneClient() instead. -type VirtualMachineImagesEdgeZoneClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesEdgeZoneClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesEdgeZoneClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine image in an edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - version - A valid image SKU version. -// - options - VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesEdgeZoneClient) getCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesEdgeZoneClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - result := VirtualMachineImagesEdgeZoneClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - options - VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesEdgeZoneClient) listCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - options - VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListOffers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listOffersCreateRequest(ctx, location, edgeZone, publisherName, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - resp, err := client.listOffersHandleResponse(httpResp) - return resp, err -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListPublishers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listPublishersCreateRequest(ctx, location, edgeZone, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - resp, err := client.listPublishersHandleResponse(httpResp) - return resp, err -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - options - VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListSKUs" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listSKUsCreateRequest(ctx, location, edgeZone, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - resp, err := client.listSKUsHandleResponse(httpResp) - return resp, err -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go deleted file mode 100644 index c5ef4894c228..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go +++ /dev/null @@ -1,562 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineRunCommandsClient contains the methods for the VirtualMachineRunCommands group. -// Don't use this type directly, use NewVirtualMachineRunCommandsClient() instead. -type VirtualMachineRunCommandsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineRunCommandsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineRunCommandsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be created or updated. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// - options - VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be deleted. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - Gets specific run command for a subscription in a location. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which run commands is queried. -// - commandID - The command id. -// - options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (VirtualMachineRunCommandsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, commandID, options) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineRunCommandsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineRunCommandsClient) getCreateRequest(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if commandID == "" { - return nil, errors.New("parameter commandID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{commandId}", url.PathEscape(commandID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetResponse, error) { - result := VirtualMachineRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandDocument); err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// GetByVirtualMachine - The operation to get the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the run command. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.GetByVirtualMachine" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - resp, err := client.getByVirtualMachineHandleResponse(httpResp) - return resp, err -} - -// getByVirtualMachineCreateRequest creates the GetByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getByVirtualMachineHandleResponse handles the GetByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientGetByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all available run commands for a subscription in a location. -// -// Generated from API version 2024-03-01 -// - location - The location upon which run commands is queried. -// - options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager -// method. -func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListResponse]{ - More: func(page VirtualMachineRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListResponse) (VirtualMachineRunCommandsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineRunCommandsClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListResponse, error) { - result := VirtualMachineRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandListResult); err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - return result, nil -} - -// NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the run command. -// - options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager -// method. -func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListByVirtualMachineResponse]{ - More: func(page VirtualMachineRunCommandsClientListByVirtualMachineResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListByVirtualMachineResponse) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListByVirtualMachinePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, options) - }, nil) - if err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - return client.listByVirtualMachineHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByVirtualMachineCreateRequest creates the ListByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listByVirtualMachineHandleResponse handles the ListByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientListByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be updated. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// - options - VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go deleted file mode 100644 index dd55aabc3e13..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go +++ /dev/null @@ -1,1984 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachinesClient contains the methods for the VirtualMachines group. -// Don't use this type directly, use NewVirtualMachinesClient() instead. -type VirtualMachinesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachinesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginAssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.assessPatches(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientAssessPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientAssessPatchesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) assessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginAssessPatches" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.assessPatchesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// assessPatchesCreateRequest creates the AssessPatches request. -func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginAttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the attach and detach data disks operation on the virtual machine. -// - options - VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks -// method. -func (client *VirtualMachinesClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.attachDetachDataDisks(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientAttachDetachDataDisksResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientAttachDetachDataDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginAttachDetachDataDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.attachDetachDataDisksCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// attachDetachDataDisksCreateRequest creates the AttachDetachDataDisks request. -func (client *VirtualMachinesClient) attachDetachDataDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginCapture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Capture Virtual Machine operation. -// - options - VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture -// method. -func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.capture(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCaptureResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Capture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar -// VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) capture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginCapture" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.captureCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// captureCreateRequest creates the Capture request. -func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.convertToManagedDisks(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientConvertToManagedDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientConvertToManagedDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) convertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginConvertToManagedDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.convertToManagedDisksCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// convertToManagedDisksCreateRequest creates the ConvertToManagedDisks request. -func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginCreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Create Virtual Machine operation. -// - options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only during -// virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Deallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources -// that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) deallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.Hibernate != nil { - reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete -// method. -func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// 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/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/azure/virtual-machines/linux/capture-image]. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize -// method. -func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (VirtualMachinesClientGeneralizeResponse, error) { - var err error - const operationName = "VirtualMachinesClient.Generalize" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.generalizeCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientGeneralizeResponse{}, err - } - return VirtualMachinesClientGeneralizeResponse{}, nil -} - -// generalizeCreateRequest creates the Generalize request. -func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about the model view or the instance view of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error) { - var err error - const operationName = "VirtualMachinesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (VirtualMachinesClientGetResponse, error) { - result := VirtualMachinesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachine); err != nil { - return VirtualMachinesClientGetResponse{}, err - } - return result, nil -} - -// BeginInstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - installPatchesInput - Input for InstallPatches as directly received by the API -// - options - VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.installPatches(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientInstallPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientInstallPatchesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// InstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) installPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginInstallPatches" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.installPatchesCreateRequest(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// installPatchesCreateRequest creates the InstallPatches request. -func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, installPatchesInput); err != nil { - return nil, err - } - return req, nil -} - -// InstanceView - Retrieves information about the run-time state of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView -// method. -func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (VirtualMachinesClientInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachinesClient.InstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.instanceViewCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientInstanceViewResponse{}, err - } - resp, err := client.instanceViewHandleResponse(httpResp) - return resp, err -} - -// instanceViewCreateRequest creates the InstanceView request. -func (client *VirtualMachinesClient) instanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// instanceViewHandleResponse handles the InstanceView response. -func (client *VirtualMachinesClient) instanceViewHandleResponse(resp *http.Response) (VirtualMachinesClientInstanceViewResponse, error) { - result := VirtualMachinesClientInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineInstanceView); err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - 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. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager -// method. -func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListResponse]{ - More: func(page VirtualMachinesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListResponse) (VirtualMachinesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return VirtualMachinesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) { - result := VirtualMachinesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - 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. -// -// Generated from API version 2024-03-01 -// - options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager -// method. -func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAllResponse]{ - More: func(page VirtualMachinesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAllResponse) (VirtualMachinesClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachinesClient) listAllCreateRequest(ctx context.Context, options *VirtualMachinesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.StatusOnly != nil { - reqQP.Set("statusOnly", *options.StatusOnly) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachinesClient) listAllHandleResponse(resp *http.Response) (VirtualMachinesClientListAllResponse, error) { - result := VirtualMachinesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager -// method. -func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAvailableSizesResponse]{ - More: func(page VirtualMachinesClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAvailableSizesResponse) (VirtualMachinesClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *VirtualMachinesClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *VirtualMachinesClient) listAvailableSizesHandleResponse(resp *http.Response) (VirtualMachinesClientListAvailableSizesResponse, error) { - result := VirtualMachinesClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location. -// -// Generated from API version 2024-03-01 -// - location - The location for which virtual machines under the subscription are queried. -// - options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager -// method. -func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListByLocationResponse]{ - More: func(page VirtualMachinesClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListByLocationResponse) (VirtualMachinesClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListByLocationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachinesClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachinesClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachinesClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachinesClientListByLocationResponse, error) { - result := VirtualMachinesClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) performMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachinesClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply -// method. -func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reapply(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) reapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginReapply" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reapplyCreateRequest creates the Reapply request. -func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) a virtual machine 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. NOTE: -// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk -// will be preserved after reimage. If deleteOption is delete, the old OS disk -// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage -// method. -func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*runtime.Poller[VirtualMachinesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimages (upgrade the operating system) a virtual machine 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. NOTE: -// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk -// will be preserved after reimage. If deleteOption is delete, the old OS disk -// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart -// method. -func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - var err error - const operationName = "VirtualMachinesClient.RetrieveBootDiagnosticsData" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp) - return resp, err -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Run command operation. -// - options - VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRunCommandResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) runCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRunCommand" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (VirtualMachinesClientSimulateEvictionResponse, error) { - var err error - const operationName = "VirtualMachinesClient.SimulateEviction" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - return VirtualMachinesClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart -// method. -func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Update Virtual Machine operation. -// - options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate -// method. -func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go deleted file mode 100644 index 81ddfad6a6aa..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go +++ /dev/null @@ -1,434 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetExtensionsClient contains the methods for the VirtualMachineScaleSetExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetExtensionsClient() instead. -type VirtualMachineScaleSetExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtension); err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all extensions in a VM scale set. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set containing the extension. -// - options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetExtensionsClientListResponse]{ - More: func(page VirtualMachineScaleSetExtensionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetExtensionsClientListResponse) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetExtensionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtensionListResult); err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go deleted file mode 100644 index 41e01d5d74d5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go +++ /dev/null @@ -1,346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetRollingUpgradesClient contains the methods for the VirtualMachineScaleSetRollingUpgrades group. -// Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesClient() instead. -type VirtualMachineScaleSetRollingUpgradesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetRollingUpgradesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetRollingUpgradesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.cancel(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Cancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginCancel" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.cancelCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// cancelCreateRequest creates the Cancel request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.GetLatest" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getLatestCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - resp, err := client.getLatestHandleResponse(httpResp) - return resp, err -} - -// getLatestCreateRequest creates the GetLatest request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getLatestHandleResponse handles the GetLatest response. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestHandleResponse(resp *http.Response) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - result := VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RollingUpgradeStatusInfo); err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - return result, nil -} - -// BeginStartExtensionUpgrade - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters -// for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startExtensionUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startExtensionUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startExtensionUpgradeCreateRequest creates the StartExtensionUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStartOSUpgrade - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the -// VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startOSUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startOSUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startOSUpgradeCreateRequest creates the StartOSUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go deleted file mode 100644 index a03ff0c5083c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go +++ /dev/null @@ -1,1957 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetsClient contains the methods for the VirtualMachineScaleSets group. -// Don't use this type directly, use NewVirtualMachineScaleSetsClient() instead. -type VirtualMachineScaleSetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM -// scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade -// method. -func (client *VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.approveRollingUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ApproveRollingUpgrade - Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale -// set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.approveRollingUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// approveRollingUpgradeCreateRequest creates the ApproveRollingUpgrade request. -func (client *VirtualMachineScaleSetsClient) approveRollingUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.convertToSinglePlacementGroupCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, nil -} - -// convertToSinglePlacementGroupCreateRequest creates the ConvertToSinglePlacementGroup request. -func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginCreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set to create or update. -// - parameters - The scale set object. -// - options - VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.Hibernate != nil { - reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginDelete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDeleteInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil { - return nil, err - } - return req, nil -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk - Manual platform update domain walk to update virtual machines in a -// service fabric virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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 -// - options - VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional -// parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx, resourceGroupName, vmScaleSetName, platformUpdateDomain, options) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - resp, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(httpResp) - return resp, err -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest creates the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.PlacementGroupID != nil { - reqQP.Set("placementGroupId", *options.PlacementGroupID) - } - reqQP.Set("platformUpdateDomain", strconv.FormatInt(int64(platformUpdateDomain), 10)) - if options != nil && options.Zone != nil { - reqQP.Set("zone", *options.Zone) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse handles the ForceRecoveryServiceFabricPlatformUpdateDomainWalk response. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - result := VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RecoveryWalkResponse); err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - return result, nil -} - -// Get - Display information about a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get -// method. -func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (VirtualMachineScaleSetsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetResponse, error) { - result := VirtualMachineScaleSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSet); err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetInstanceView); err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager -// method. -func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]{ - More: func(page VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.getOSUpgradeHistoryCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - return client.getOSUpgradeHistoryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// getOSUpgradeHistoryCreateRequest creates the GetOSUpgradeHistory request. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSUpgradeHistoryHandleResponse handles the GetOSUpgradeHistory response. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - result := VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListOSUpgradeHistory); err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all VM scale sets under a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListResponse]{ - More: func(page VirtualMachineScaleSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListResponse) (VirtualMachineScaleSetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListResponse, error) { - result := VirtualMachineScaleSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - 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. -// -// Generated from API version 2024-03-01 -// - options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListAllResponse]{ - More: func(page VirtualMachineScaleSetsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListAllResponse) (VirtualMachineScaleSetsClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Context, options *VirtualMachineScaleSetsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListAllResponse, error) { - result := VirtualMachineScaleSetsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListWithLinkResult); err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location. -// -// Generated from API version 2024-03-01 -// - location - The location for which VM scale sets under the subscription are queried. -// - options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListByLocationResponse]{ - More: func(page VirtualMachineScaleSetsClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListByLocationResponse) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListByLocationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachineScaleSetsClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachineScaleSetsClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - result := VirtualMachineScaleSetsClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - return result, nil -} - -// NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances -// allowed for each SKU. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListSKUsResponse]{ - More: func(page VirtualMachineScaleSetsClientListSKUsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListSKUsResponse) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListSKUsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listSKUsCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - return client.listSKUsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineScaleSetsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineScaleSetsClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - result := VirtualMachineScaleSetsClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListSKUsResult); err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - 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/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginPowerOff - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply -// method. -func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reapply(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReapplyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReapply" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reapplyCreateRequest creates the Reapply request. -func (client *VirtualMachineScaleSetsClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimage - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetReimageInput != nil { - if err := runtime.MarshalAsJSON(req, *options.VMScaleSetReimageInput); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReimageAll" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginSetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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 SetOrchestrationServiceState API. -// - options - VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the -// VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method. -func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setOrchestrationServiceState(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.setOrchestrationServiceStateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// setOrchestrationServiceStateCreateRequest creates the SetOrchestrationServiceState request. -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginStart - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginUpdate - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set to create or update. -// - parameters - The scale set object. -// - options - VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) updateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginUpdateInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateInstancesCreateRequest creates the UpdateInstances request. -func (client *VirtualMachineScaleSetsClient) updateInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go deleted file mode 100644 index c16821d834ad..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMExtensionsClient contains the methods for the VirtualMachineScaleSetVMExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsClient() instead. -type VirtualMachineScaleSetVMExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtension); err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of an instance in Virtual Machine Scaleset. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtensionsListResult); err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go deleted file mode 100644 index 85e67fc5572e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMRunCommandsClient contains the methods for the VirtualMachineScaleSetVMRunCommands group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsClient() instead. -type VirtualMachineScaleSetVMRunCommandsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMRunCommandsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMRunCommandsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMRunCommandsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMRunCommandsClientListResponse) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMRunCommandsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go deleted file mode 100644 index 379ae96b2449..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go +++ /dev/null @@ -1,1494 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetVMsClient contains the methods for the VirtualMachineScaleSetVMs group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMsClient() instead. -type VirtualMachineScaleSetVMsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.approveRollingUpgrade(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.approveRollingUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// approveRollingUpgradeCreateRequest creates the ApproveRollingUpgrade request. -func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginAttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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 attach and detach data disks operation on a Virtual Machine Scale Sets VM. -// - options - VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.attachDetachDataDisks(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.attachDetachDataDisksCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// attachDetachDataDisksCreateRequest creates the AttachDetachDataDisks request. -func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisksCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/attachDetachDataDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (VirtualMachineScaleSetVMsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetResponse, error) { - result := VirtualMachineScaleSetVMsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVM); err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetVMsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMInstanceView); err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all virtual machines in a VM scale sets. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMsClientListResponse) (VirtualMachineScaleSetVMsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", *options.Select) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientListResponse, error) { - result := VirtualMachineScaleSetVMsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMListResult); err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetVMReimageInput != nil { - if err := runtime.MarshalAsJSON(req, *options.VMScaleSetVMReimageInput); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimageAll - 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginReimageAll" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM -// scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp) - return resp, err -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) runCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRunCommand" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.SimulateEviction" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - 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. -// - options - VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go deleted file mode 100644 index 80a7316acd16..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group. -// Don't use this type directly, use NewVirtualMachineSizesClient() instead. -type VirtualMachineSizesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineSizesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list] -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager -// method. -func (client *VirtualMachineSizesClient) NewListPager(location string, options *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineSizesClientListResponse]{ - More: func(page VirtualMachineSizesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachineSizesClientListResponse) (VirtualMachineSizesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineSizesClient.NewListPager") - req, err := client.listCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineSizesClient) listHandleResponse(resp *http.Response) (VirtualMachineSizesClientListResponse, error) { - result := VirtualMachineSizesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/.gitignore b/vendor/github.com/asaskevich/govalidator/v11/.gitignore deleted file mode 100644 index 8d69a9418aa3..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/v11/.travis.yml b/vendor/github.com/asaskevich/govalidator/v11/.travis.yml deleted file mode 100644 index bb83c6670df6..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81b1..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1edd9..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/v11/LICENSE b/vendor/github.com/asaskevich/govalidator/v11/LICENSE deleted file mode 100644 index cacba9102400..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/v11/README.md b/vendor/github.com/asaskevich/govalidator/v11/README.md deleted file mode 100644 index fa56e3c4c893..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/README.md +++ /dev/null @@ -1,624 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator/v11 - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator/v11" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator/v11" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator/v11" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator/v11" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator/v11" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsYYYYMMDD(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -"yyyymmdd": IsYYYYMMDD, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator/v11" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/v11/arrays.go b/vendor/github.com/asaskevich/govalidator/v11/arrays.go deleted file mode 100644 index 3e1da7cb480e..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/converter.go b/vendor/github.com/asaskevich/govalidator/v11/converter.go deleted file mode 100644 index d68e990fc256..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/doc.go b/vendor/github.com/asaskevich/govalidator/v11/doc.go deleted file mode 100644 index 55dce62dc8c3..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/v11/error.go b/vendor/github.com/asaskevich/govalidator/v11/error.go deleted file mode 100644 index 1da2336f47ee..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/numerics.go b/vendor/github.com/asaskevich/govalidator/v11/numerics.go deleted file mode 100644 index 5041d9e86844..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/patterns.go b/vendor/github.com/asaskevich/govalidator/v11/patterns.go deleted file mode 100644 index bafc3765ea12..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/v11/types.go b/vendor/github.com/asaskevich/govalidator/v11/types.go deleted file mode 100644 index 6347d5fa6e60..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/types.go +++ /dev/null @@ -1,657 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, - "yyyymmdd": IsYYYYMMDD, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/utils.go b/vendor/github.com/asaskevich/govalidator/v11/utils.go deleted file mode 100644 index f4c30f824a22..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/validator.go b/vendor/github.com/asaskevich/govalidator/v11/validator.go deleted file mode 100644 index 740be790e6d8..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/validator.go +++ /dev/null @@ -1,1775 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number/10, number%10 - - var sum int64 - for i := 0; number > 0; i++ { - digit := number % 10 - - if i%2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum+lastDigit)%10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} - -// IsYYYYMMDD checks if a string is in the "YYYY-MM-DD" date format and returns true if valid. -func IsYYYYMMDD(str string) bool { - layout := "2006-01-02" - _, err := time.Parse(layout, str) - return err == nil -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/wercker.yml b/vendor/github.com/asaskevich/govalidator/v11/wercker.yml deleted file mode 100644 index bc5f7b0864bd..000000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.md deleted file mode 100644 index 000b601f0988..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.md +++ /dev/null @@ -1,882 +0,0 @@ -# v1.77.0 (2026-01-14) - -* **Feature**: Added support for BOTTLEROCKET NVIDIA FIPS AMIs to AMI types in US regions. - -# v1.76.4 (2026-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.76.3 (2025-12-09) - -* No change notes available for this release. - -# v1.76.2 (2025-12-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.76.1 (2025-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. - -# v1.76.0 (2025-12-01) - -* **Feature**: This release adds support for EKS Capabilities - -# v1.75.1 (2025-11-25) - -* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 - -# v1.75.0 (2025-11-21) - -* **Feature**: Adds support for controlPlaneScalingConfig on EKS Clusters. - -# v1.74.10 (2025-11-19.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.9 (2025-11-12) - -* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. -* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. -* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. - -# v1.74.8 (2025-11-11) - -* **Bug Fix**: Return validation error if input region is not a valid host label. - -# v1.74.7 (2025-11-04) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. - -# v1.74.6 (2025-10-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.5 (2025-10-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.4 (2025-10-22) - -* No change notes available for this release. - -# v1.74.3 (2025-10-16) - -* **Dependency Update**: Bump minimum Go version to 1.23. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.2 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.1 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.74.0 (2025-09-22) - -* **Feature**: Adds support for RepairConfig overrides and configurations in EKS Managed Node Groups. - -# v1.73.3 (2025-09-10) - -* No change notes available for this release. - -# v1.73.2 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.73.1 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.73.0 (2025-08-27) - -* **Feature**: Add support for on-demand refresh of EKS cluster insights -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.72.0 (2025-08-25) - -* **Feature**: Remove incorrect endpoint tests - -# v1.71.1 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.71.0 (2025-08-20) - -* **Feature**: EKS Add-ons Custom Namespace Support -* **Bug Fix**: Remove unused deserialization code. - -# v1.70.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.69.0 (2025-08-05) - -* **Feature**: Add support for deletion protection on EKS clusters - -# v1.68.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.67.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.67.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.66.2 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.66.1 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.66.0 (2025-06-11) - -* **Feature**: Release for EKS Pod Identity Cross Account feature and disableSessionTags flag. - -# v1.65.2 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.65.1 (2025-06-06) - -* No change notes available for this release. - -# v1.65.0 (2025-06-02) - -* **Feature**: Add support for filtering ListInsights API calls on MISCONFIGURATION insight category - -# v1.64.0 (2025-04-16) - -* **Feature**: Added support for new AL2023 ARM64 NVIDIA AMIs to the supported AMITypes. - -# v1.63.2 (2025-04-10) - -* No change notes available for this release. - -# v1.63.1 (2025-04-03) - -* No change notes available for this release. - -# v1.63.0 (2025-03-31) - -* **Feature**: Add support for updating RemoteNetworkConfig for hybrid nodes on EKS UpdateClusterConfig API - -# v1.62.0 (2025-03-27) - -* **Feature**: Added support for BOTTLEROCKET FIPS AMIs to AMI types in US regions. - -# v1.61.0 (2025-03-25) - -* **Feature**: Added support to override upgrade-blocking readiness checks via force flag when updating a cluster. - -# v1.60.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.60.0 (2025-02-28) - -* **Feature**: Adding licenses to EKS Anywhere Subscription operations response. - -# v1.59.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.58.1 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.58.0 (2025-02-07) - -* **Feature**: Introduce versionStatus field to take place of status field in EKS DescribeClusterVersions API - -# v1.57.4 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.57.3 (2025-02-04) - -* No change notes available for this release. - -# v1.57.2 (2025-01-31) - -* **Dependency Update**: Switch to code-generated waiter matchers, removing the dependency on go-jmespath. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.57.1 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.57.0 (2025-01-24) - -* **Feature**: Adds support for UpdateStrategies in EKS Managed Node Groups. -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.56.5 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.56.4 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.56.3 (2025-01-14) - -* **Bug Fix**: Fix issue where waiters were not failing on unmatched errors as they should. This may have breaking behavioral changes for users in fringe cases. See [this announcement](https://github.com/aws/aws-sdk-go-v2/discussions/2954) for more information. - -# v1.56.2 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.56.1 (2025-01-08) - -* No change notes available for this release. - -# v1.56.0 (2024-12-23) - -* **Feature**: This release adds support for DescribeClusterVersions API that provides important information about Kubernetes versions along with end of support dates - -# v1.55.0 (2024-12-20) - -* **Feature**: This release expands the catalog of upgrade insight checks - -# v1.54.1 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.54.0 (2024-12-13) - -* **Feature**: Add NodeRepairConfig in CreateNodegroupRequest and UpdateNodegroupConfigRequest - -# v1.53.0 (2024-12-02) - -* **Feature**: Added support for Auto Mode Clusters, Hybrid Nodes, and specifying computeTypes in the DescribeAddonVersions API. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.52.1 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.52.0 (2024-11-08) - -* **Feature**: Adds new error code `Ec2InstanceTypeDoesNotExist` for Amazon EKS managed node groups - -# v1.51.3 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.51.2 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.1 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.0 (2024-10-21) - -* **Feature**: This release adds support for Amazon Application Recovery Controller (ARC) zonal shift and zonal autoshift with EKS that enhances the resiliency of multi-AZ cluster environments - -# v1.50.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.49.4 (2024-10-03) - -* No change notes available for this release. - -# v1.49.3 (2024-09-27) - -* No change notes available for this release. - -# v1.49.2 (2024-09-25) - -* No change notes available for this release. - -# v1.49.1 (2024-09-23) - -* No change notes available for this release. - -# v1.49.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.48.5 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.48.4 (2024-09-04) - -* No change notes available for this release. - -# v1.48.3 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.48.2 (2024-08-22) - -* No change notes available for this release. - -# v1.48.1 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.48.0 (2024-08-12) - -* **Feature**: Added support for new AL2023 GPU AMIs to the supported AMITypes. - -# v1.47.0 (2024-07-25) - -* **Feature**: This release adds support for EKS cluster to manage extended support. - -# v1.46.2 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.1 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.0 (2024-07-01) - -* **Feature**: Updates EKS managed node groups to support EC2 Capacity Blocks for ML - -# v1.45.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.0 (2024-06-26) - -* **Feature**: Added support for disabling unmanaged addons during cluster creation. -* **Feature**: Support list-of-string endpoint parameter. - -# v1.44.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.44.0 (2024-06-18) - -* **Feature**: This release adds support to surface async fargate customer errors from async path to customer through describe-fargate-profile API response. -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.2 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.1 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.0 (2024-06-03) - -* **Feature**: Adds support for EKS add-ons pod identity associations integration -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.42.5 (2024-05-23) - -* No change notes available for this release. - -# v1.42.4 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.42.3 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.42.2 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.42.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.42.0 (2024-03-28) - -* **Feature**: Add multiple customer error code to handle customer caused failure when managing EKS node groups - -# v1.41.2 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.41.1 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.41.0 (2024-02-29) - -* **Feature**: Added support for new AL2023 AMIs to the supported AMITypes. - -# v1.40.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.39.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.39.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.39.0 (2024-02-16) - -* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. - -# v1.38.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.1 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.0 (2023-12-20) - -* **Feature**: Add support for cluster insights, new EKS capability that surfaces potentially upgrade impacting issues. - -# v1.36.0 (2023-12-18) - -* **Feature**: Add support for EKS Cluster Access Management. - -# v1.35.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.35.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.35.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.2 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.1 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.34.0 (2023-11-27) - -* **Feature**: This release adds support for EKS Pod Identity feature. EKS Pod Identity makes it easy for customers to obtain IAM permissions for the applications running in their EKS clusters. - -# v1.33.2 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.1 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.0 (2023-11-09.2) - -* **Feature**: Adding EKS Anywhere subscription related operations. - -# v1.32.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2023-10-24) - -* **Feature**: Added support for Cluster Subnet and Security Group mutability. - -# v1.29.7 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.6 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.1 (2023-08-01) - -* No change notes available for this release. - -# v1.29.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2023-07-27) - -* **Feature**: Add multiple customer error code to handle customer caused failure when managing EKS node groups - -# v1.27.15 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.14 (2023-06-15) - -* No change notes available for this release. - -# v1.27.13 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.12 (2023-05-04) - -* No change notes available for this release. - -# v1.27.11 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.10 (2023-04-10) - -* No change notes available for this release. - -# v1.27.9 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.8 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.7 (2023-03-14) - -* No change notes available for this release. - -# v1.27.6 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.5 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.27.4 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.3 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.27.2 (2023-02-08) - -* No change notes available for this release. - -# v1.27.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.26.0 (2022-12-15) - -* **Feature**: Add support for Windows managed nodes groups. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2022-12-07) - -* **Feature**: Adds support for EKS add-ons configurationValues fields and DescribeAddonConfiguration function - -# v1.24.1 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2022-11-29) - -* **Feature**: Adds support for additional EKS add-ons metadata and filtering fields - -# v1.23.0 (2022-11-16) - -* **Feature**: Adds support for customer-provided placement groups for Kubernetes control plane instances when creating local EKS clusters on Outposts - -# v1.22.4 (2022-11-07) - -* No change notes available for this release. - -# v1.22.3 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.2 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.0 (2022-09-14) - -* **Feature**: Adding support for local Amazon EKS clusters on Outposts -* **Feature**: Adds support for EKS Addons ResolveConflicts "preserve" flag. Also adds new update failed status for EKS Addons. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.11 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.10 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.9 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.8 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.7 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.6 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.5 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.4 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.2 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2022-05-10) - -* **Feature**: Adds BOTTLEROCKET_ARM_64_NVIDIA and BOTTLEROCKET_x86_64_NVIDIA AMI types to EKS managed nodegroups - -# v1.20.7 (2022-05-03) - -* No change notes available for this release. - -# v1.20.6 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.5 (2022-04-12) - -* No change notes available for this release. - -# v1.20.4 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.3 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2022-03-08.3) - -* No change notes available for this release. - -# v1.20.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2022-01-07) - -* **Feature**: API client updated -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.15.1 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2021-11-30) - -* **Feature**: API client updated - -# v1.14.0 (2021-11-19) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2021-11-12) - -* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. - -# v1.12.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Feature**: Updated service to latest API model. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-09-10) - -* **Feature**: API client updated - -# v1.9.0 (2021-08-27) - -* **Feature**: Updated API model to latest revision. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.2 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.1 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-07-15) - -* **Feature**: Updated service model to latest version. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-06-11) - -* **Feature**: Updated to latest API model. - -# v1.5.0 (2021-05-20) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Feature**: Updated to latest service API model. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/LICENSE.txt deleted file mode 100644 index d64569567334..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.go deleted file mode 100644 index e838452492ea..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.go +++ /dev/null @@ -1,966 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - cryptorand "crypto/rand" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - smithyrand "github.com/aws/smithy-go/rand" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "EKS" -const ServiceAPIVersion = "2017-11-01" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return fn() - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return func() {} - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - if _, ok := mp.(metrics.NopMeterProvider); ok { - // not using the metrics system - setting up the metrics context is a memory-intensive operation - // so we should skip it in this case - return parent, nil - } - - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/eks") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - if v := ctx.Value(operationMetricsKey{}); v != nil { - return v.(*operationMetrics) - } - return nil -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/eks") -} - -// Client provides the API client to make operations call for Amazon Elastic -// Kubernetes Service. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveIdempotencyTokenProvider(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/eks") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "eks", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func resolveIdempotencyTokenProvider(o *Options) { - if o.IdempotencyTokenProvider != nil { - return - } - o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/eks") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -// IdempotencyTokenProvider interface for providing idempotency token -type IdempotencyTokenProvider interface { - GetIdempotencyToken() (string, error) -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptors(stack *middleware.Stack, opts Options) error { - // middlewares are expensive, don't add all of these interceptor ones unless the caller - // actually has at least one interceptor configured - // - // at the moment it's all-or-nothing because some of the middlewares here are responsible for - // setting fields in the interceptor context for future ones - if len(opts.Interceptors.BeforeExecution) == 0 && - len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && - len(opts.Interceptors.BeforeRetryLoop) == 0 && - len(opts.Interceptors.BeforeAttempt) == 0 && - len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && - len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && - len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && - len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { - return nil - } - - return errors.Join( - stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After), - stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before), - stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After), - stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After), - stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) - stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before), - ) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.go deleted file mode 100644 index ed7a0b7e8cf0..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an access policy and its scope to an access entry. For more -// information about associating access policies, see [Associating and disassociating access policies to and from access entries]in the Amazon EKS User Guide. -// -// [Associating and disassociating access policies to and from access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html -func (c *Client) AssociateAccessPolicy(ctx context.Context, params *AssociateAccessPolicyInput, optFns ...func(*Options)) (*AssociateAccessPolicyOutput, error) { - if params == nil { - params = &AssociateAccessPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateAccessPolicy", params, optFns, c.addOperationAssociateAccessPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateAccessPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateAccessPolicyInput struct { - - // The scope for the AccessPolicy . You can scope access policies to an entire - // cluster or to specific Kubernetes namespaces. - // - // This member is required. - AccessScope *types.AccessScope - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the AccessPolicy that you're associating. For a list of ARNs, use - // ListAccessPolicies . - // - // This member is required. - PolicyArn *string - - // The Amazon Resource Name (ARN) of the IAM user or role for the AccessEntry that - // you're associating the access policy to. - // - // This member is required. - PrincipalArn *string - - noSmithyDocumentSerde -} - -type AssociateAccessPolicyOutput struct { - - // The AccessPolicy and scope associated to the AccessEntry . - AssociatedAccessPolicy *types.AssociatedAccessPolicy - - // The name of your cluster. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . - PrincipalArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateAccessPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateAccessPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateAccessPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAssociateAccessPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateAccessPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateAccessPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.go deleted file mode 100644 index 6f9dbb9bfca1..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an encryption configuration to an existing cluster. -// -// Use this API to enable encryption on existing clusters that don't already have -// encryption enabled. This allows you to implement a defense-in-depth security -// strategy without migrating applications to new Amazon EKS clusters. -func (c *Client) AssociateEncryptionConfig(ctx context.Context, params *AssociateEncryptionConfigInput, optFns ...func(*Options)) (*AssociateEncryptionConfigOutput, error) { - if params == nil { - params = &AssociateEncryptionConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateEncryptionConfig", params, optFns, c.addOperationAssociateEncryptionConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateEncryptionConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateEncryptionConfigInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The configuration you are using for encryption. - // - // This member is required. - EncryptionConfig []types.EncryptionConfig - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - noSmithyDocumentSerde -} - -type AssociateEncryptionConfigOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateEncryptionConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateEncryptionConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateEncryptionConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateEncryptionConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAssociateEncryptionConfigMiddleware(stack, options); err != nil { - return err - } - if err = addOpAssociateEncryptionConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateEncryptionConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAssociateEncryptionConfig struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAssociateEncryptionConfig) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAssociateEncryptionConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AssociateEncryptionConfigInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateEncryptionConfigInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAssociateEncryptionConfigMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateEncryptionConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAssociateEncryptionConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateEncryptionConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateIdentityProviderConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateIdentityProviderConfig.go deleted file mode 100644 index 6eafeb489018..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateIdentityProviderConfig.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates an identity provider configuration to a cluster. -// -// If you want to authenticate identities using an identity provider, you can -// create an identity provider configuration and associate it to your cluster. -// After configuring authentication to your cluster you can create Kubernetes Role -// and ClusterRole objects, assign permissions to them, and then bind them to the -// identities using Kubernetes RoleBinding and ClusterRoleBinding objects. For -// more information see [Using RBAC Authorization]in the Kubernetes documentation. -// -// [Using RBAC Authorization]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ -func (c *Client) AssociateIdentityProviderConfig(ctx context.Context, params *AssociateIdentityProviderConfigInput, optFns ...func(*Options)) (*AssociateIdentityProviderConfigOutput, error) { - if params == nil { - params = &AssociateIdentityProviderConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateIdentityProviderConfig", params, optFns, c.addOperationAssociateIdentityProviderConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateIdentityProviderConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateIdentityProviderConfigInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // An object representing an OpenID Connect (OIDC) identity provider configuration. - // - // This member is required. - Oidc *types.OidcIdentityProviderConfigRequest - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -type AssociateIdentityProviderConfigOutput struct { - - // The tags for the resource. - Tags map[string]string - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateIdentityProviderConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateIdentityProviderConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opAssociateIdentityProviderConfigMiddleware(stack, options); err != nil { - return err - } - if err = addOpAssociateIdentityProviderConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateIdentityProviderConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpAssociateIdentityProviderConfig struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpAssociateIdentityProviderConfig) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpAssociateIdentityProviderConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*AssociateIdentityProviderConfigInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateIdentityProviderConfigInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opAssociateIdentityProviderConfigMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateIdentityProviderConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opAssociateIdentityProviderConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateIdentityProviderConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.go deleted file mode 100644 index ef98808321d9..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an access entry. -// -// An access entry allows an IAM principal to access your cluster. Access entries -// can replace the need to maintain entries in the aws-auth ConfigMap for -// authentication. You have the following options for authorizing an IAM principal -// to access Kubernetes objects on your cluster: Kubernetes role-based access -// control (RBAC), Amazon EKS, or both. Kubernetes RBAC authorization requires you -// to create and manage Kubernetes Role , ClusterRole , RoleBinding , and -// ClusterRoleBinding objects, in addition to managing access entries. If you use -// Amazon EKS authorization exclusively, you don't need to create and manage -// Kubernetes Role , ClusterRole , RoleBinding , and ClusterRoleBinding objects. -// -// For more information about access entries, see [Access entries] in the Amazon EKS User Guide. -// -// [Access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html -func (c *Client) CreateAccessEntry(ctx context.Context, params *CreateAccessEntryInput, optFns ...func(*Options)) (*CreateAccessEntryOutput, error) { - if params == nil { - params = &CreateAccessEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateAccessEntry", params, optFns, c.addOperationCreateAccessEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateAccessEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateAccessEntryInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . You can specify one ARN for - // each access entry. You can't specify the same ARN in more than one access entry. - // This value can't be changed after access entry creation. - // - // The valid principals differ depending on the type of the access entry in the - // type field. For STANDARD access entries, you can use every IAM principal type. - // For nodes ( EC2 (for EKS Auto Mode), EC2_LINUX , EC2_WINDOWS , FARGATE_LINUX , - // and HYBRID_LINUX ), the only valid ARN is IAM roles. - // - // You can't use the STS session principal type with access entries because this - // is a temporary principal for each session and not a permanent identity that can - // be assigned permissions. - // - // [IAM best practices]recommend using IAM roles with temporary credentials, rather than IAM users - // with long-term credentials. - // - // [IAM best practices]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp - // - // This member is required. - PrincipalArn *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The value for name that you've specified for kind: Group as a subject in a - // Kubernetes RoleBinding or ClusterRoleBinding object. Amazon EKS doesn't confirm - // that the value for name exists in any bindings on your cluster. You can specify - // one or more names. - // - // Kubernetes authorizes the principalArn of the access entry to access any - // cluster objects that you've specified in a Kubernetes Role or ClusterRole - // object that is also specified in a binding's roleRef . For more information - // about creating Kubernetes RoleBinding , ClusterRoleBinding , Role , or - // ClusterRole objects, see [Using RBAC Authorization in the Kubernetes documentation]. - // - // If you want Amazon EKS to authorize the principalArn (instead of, or in - // addition to Kubernetes authorizing the principalArn ), you can associate one or - // more access policies to the access entry using AssociateAccessPolicy . If you - // associate any access policies, the principalARN has all permissions assigned in - // the associated access policies and all permissions in any Kubernetes Role or - // ClusterRole objects that the group names are bound to. - // - // [Using RBAC Authorization in the Kubernetes documentation]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ - KubernetesGroups []string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // The type of the new access entry. Valid values are STANDARD , FARGATE_LINUX , - // EC2_LINUX , EC2_WINDOWS , EC2 (for EKS Auto Mode), HYBRID_LINUX , and - // HYPERPOD_LINUX . - // - // If the principalArn is for an IAM role that's used for self-managed Amazon EC2 - // nodes, specify EC2_LINUX or EC2_WINDOWS . Amazon EKS grants the necessary - // permissions to the node for you. If the principalArn is for any other purpose, - // specify STANDARD . If you don't specify a value, Amazon EKS sets the value to - // STANDARD . If you have the access mode of the cluster set to API_AND_CONFIG_MAP - // , it's unnecessary to create access entries for IAM roles used with Fargate - // profiles or managed Amazon EC2 nodes, because Amazon EKS creates entries in the - // aws-auth ConfigMap for the roles. You can't change this value once you've - // created the access entry. - // - // If you set the value to EC2_LINUX or EC2_WINDOWS , you can't specify values for - // kubernetesGroups , or associate an AccessPolicy to the access entry. - Type *string - - // The username to authenticate to Kubernetes with. We recommend not specifying a - // username and letting Amazon EKS specify it for you. For more information about - // the value Amazon EKS specifies for you, or constraints before specifying your - // own username, see [Creating access entries]in the Amazon EKS User Guide. - // - // [Creating access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html#creating-access-entries - Username *string - - noSmithyDocumentSerde -} - -type CreateAccessEntryOutput struct { - - // An access entry allows an IAM principal (user or role) to access your cluster. - // Access entries can replace the need to maintain the aws-auth ConfigMap for - // authentication. For more information about access entries, see [Access entries]in the Amazon - // EKS User Guide. - // - // [Access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html - AccessEntry *types.AccessEntry - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateAccessEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAccessEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAccessEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAccessEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateAccessEntryMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateAccessEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateAccessEntry struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateAccessEntry) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAccessEntryInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateAccessEntryMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAccessEntry{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateAccessEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateAccessEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.go deleted file mode 100644 index ee1a0db75702..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon EKS add-on. -// -// Amazon EKS add-ons help to automate the provisioning and lifecycle management -// of common operational software for Amazon EKS clusters. For more information, -// see [Amazon EKS add-ons]in the Amazon EKS User Guide. -// -// [Amazon EKS add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html -func (c *Client) CreateAddon(ctx context.Context, params *CreateAddonInput, optFns ...func(*Options)) (*CreateAddonOutput, error) { - if params == nil { - params = &CreateAddonInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateAddon", params, optFns, c.addOperationCreateAddonMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateAddonOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateAddonInput struct { - - // The name of the add-on. The name must match one of the names returned by - // DescribeAddonVersions . - // - // This member is required. - AddonName *string - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The version of the add-on. The version must match one of the versions returned - // by [DescribeAddonVersions]DescribeAddonVersions . - // - // [DescribeAddonVersions]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html - AddonVersion *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The set of configuration values for the add-on that's created. The values that - // you provide are validated against the schema returned by - // DescribeAddonConfiguration . - ConfigurationValues *string - - // The namespace configuration for the addon. If specified, this will override the - // default namespace for the addon. - NamespaceConfig *types.AddonNamespaceConfigRequest - - // An array of EKS Pod Identity associations to be created. Each association maps - // a Kubernetes service account to an IAM role. - // - // For more information, see [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity] in the Amazon EKS User Guide. - // - // [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html - PodIdentityAssociations []types.AddonPodIdentityAssociations - - // How to resolve field value conflicts for an Amazon EKS add-on. Conflicts are - // handled based on the value you choose: - // - // - None – If the self-managed version of the add-on is installed on your - // cluster, Amazon EKS doesn't change the value. Creation of the add-on might fail. - // - // - Overwrite – If the self-managed version of the add-on is installed on your - // cluster and the Amazon EKS default value is different than the existing value, - // Amazon EKS changes the value to the Amazon EKS default value. - // - // - Preserve – This is similar to the NONE option. If the self-managed version - // of the add-on is installed on your cluster Amazon EKS doesn't change the add-on - // resource properties. Creation of the add-on might fail if conflicts are - // detected. This option works differently during the update operation. For more - // information, see [UpdateAddon]UpdateAddon . - // - // If you don't currently have the self-managed version of the add-on installed on - // your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to - // default values, regardless of the option that you specify. - // - // [UpdateAddon]: https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html - ResolveConflicts types.ResolveConflicts - - // The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's - // service account. The role must be assigned the IAM permissions required by the - // add-on. If you don't specify an existing IAM role, then the add-on uses the - // permissions assigned to the node IAM role. For more information, see [Amazon EKS node IAM role]in the - // Amazon EKS User Guide. - // - // To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) - // provider created for your cluster. For more information, see [Enabling IAM roles for service accounts on your cluster]in the Amazon EKS - // User Guide. - // - // [Enabling IAM roles for service accounts on your cluster]: https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html - // [Amazon EKS node IAM role]: https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html - ServiceAccountRoleArn *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -type CreateAddonOutput struct { - - // An Amazon EKS add-on. For more information, see [Amazon EKS add-ons] in the Amazon EKS User Guide. - // - // [Amazon EKS add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html - Addon *types.Addon - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateAddonMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAddon{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAddon{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAddon"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateAddonMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateAddonValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAddon(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateAddon struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateAddon) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateAddonInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAddonInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateAddonMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAddon{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateAddon(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateAddon", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCapability.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCapability.go deleted file mode 100644 index b43efd4bcdd9..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCapability.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a managed capability resource for an Amazon EKS cluster. -// -// Capabilities provide fully managed capabilities to build and scale with -// Kubernetes. When you create a capability, Amazon EKSprovisions and manages the -// infrastructure required to run the capability outside of your cluster. This -// approach reduces operational overhead and preserves cluster resources. -// -// You can only create one Capability of each type on a given Amazon EKS cluster. -// Valid types are Argo CD for declarative GitOps deployment, Amazon Web Services -// Controllers for Kubernetes (ACK) for resource management, and Kube Resource -// Orchestrator (KRO) for Kubernetes custom resource orchestration. -// -// For more information, see [EKS Capabilities] in the Amazon EKS User Guide. -// -// [EKS Capabilities]: https://docs.aws.amazon.com/eks/latest/userguide/capabilities.html -func (c *Client) CreateCapability(ctx context.Context, params *CreateCapabilityInput, optFns ...func(*Options)) (*CreateCapabilityOutput, error) { - if params == nil { - params = &CreateCapabilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCapability", params, optFns, c.addOperationCreateCapabilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCapabilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCapabilityInput struct { - - // A unique name for the capability. The name must be unique within your cluster - // and can contain alphanumeric characters, hyphens, and underscores. - // - // This member is required. - CapabilityName *string - - // The name of the Amazon EKS cluster where you want to create the capability. - // - // This member is required. - ClusterName *string - - // Specifies how Kubernetes resources managed by the capability should be handled - // when the capability is deleted. Currently, the only supported value is RETAIN - // which retains all Kubernetes resources managed by the capability when the - // capability is deleted. - // - // Because resources are retained, all Kubernetes resources created by the - // capability should be deleted from the cluster before deleting the capability - // itself. After the capability is deleted, these resources become difficult to - // manage because the controller is no longer available. - // - // This member is required. - DeletePropagationPolicy types.CapabilityDeletePropagationPolicy - - // The Amazon Resource Name (ARN) of the IAM role that the capability uses to - // interact with Amazon Web Services services. This role must have a trust policy - // that allows the EKS service principal to assume it, and it must have the - // necessary permissions for the capability type you're creating. - // - // For ACK capabilities, the role needs permissions to manage the resources you - // want to control through Kubernetes. For Argo CD capabilities, the role needs - // permissions to access Git repositories and Secrets Manager. For KRO - // capabilities, the role needs permissions based on the resources you'll be - // orchestrating. - // - // This member is required. - RoleArn *string - - // The type of capability to create. Valid values are: - // - // - ACK – Amazon Web Services Controllers for Kubernetes (ACK), which lets you - // manage resources directly from Kubernetes. - // - // - ARGOCD – Argo CD for GitOps-based continuous delivery. - // - // - KRO – Kube Resource Orchestrator (KRO) for composing and managing custom - // Kubernetes resources. - // - // This member is required. - Type types.CapabilityType - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. This token is valid for 24 hours after creation. If you retry a - // request with the same client request token and the same parameters after the - // original request has completed successfully, the result of the original request - // is returned. - ClientRequestToken *string - - // The configuration settings for the capability. The structure of this object - // varies depending on the capability type. For Argo CD capabilities, you can - // configure IAM Identity CenterIAM; Identity Center integration, RBAC role - // mappings, and network access settings. - Configuration *types.CapabilityConfigurationRequest - - // The metadata that you apply to a resource to help you categorize and organize - // them. Each tag consists of a key and an optional value. You define them. - // - // The following basic restrictions apply to tags: - // - // - Maximum number of tags per resource – 50 - // - // - For each resource, each tag key must be unique, and each tag key can have - // only one value. - // - // - Maximum key length – 128 Unicode characters in UTF-8 - // - // - Maximum value length – 256 Unicode characters in UTF-8 - // - // - If your tagging schema is used across multiple services and resources, - // remember that other services may have restrictions on allowed characters. - // Generally allowed characters are: letters, numbers, and spaces representable in - // UTF-8, and the following characters: + - = . _ : / @. - // - // - Tag keys and values are case-sensitive. - // - // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a - // prefix for either keys or values as it is reserved for Amazon Web Services use. - // You cannot edit or delete tag keys or values with this prefix. Tags with this - // prefix do not count against your tags per resource limit. - Tags map[string]string - - noSmithyDocumentSerde -} - -type CreateCapabilityOutput struct { - - // An object containing information about the newly created capability, including - // its name, ARN, status, and configuration. - Capability *types.Capability - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCapabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCapability{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCapability{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCapability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateCapabilityMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateCapabilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCapability(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateCapability struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateCapability) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCapabilityInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateCapabilityMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCapability{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateCapability(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCapability", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.go deleted file mode 100644 index fb5774dbb1c9..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.go +++ /dev/null @@ -1,358 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon EKS control plane. -// -// The Amazon EKS control plane consists of control plane instances that run the -// Kubernetes software, such as etcd and the API server. The control plane runs in -// an account managed by Amazon Web Services, and the Kubernetes API is exposed by -// the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is -// single tenant and unique. It runs on its own set of Amazon EC2 instances. -// -// The cluster control plane is provisioned across multiple Availability Zones and -// fronted by an ELB Network Load Balancer. Amazon EKS also provisions elastic -// network interfaces in your VPC subnets to provide connectivity from the control -// plane instances to the nodes (for example, to support kubectl exec , logs , and -// proxy data flows). -// -// Amazon EKS nodes run in your Amazon Web Services account and connect to your -// cluster's control plane over the Kubernetes API server endpoint and a -// certificate file that is created for your cluster. -// -// You can use the endpointPublicAccess and endpointPrivateAccess parameters to -// enable or disable public and private access to your cluster's Kubernetes API -// server endpoint. By default, public access is enabled, and private access is -// disabled. The endpoint domain name and IP address family depends on the value of -// the ipFamily for the cluster. For more information, see [Amazon EKS Cluster Endpoint Access Control] in the Amazon EKS User -// Guide . -// -// You can use the logging parameter to enable or disable exporting the Kubernetes -// control plane logs for your cluster to CloudWatch Logs. By default, cluster -// control plane logs aren't exported to CloudWatch Logs. For more information, see -// [Amazon EKS Cluster Control Plane Logs]in the Amazon EKS User Guide . -// -// CloudWatch Logs ingestion, archive storage, and data scanning rates apply to -// exported control plane logs. For more information, see [CloudWatch Pricing]. -// -// In most cases, it takes several minutes to create a cluster. After you create -// an Amazon EKS cluster, you must configure your Kubernetes tooling to communicate -// with the API server and launch nodes into your cluster. For more information, -// see [Allowing users to access your cluster]and [Launching Amazon EKS nodes] in the Amazon EKS User Guide. -// -// [Allowing users to access your cluster]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-auth.html -// [CloudWatch Pricing]: http://aws.amazon.com/cloudwatch/pricing/ -// [Amazon EKS Cluster Control Plane Logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html -// [Amazon EKS Cluster Endpoint Access Control]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html -// [Launching Amazon EKS nodes]: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html -func (c *Client) CreateCluster(ctx context.Context, params *CreateClusterInput, optFns ...func(*Options)) (*CreateClusterOutput, error) { - if params == nil { - params = &CreateClusterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCluster", params, optFns, c.addOperationCreateClusterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateClusterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateClusterInput struct { - - // The unique name to give to your cluster. The name can contain only alphanumeric - // characters (case-sensitive), hyphens, and underscores. It must start with an - // alphanumeric character and can't be longer than 100 characters. The name must be - // unique within the Amazon Web Services Region and Amazon Web Services account - // that you're creating the cluster in. - // - // This member is required. - Name *string - - // The VPC configuration that's used by the cluster control plane. Amazon EKS VPC - // resources have specific requirements to work properly with Kubernetes. For more - // information, see [Cluster VPC Considerations]and [Cluster Security Group Considerations] in the Amazon EKS User Guide. You must specify at least - // two subnets. You can specify up to five security groups. However, we recommend - // that you use a dedicated security group for your cluster control plane. - // - // [Cluster Security Group Considerations]: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html - // [Cluster VPC Considerations]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html - // - // This member is required. - ResourcesVpcConfig *types.VpcConfigRequest - - // The Amazon Resource Name (ARN) of the IAM role that provides permissions for - // the Kubernetes control plane to make calls to Amazon Web Services API operations - // on your behalf. For more information, see [Amazon EKS Service IAM Role]in the Amazon EKS User Guide . - // - // [Amazon EKS Service IAM Role]: https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html - // - // This member is required. - RoleArn *string - - // The access configuration for the cluster. - AccessConfig *types.CreateAccessConfigRequest - - // If you set this value to False when creating a cluster, the default networking - // add-ons will not be installed. - // - // The default networking add-ons include vpc-cni , coredns , and kube-proxy . - // - // Use this option when you plan to install third-party alternative add-ons or - // self-manage the default networking add-ons. - BootstrapSelfManagedAddons *bool - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Enable or disable the compute capability of EKS Auto Mode when creating your - // EKS Auto Mode cluster. If the compute capability is enabled, EKS Auto Mode will - // create and delete EC2 Managed Instances in your Amazon Web Services account - ComputeConfig *types.ComputeConfigRequest - - // The control plane scaling tier configuration. For more information, see EKS - // Provisioned Control Plane in the Amazon EKS User Guide. - ControlPlaneScalingConfig *types.ControlPlaneScalingConfig - - // Indicates whether to enable deletion protection for the cluster. When enabled, - // the cluster cannot be deleted unless deletion protection is first disabled. This - // helps prevent accidental cluster deletion. Default value is false . - DeletionProtection *bool - - // The encryption configuration for the cluster. - EncryptionConfig []types.EncryptionConfig - - // The Kubernetes network configuration for the cluster. - KubernetesNetworkConfig *types.KubernetesNetworkConfigRequest - - // Enable or disable exporting the Kubernetes control plane logs for your cluster - // to CloudWatch Logs . By default, cluster control plane logs aren't exported to - // CloudWatch Logs . For more information, see [Amazon EKS Cluster control plane logs]in the Amazon EKS User Guide . - // - // CloudWatch Logs ingestion, archive storage, and data scanning rates apply to - // exported control plane logs. For more information, see [CloudWatch Pricing]. - // - // [Amazon EKS Cluster control plane logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html - // [CloudWatch Pricing]: http://aws.amazon.com/cloudwatch/pricing/ - Logging *types.Logging - - // An object representing the configuration of your local Amazon EKS cluster on an - // Amazon Web Services Outpost. Before creating a local cluster on an Outpost, - // review [Local clusters for Amazon EKS on Amazon Web Services Outposts]in the Amazon EKS User Guide. This object isn't available for creating - // Amazon EKS clusters on the Amazon Web Services cloud. - // - // [Local clusters for Amazon EKS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-local-cluster-overview.html - OutpostConfig *types.OutpostConfigRequest - - // The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or - // remove this configuration after the cluster is created. - RemoteNetworkConfig *types.RemoteNetworkConfigRequest - - // Enable or disable the block storage capability of EKS Auto Mode when creating - // your EKS Auto Mode cluster. If the block storage capability is enabled, EKS Auto - // Mode will create and delete EBS volumes in your Amazon Web Services account. - StorageConfig *types.StorageConfigRequest - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // New clusters, by default, have extended support enabled. You can disable - // extended support when creating a cluster by setting this value to STANDARD . - UpgradePolicy *types.UpgradePolicyRequest - - // The desired Kubernetes version for your cluster. If you don't specify a value - // here, the default version available in Amazon EKS is used. - // - // The default version might not be the latest version available. - Version *string - - // Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, - // Amazon Web Services configures zonal autoshift for the cluster. - // - // Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC - // zonal shift is designed to be a temporary measure that allows you to move - // traffic for a resource away from an impaired AZ until the zonal shift expires or - // you cancel it. You can extend the zonal shift if necessary. - // - // You can start a zonal shift for an Amazon EKS cluster, or you can allow Amazon - // Web Services to do it for you by enabling zonal autoshift. This shift updates - // the flow of east-to-west network traffic in your cluster to only consider - // network endpoints for Pods running on worker nodes in healthy AZs. Additionally, - // any ALB or NLB handling ingress traffic for applications in your Amazon EKS - // cluster will automatically route traffic to targets in the healthy AZs. For more - // information about zonal shift in EKS, see [Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS]in the Amazon EKS User Guide . - // - // [Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS]: https://docs.aws.amazon.com/eks/latest/userguide/zone-shift.html - ZonalShiftConfig *types.ZonalShiftConfigRequest - - noSmithyDocumentSerde -} - -type CreateClusterOutput struct { - - // The full description of your new cluster. - Cluster *types.Cluster - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCluster{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCluster{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCluster"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateClusterMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateClusterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCluster(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateCluster struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateCluster) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateClusterInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateClusterInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateClusterMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCluster{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateCluster(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCluster", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateEksAnywhereSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateEksAnywhereSubscription.go deleted file mode 100644 index feb52ba3f0bd..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateEksAnywhereSubscription.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an EKS Anywhere subscription. When a subscription is created, it is a -// contract agreement for the length of the term specified in the request. Licenses -// that are used to validate support are provisioned in Amazon Web Services License -// Manager and the caller account is granted access to EKS Anywhere Curated -// Packages. -func (c *Client) CreateEksAnywhereSubscription(ctx context.Context, params *CreateEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*CreateEksAnywhereSubscriptionOutput, error) { - if params == nil { - params = &CreateEksAnywhereSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateEksAnywhereSubscription", params, optFns, c.addOperationCreateEksAnywhereSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateEksAnywhereSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateEksAnywhereSubscriptionInput struct { - - // The unique name for your subscription. It must be unique in your Amazon Web - // Services account in the Amazon Web Services Region you're creating the - // subscription in. The name can contain only alphanumeric characters - // (case-sensitive), hyphens, and underscores. It must start with an alphabetic - // character and can't be longer than 100 characters. - // - // This member is required. - Name *string - - // An object representing the term duration and term unit type of your - // subscription. This determines the term length of your subscription. Valid values - // are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month - // or 36 month subscription. This value cannot be changed after creating the - // subscription. - // - // This member is required. - Term *types.EksAnywhereSubscriptionTerm - - // A boolean indicating whether the subscription auto renews at the end of the - // term. - AutoRenew bool - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The number of licenses to purchase with the subscription. Valid values are - // between 1 and 100. This value can't be changed after creating the subscription. - LicenseQuantity int32 - - // The license type for all licenses in the subscription. Valid value is CLUSTER. - // With the CLUSTER license type, each license covers support for a single EKS - // Anywhere cluster. - LicenseType types.EksAnywhereSubscriptionLicenseType - - // The metadata for a subscription to assist with categorization and organization. - // Each tag consists of a key and an optional value. Subscription tags don't - // propagate to any other resources associated with the subscription. - Tags map[string]string - - noSmithyDocumentSerde -} - -type CreateEksAnywhereSubscriptionOutput struct { - - // The full description of the subscription. - Subscription *types.EksAnywhereSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEksAnywhereSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateEksAnywhereSubscriptionMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEksAnywhereSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateEksAnywhereSubscription struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateEksAnywhereSubscription) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateEksAnywhereSubscriptionInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateEksAnywhereSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateEksAnywhereSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateEksAnywhereSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.go deleted file mode 100644 index 4d58792c1743..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Fargate profile for your Amazon EKS cluster. You must have at least -// one Fargate profile in a cluster to be able to run pods on Fargate. -// -// The Fargate profile allows an administrator to declare which pods run on -// Fargate and specify which pods run on which Fargate profile. This declaration is -// done through the profile's selectors. Each profile can have up to five selectors -// that contain a namespace and labels. A namespace is required for every selector. -// The label field consists of multiple optional key-value pairs. Pods that match -// the selectors are scheduled on Fargate. If a to-be-scheduled pod matches any of -// the selectors in the Fargate profile, then that pod is run on Fargate. -// -// When you create a Fargate profile, you must specify a pod execution role to use -// with the pods that are scheduled with the profile. This role is added to the -// cluster's Kubernetes [Role Based Access Control](RBAC) for authorization so that the kubelet that is -// running on the Fargate infrastructure can register with your Amazon EKS cluster -// so that it can appear in your cluster as a node. The pod execution role also -// provides IAM permissions to the Fargate infrastructure to allow read access to -// Amazon ECR image repositories. For more information, see [Pod Execution Role]in the Amazon EKS User -// Guide. -// -// Fargate profiles are immutable. However, you can create a new updated profile -// to replace an existing profile and then delete the original after the updated -// profile has finished creating. -// -// If any Fargate profiles in a cluster are in the DELETING status, you must wait -// for that Fargate profile to finish deleting before you can create any other -// profiles in that cluster. -// -// For more information, see [Fargate profile] in the Amazon EKS User Guide. -// -// [Role Based Access Control]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ -// [Fargate profile]: https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html -// [Pod Execution Role]: https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html -func (c *Client) CreateFargateProfile(ctx context.Context, params *CreateFargateProfileInput, optFns ...func(*Options)) (*CreateFargateProfileOutput, error) { - if params == nil { - params = &CreateFargateProfileInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateFargateProfile", params, optFns, c.addOperationCreateFargateProfileMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateFargateProfileOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateFargateProfileInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the Fargate profile. - // - // This member is required. - FargateProfileName *string - - // The Amazon Resource Name (ARN) of the Pod execution role to use for a Pod that - // matches the selectors in the Fargate profile. The Pod execution role allows - // Fargate infrastructure to register with your cluster as a node, and it provides - // read access to Amazon ECR image repositories. For more information, see [Pod execution role]Pod in - // the Amazon EKS User Guide. - // - // [Pod execution role]: https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html - // - // This member is required. - PodExecutionRoleArn *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The selectors to match for a Pod to use this Fargate profile. Each selector - // must have an associated Kubernetes namespace . Optionally, you can also specify - // labels for a namespace . You may specify up to five selectors in a Fargate - // profile. - Selectors []types.FargateProfileSelector - - // The IDs of subnets to launch a Pod into. A Pod running on Fargate isn't - // assigned a public IP address, so only private subnets (with no direct route to - // an Internet Gateway) are accepted for this parameter. - Subnets []string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -type CreateFargateProfileOutput struct { - - // The full description of your new Fargate profile. - FargateProfile *types.FargateProfile - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateFargateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFargateProfile{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFargateProfile{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateFargateProfile"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateFargateProfileMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateFargateProfileValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFargateProfile(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateFargateProfile struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateFargateProfile) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateFargateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateFargateProfileInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFargateProfileInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateFargateProfileMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFargateProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateFargateProfile(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateFargateProfile", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.go deleted file mode 100644 index e8624a232da3..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.go +++ /dev/null @@ -1,360 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a managed node group for an Amazon EKS cluster. -// -// You can only create a node group for your cluster that is equal to the current -// Kubernetes version for the cluster. All node groups are created with the latest -// AMI release version for the respective minor Kubernetes version of the cluster, -// unless you deploy a custom AMI using a launch template. -// -// For later updates, you will only be able to update a node group using a launch -// template only if it was originally deployed with a launch template. -// Additionally, the launch template ID or name must match what was used when the -// node group was created. You can update the launch template version with -// necessary changes. For more information about using launch templates, see [Customizing managed nodes with launch templates]. -// -// An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and -// associated Amazon EC2 instances that are managed by Amazon Web Services for an -// Amazon EKS cluster. For more information, see [Managed node groups]in the Amazon EKS User Guide. -// -// Windows AMI types are only supported for commercial Amazon Web Services Regions -// that support Windows on Amazon EKS. -// -// [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html -// [Managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html -func (c *Client) CreateNodegroup(ctx context.Context, params *CreateNodegroupInput, optFns ...func(*Options)) (*CreateNodegroupOutput, error) { - if params == nil { - params = &CreateNodegroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateNodegroup", params, optFns, c.addOperationCreateNodegroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateNodegroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateNodegroupInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The Amazon Resource Name (ARN) of the IAM role to associate with your node - // group. The Amazon EKS worker node kubelet daemon makes calls to Amazon Web - // Services APIs on your behalf. Nodes receive permissions for these API calls - // through an IAM instance profile and associated policies. Before you can launch - // nodes and register them into a cluster, you must create an IAM role for those - // nodes to use when they are launched. For more information, see [Amazon EKS node IAM role]in the Amazon - // EKS User Guide . If you specify launchTemplate , then don't specify [IamInstanceProfile] in your - // launch template, or the node group deployment will fail. For more information - // about using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - // [IamInstanceProfile]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html - // [Amazon EKS node IAM role]: https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html - // - // This member is required. - NodeRole *string - - // The unique name to give your node group. - // - // This member is required. - NodegroupName *string - - // The subnets to use for the Auto Scaling group that is created for your node - // group. If you specify launchTemplate , then don't specify [SubnetId] in your launch - // template, or the node group deployment will fail. For more information about - // using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - // [SubnetId]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html - // - // This member is required. - Subnets []string - - // The AMI type for your node group. If you specify launchTemplate , and your - // launch template uses a custom AMI, then don't specify amiType , or the node - // group deployment will fail. If your launch template uses a Windows custom AMI, - // then add eks:kube-proxy-windows to your Windows nodes rolearn in the aws-auth - // ConfigMap . For more information about using launch templates with Amazon EKS, - // see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - AmiType types.AMITypes - - // The capacity type for your node group. - CapacityType types.CapacityTypes - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The root device disk size (in GiB) for your node group instances. The default - // disk size is 20 GiB for Linux and Bottlerocket. The default disk size is 50 GiB - // for Windows. If you specify launchTemplate , then don't specify diskSize , or - // the node group deployment will fail. For more information about using launch - // templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - DiskSize *int32 - - // Specify the instance types for a node group. If you specify a GPU instance - // type, make sure to also specify an applicable GPU AMI type with the amiType - // parameter. If you specify launchTemplate , then you can specify zero or one - // instance type in your launch template or you can specify 0-20 instance types for - // instanceTypes . If however, you specify an instance type in your launch template - // and specify any instanceTypes , the node group deployment will fail. If you - // don't specify an instance type in a launch template or for instanceTypes , then - // t3.medium is used, by default. If you specify Spot for capacityType , then we - // recommend specifying multiple values for instanceTypes . For more information, - // see [Managed node group capacity types]and [Customizing managed nodes with launch templates] in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - // [Managed node group capacity types]: https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html#managed-node-group-capacity-types - InstanceTypes []string - - // The Kubernetes labels to apply to the nodes in the node group when they are - // created. - Labels map[string]string - - // An object representing a node group's launch template specification. When using - // this object, don't directly specify instanceTypes , diskSize , or remoteAccess . - // You cannot later specify a different launch template ID or name than what was - // used to create the node group. - // - // Make sure that the launch template meets the requirements in - // launchTemplateSpecification . Also refer to [Customizing managed nodes with launch templates] in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - LaunchTemplate *types.LaunchTemplateSpecification - - // The node auto repair configuration for the node group. - NodeRepairConfig *types.NodeRepairConfig - - // The AMI version of the Amazon EKS optimized AMI to use with your node group. By - // default, the latest available AMI version for the node group's current - // Kubernetes version is used. For information about Linux versions, see [Amazon EKS optimized Amazon Linux AMI versions]in the - // Amazon EKS User Guide. Amazon EKS managed node groups support the November 2022 - // and later releases of the Windows AMIs. For information about Windows versions, - // see [Amazon EKS optimized Windows AMI versions]in the Amazon EKS User Guide. - // - // If you specify launchTemplate , and your launch template uses a custom AMI, then - // don't specify releaseVersion , or the node group deployment will fail. For more - // information about using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS - // User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - // [Amazon EKS optimized Amazon Linux AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html - // [Amazon EKS optimized Windows AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html - ReleaseVersion *string - - // The remote access configuration to use with your node group. For Linux, the - // protocol is SSH. For Windows, the protocol is RDP. If you specify launchTemplate - // , then don't specify remoteAccess , or the node group deployment will fail. For - // more information about using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the - // Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - RemoteAccess *types.RemoteAccessConfig - - // The scaling configuration details for the Auto Scaling group that is created - // for your node group. - ScalingConfig *types.NodegroupScalingConfig - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // The Kubernetes taints to be applied to the nodes in the node group. For more - // information, see [Node taints on managed node groups]. - // - // [Node taints on managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/node-taints-managed-node-groups.html - Taints []types.Taint - - // The node group update configuration. - UpdateConfig *types.NodegroupUpdateConfig - - // The Kubernetes version to use for your managed nodes. By default, the - // Kubernetes version of the cluster is used, and this is the only accepted - // specified value. If you specify launchTemplate , and your launch template uses a - // custom AMI, then don't specify version , or the node group deployment will fail. - // For more information about using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the - // Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - Version *string - - noSmithyDocumentSerde -} - -type CreateNodegroupOutput struct { - - // The full description of your new node group. - Nodegroup *types.Nodegroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateNodegroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateNodegroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateNodegroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNodegroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreateNodegroupMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateNodegroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNodegroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreateNodegroup struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateNodegroup) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateNodegroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateNodegroupInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateNodegroupInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateNodegroupMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateNodegroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateNodegroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateNodegroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreatePodIdentityAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreatePodIdentityAssociation.go deleted file mode 100644 index 417bff0bc4a4..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreatePodIdentityAssociation.go +++ /dev/null @@ -1,315 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an EKS Pod Identity association between a service account in an Amazon -// EKS cluster and an IAM role with EKS Pod Identity. Use EKS Pod Identity to give -// temporary IAM credentials to Pods and the credentials are rotated automatically. -// -// Amazon EKS Pod Identity associations provide the ability to manage credentials -// for your applications, similar to the way that Amazon EC2 instance profiles -// provide credentials to Amazon EC2 instances. -// -// If a Pod uses a service account that has an association, Amazon EKS sets -// environment variables in the containers of the Pod. The environment variables -// configure the Amazon Web Services SDKs, including the Command Line Interface, to -// use the EKS Pod Identity credentials. -// -// EKS Pod Identity is a simpler method than IAM roles for service accounts, as -// this method doesn't use OIDC identity providers. Additionally, you can configure -// a role for EKS Pod Identity once, and reuse it across clusters. -// -// Similar to Amazon Web Services IAM behavior, EKS Pod Identity associations are -// eventually consistent, and may take several seconds to be effective after the -// initial API call returns successfully. You must design your applications to -// account for these potential delays. We recommend that you don’t include -// association create/updates in the critical, high-availability code paths of your -// application. Instead, make changes in a separate initialization or setup routine -// that you run less frequently. -// -// You can set a target IAM role in the same or a different account for advanced -// scenarios. With a target role, EKS Pod Identity automatically performs two role -// assumptions in sequence: first assuming the role in the association that is in -// this account, then using those credentials to assume the target IAM role. This -// process provides your Pod with temporary credentials that have the permissions -// defined in the target role, allowing secure access to resources in another -// Amazon Web Services account. -func (c *Client) CreatePodIdentityAssociation(ctx context.Context, params *CreatePodIdentityAssociationInput, optFns ...func(*Options)) (*CreatePodIdentityAssociationOutput, error) { - if params == nil { - params = &CreatePodIdentityAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreatePodIdentityAssociation", params, optFns, c.addOperationCreatePodIdentityAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreatePodIdentityAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreatePodIdentityAssociationInput struct { - - // The name of the cluster to create the EKS Pod Identity association in. - // - // This member is required. - ClusterName *string - - // The name of the Kubernetes namespace inside the cluster to create the EKS Pod - // Identity association in. The service account and the Pods that use the service - // account must be in this namespace. - // - // This member is required. - Namespace *string - - // The Amazon Resource Name (ARN) of the IAM role to associate with the service - // account. The EKS Pod Identity agent manages credentials to assume this role for - // applications in the containers in the Pods that use this service account. - // - // This member is required. - RoleArn *string - - // The name of the Kubernetes service account inside the cluster to associate the - // IAM credentials with. - // - // This member is required. - ServiceAccount *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Disable the automatic sessions tags that are appended by EKS Pod Identity. - // - // EKS Pod Identity adds a pre-defined set of session tags when it assumes the - // role. You can use these tags to author a single role that can work across - // resources by allowing access to Amazon Web Services resources based on matching - // tags. By default, EKS Pod Identity attaches six tags, including tags for cluster - // name, namespace, and service account name. For the list of tags added by EKS Pod - // Identity, see [List of session tags added by EKS Pod Identity]in the Amazon EKS User Guide. - // - // Amazon Web Services compresses inline session policies, managed policy ARNs, - // and session tags into a packed binary format that has a separate limit. If you - // receive a PackedPolicyTooLarge error indicating the packed binary format has - // exceeded the size limit, you can attempt to reduce the size by disabling the - // session tags added by EKS Pod Identity. - // - // [List of session tags added by EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/pod-id-abac.html#pod-id-abac-tags - DisableSessionTags *bool - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - // - // The following basic restrictions apply to tags: - // - // - Maximum number of tags per resource – 50 - // - // - For each resource, each tag key must be unique, and each tag key can have - // only one value. - // - // - Maximum key length – 128 Unicode characters in UTF-8 - // - // - Maximum value length – 256 Unicode characters in UTF-8 - // - // - If your tagging schema is used across multiple services and resources, - // remember that other services may have restrictions on allowed characters. - // Generally allowed characters are: letters, numbers, and spaces representable in - // UTF-8, and the following characters: + - = . _ : / @. - // - // - Tag keys and values are case-sensitive. - // - // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a - // prefix for either keys or values as it is reserved for Amazon Web Services use. - // You cannot edit or delete tag keys or values with this prefix. Tags with this - // prefix do not count against your tags per resource limit. - Tags map[string]string - - // The Amazon Resource Name (ARN) of the target IAM role to associate with the - // service account. This role is assumed by using the EKS Pod Identity association - // role, then the credentials for this role are injected into the Pod. - // - // When you run applications on Amazon EKS, your application might need to access - // Amazon Web Services resources from a different role that exists in the same or - // different Amazon Web Services account. For example, your application running in - // “Account A” might need to access resources, such as Amazon S3 buckets in - // “Account B” or within “Account A” itself. You can create a association to access - // Amazon Web Services resources in “Account B” by creating two IAM roles: a role - // in “Account A” and a role in “Account B” (which can be the same or different - // account), each with the necessary trust and permission policies. After you - // provide these roles in the IAM role and Target IAM role fields, EKS will perform - // role chaining to ensure your application gets the required permissions. This - // means Role A will assume Role B, allowing your Pods to securely access resources - // like S3 buckets in the target account. - TargetRoleArn *string - - noSmithyDocumentSerde -} - -type CreatePodIdentityAssociationOutput struct { - - // The full description of your new association. - // - // The description includes an ID for the association. Use the ID of the - // association in further actions to manage the association. - Association *types.PodIdentityAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreatePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePodIdentityAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opCreatePodIdentityAssociationMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreatePodIdentityAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePodIdentityAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpCreatePodIdentityAssociation struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreatePodIdentityAssociation) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreatePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePodIdentityAssociationInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreatePodIdentityAssociationMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePodIdentityAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreatePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreatePodIdentityAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.go deleted file mode 100644 index 8e89981a0223..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an access entry. -// -// Deleting an access entry of a type other than Standard can cause your cluster -// to function improperly. If you delete an access entry in error, you can recreate -// it. -func (c *Client) DeleteAccessEntry(ctx context.Context, params *DeleteAccessEntryInput, optFns ...func(*Options)) (*DeleteAccessEntryOutput, error) { - if params == nil { - params = &DeleteAccessEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteAccessEntry", params, optFns, c.addOperationDeleteAccessEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteAccessEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteAccessEntryInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . - // - // This member is required. - PrincipalArn *string - - noSmithyDocumentSerde -} - -type DeleteAccessEntryOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteAccessEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccessEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccessEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAccessEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteAccessEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteAccessEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteAccessEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.go deleted file mode 100644 index 30157d0d1e00..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an Amazon EKS add-on. -// -// When you remove an add-on, it's deleted from the cluster. You can always -// manually start an add-on on the cluster using the Kubernetes API. -func (c *Client) DeleteAddon(ctx context.Context, params *DeleteAddonInput, optFns ...func(*Options)) (*DeleteAddonOutput, error) { - if params == nil { - params = &DeleteAddonInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteAddon", params, optFns, c.addOperationDeleteAddonMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteAddonOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteAddonInput struct { - - // The name of the add-on. The name must match one of the names returned by [ListAddons] - // ListAddons . - // - // [ListAddons]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html - // - // This member is required. - AddonName *string - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // Specifying this option preserves the add-on software on your cluster but Amazon - // EKS stops managing any settings for the add-on. If an IAM account is associated - // with the add-on, it isn't removed. - Preserve bool - - noSmithyDocumentSerde -} - -type DeleteAddonOutput struct { - - // An Amazon EKS add-on. For more information, see [Amazon EKS add-ons] in the Amazon EKS User Guide. - // - // [Amazon EKS add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html - Addon *types.Addon - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteAddonMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAddon{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAddon{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAddon"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteAddonValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAddon(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteAddon(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteAddon", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCapability.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCapability.go deleted file mode 100644 index e8fbffb16d13..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCapability.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a managed capability from your Amazon EKS cluster. When you delete a -// capability, Amazon EKS removes the capability infrastructure but retains all -// resources that were managed by the capability. -// -// Before deleting a capability, you should delete all Kubernetes resources that -// were created by the capability. After the capability is deleted, these resources -// become difficult to manage because the controller that managed them is no longer -// available. To delete resources before removing the capability, use kubectl -// delete or remove them through your GitOps workflow. -func (c *Client) DeleteCapability(ctx context.Context, params *DeleteCapabilityInput, optFns ...func(*Options)) (*DeleteCapabilityOutput, error) { - if params == nil { - params = &DeleteCapabilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCapability", params, optFns, c.addOperationDeleteCapabilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCapabilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteCapabilityInput struct { - - // The name of the capability to delete. - // - // This member is required. - CapabilityName *string - - // The name of the Amazon EKS cluster that contains the capability you want to - // delete. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DeleteCapabilityOutput struct { - - // An object containing information about the deleted capability, including its - // final status and configuration. - Capability *types.Capability - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCapabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCapability{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCapability{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCapability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCapabilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCapability(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCapability(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCapability", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.go deleted file mode 100644 index 65e25ef19658..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an Amazon EKS cluster control plane. -// -// If you have active services in your cluster that are associated with a load -// balancer, you must delete those services before deleting the cluster so that the -// load balancers are deleted properly. Otherwise, you can have orphaned resources -// in your VPC that prevent you from being able to delete the VPC. For more -// information, see [Deleting a cluster]in the Amazon EKS User Guide. -// -// If you have managed node groups or Fargate profiles attached to the cluster, -// you must delete them first. For more information, see DeleteNodgroup and -// DeleteFargateProfile . -// -// [Deleting a cluster]: https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html -func (c *Client) DeleteCluster(ctx context.Context, params *DeleteClusterInput, optFns ...func(*Options)) (*DeleteClusterOutput, error) { - if params == nil { - params = &DeleteClusterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCluster", params, optFns, c.addOperationDeleteClusterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteClusterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteClusterInput struct { - - // The name of the cluster to delete. - // - // This member is required. - Name *string - - noSmithyDocumentSerde -} - -type DeleteClusterOutput struct { - - // The full description of the cluster to delete. - Cluster *types.Cluster - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCluster{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCluster{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCluster"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteClusterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCluster(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCluster(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCluster", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteEksAnywhereSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteEksAnywhereSubscription.go deleted file mode 100644 index 5dd06e456757..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteEksAnywhereSubscription.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an expired or inactive subscription. Deleting inactive subscriptions -// removes them from the Amazon Web Services Management Console view and from -// list/describe API responses. Subscriptions can only be cancelled within 7 days -// of creation and are cancelled by creating a ticket in the Amazon Web Services -// Support Center. -func (c *Client) DeleteEksAnywhereSubscription(ctx context.Context, params *DeleteEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DeleteEksAnywhereSubscriptionOutput, error) { - if params == nil { - params = &DeleteEksAnywhereSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteEksAnywhereSubscription", params, optFns, c.addOperationDeleteEksAnywhereSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteEksAnywhereSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteEksAnywhereSubscriptionInput struct { - - // The ID of the subscription. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DeleteEksAnywhereSubscriptionOutput struct { - - // The full description of the subscription to be deleted. - Subscription *types.EksAnywhereSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEksAnywhereSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEksAnywhereSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteEksAnywhereSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.go deleted file mode 100644 index 07476a9bd59b..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an Fargate profile. -// -// When you delete a Fargate profile, any Pod running on Fargate that was created -// with the profile is deleted. If the Pod matches another Fargate profile, then -// it is scheduled on Fargate with that profile. If it no longer matches any -// Fargate profiles, then it's not scheduled on Fargate and may remain in a pending -// state. -// -// Only one Fargate profile in a cluster can be in the DELETING status at a time. -// You must wait for a Fargate profile to finish deleting before you can delete any -// other profiles in that cluster. -func (c *Client) DeleteFargateProfile(ctx context.Context, params *DeleteFargateProfileInput, optFns ...func(*Options)) (*DeleteFargateProfileOutput, error) { - if params == nil { - params = &DeleteFargateProfileInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteFargateProfile", params, optFns, c.addOperationDeleteFargateProfileMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteFargateProfileOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteFargateProfileInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the Fargate profile to delete. - // - // This member is required. - FargateProfileName *string - - noSmithyDocumentSerde -} - -type DeleteFargateProfileOutput struct { - - // The deleted Fargate profile. - FargateProfile *types.FargateProfile - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteFargateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFargateProfile{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFargateProfile{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteFargateProfile"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteFargateProfileValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFargateProfile(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteFargateProfile(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteFargateProfile", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.go deleted file mode 100644 index 1e076ec97ea8..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a managed node group. -func (c *Client) DeleteNodegroup(ctx context.Context, params *DeleteNodegroupInput, optFns ...func(*Options)) (*DeleteNodegroupOutput, error) { - if params == nil { - params = &DeleteNodegroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteNodegroup", params, optFns, c.addOperationDeleteNodegroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteNodegroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteNodegroupInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the node group to delete. - // - // This member is required. - NodegroupName *string - - noSmithyDocumentSerde -} - -type DeleteNodegroupOutput struct { - - // The full description of your deleted node group. - Nodegroup *types.Nodegroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteNodegroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteNodegroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteNodegroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNodegroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteNodegroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNodegroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteNodegroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteNodegroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeletePodIdentityAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeletePodIdentityAssociation.go deleted file mode 100644 index b227e77ad726..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeletePodIdentityAssociation.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a EKS Pod Identity association. -// -// The temporary Amazon Web Services credentials from the previous IAM role -// session might still be valid until the session expiry. If you need to -// immediately revoke the temporary session credentials, then go to the role in the -// IAM console. -func (c *Client) DeletePodIdentityAssociation(ctx context.Context, params *DeletePodIdentityAssociationInput, optFns ...func(*Options)) (*DeletePodIdentityAssociationOutput, error) { - if params == nil { - params = &DeletePodIdentityAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeletePodIdentityAssociation", params, optFns, c.addOperationDeletePodIdentityAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeletePodIdentityAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeletePodIdentityAssociationInput struct { - - // The ID of the association to be deleted. - // - // This member is required. - AssociationId *string - - // The cluster name that - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DeletePodIdentityAssociationOutput struct { - - // The full description of the EKS Pod Identity association that was deleted. - Association *types.PodIdentityAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeletePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePodIdentityAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeletePodIdentityAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePodIdentityAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeletePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeletePodIdentityAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.go deleted file mode 100644 index fd0e157d947a..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deregisters a connected cluster to remove it from the Amazon EKS control plane. -// -// A connected cluster is a Kubernetes cluster that you've connected to your -// control plane using the [Amazon EKS Connector]. -// -// [Amazon EKS Connector]: https://docs.aws.amazon.com/eks/latest/userguide/eks-connector.html -func (c *Client) DeregisterCluster(ctx context.Context, params *DeregisterClusterInput, optFns ...func(*Options)) (*DeregisterClusterOutput, error) { - if params == nil { - params = &DeregisterClusterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterCluster", params, optFns, c.addOperationDeregisterClusterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterClusterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeregisterClusterInput struct { - - // The name of the connected cluster to deregister. - // - // This member is required. - Name *string - - noSmithyDocumentSerde -} - -type DeregisterClusterOutput struct { - - // An object representing an Amazon EKS cluster. - Cluster *types.Cluster - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterCluster{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterCluster{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterCluster"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeregisterClusterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterCluster(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterCluster(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterCluster", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.go deleted file mode 100644 index 221cdf333a4c..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes an access entry. -func (c *Client) DescribeAccessEntry(ctx context.Context, params *DescribeAccessEntryInput, optFns ...func(*Options)) (*DescribeAccessEntryOutput, error) { - if params == nil { - params = &DescribeAccessEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAccessEntry", params, optFns, c.addOperationDescribeAccessEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAccessEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAccessEntryInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . - // - // This member is required. - PrincipalArn *string - - noSmithyDocumentSerde -} - -type DescribeAccessEntryOutput struct { - - // Information about the access entry. - AccessEntry *types.AccessEntry - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAccessEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAccessEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAccessEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAccessEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeAccessEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccessEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAccessEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAccessEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.go deleted file mode 100644 index a3463119e43c..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.go +++ /dev/null @@ -1,573 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes an Amazon EKS add-on. -func (c *Client) DescribeAddon(ctx context.Context, params *DescribeAddonInput, optFns ...func(*Options)) (*DescribeAddonOutput, error) { - if params == nil { - params = &DescribeAddonInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddon", params, optFns, c.addOperationDescribeAddonMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddonOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddonInput struct { - - // The name of the add-on. The name must match one of the names returned by [ListAddons] - // ListAddons . - // - // [ListAddons]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html - // - // This member is required. - AddonName *string - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DescribeAddonOutput struct { - - // An Amazon EKS add-on. For more information, see [Amazon EKS add-ons] in the Amazon EKS User Guide. - // - // [Amazon EKS add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html - Addon *types.Addon - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddonMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAddon{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAddon{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddon"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeAddonValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddon(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// AddonActiveWaiterOptions are waiter options for AddonActiveWaiter -type AddonActiveWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // AddonActiveWaiter will use default minimum delay of 10 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, AddonActiveWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeAddonInput, *DescribeAddonOutput, error) (bool, error) -} - -// AddonActiveWaiter defines the waiters for AddonActive -type AddonActiveWaiter struct { - client DescribeAddonAPIClient - - options AddonActiveWaiterOptions -} - -// NewAddonActiveWaiter constructs a AddonActiveWaiter. -func NewAddonActiveWaiter(client DescribeAddonAPIClient, optFns ...func(*AddonActiveWaiterOptions)) *AddonActiveWaiter { - options := AddonActiveWaiterOptions{} - options.MinDelay = 10 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = addonActiveStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &AddonActiveWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for AddonActive waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *AddonActiveWaiter) Wait(ctx context.Context, params *DescribeAddonInput, maxWaitDur time.Duration, optFns ...func(*AddonActiveWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for AddonActive waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *AddonActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeAddonInput, maxWaitDur time.Duration, optFns ...func(*AddonActiveWaiterOptions)) (*DescribeAddonOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeAddon(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for AddonActive waiter") -} - -func addonActiveStateRetryable(ctx context.Context, input *DescribeAddonInput, output *DescribeAddonOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Addon - var v2 types.AddonStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "CREATE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Addon - var v2 types.AddonStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "DEGRADED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Addon - var v2 types.AddonStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "ACTIVE" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// AddonDeletedWaiterOptions are waiter options for AddonDeletedWaiter -type AddonDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // AddonDeletedWaiter will use default minimum delay of 10 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, AddonDeletedWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeAddonInput, *DescribeAddonOutput, error) (bool, error) -} - -// AddonDeletedWaiter defines the waiters for AddonDeleted -type AddonDeletedWaiter struct { - client DescribeAddonAPIClient - - options AddonDeletedWaiterOptions -} - -// NewAddonDeletedWaiter constructs a AddonDeletedWaiter. -func NewAddonDeletedWaiter(client DescribeAddonAPIClient, optFns ...func(*AddonDeletedWaiterOptions)) *AddonDeletedWaiter { - options := AddonDeletedWaiterOptions{} - options.MinDelay = 10 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = addonDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &AddonDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for AddonDeleted waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *AddonDeletedWaiter) Wait(ctx context.Context, params *DescribeAddonInput, maxWaitDur time.Duration, optFns ...func(*AddonDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for AddonDeleted waiter and returns the -// output of the successful operation. The maxWaitDur is the maximum wait duration -// the waiter will wait. The maxWaitDur is required and must be greater than zero. -func (w *AddonDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeAddonInput, maxWaitDur time.Duration, optFns ...func(*AddonDeletedWaiterOptions)) (*DescribeAddonOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeAddon(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for AddonDeleted waiter") -} - -func addonDeletedStateRetryable(ctx context.Context, input *DescribeAddonInput, output *DescribeAddonOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Addon - var v2 types.AddonStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "DELETE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var errorType *types.ResourceNotFoundException - if errors.As(err, &errorType) { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeAddonAPIClient is a client that implements the DescribeAddon operation. -type DescribeAddonAPIClient interface { - DescribeAddon(context.Context, *DescribeAddonInput, ...func(*Options)) (*DescribeAddonOutput, error) -} - -var _ DescribeAddonAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeAddon(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddon", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.go deleted file mode 100644 index 678a7be610cd..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns configuration options. -func (c *Client) DescribeAddonConfiguration(ctx context.Context, params *DescribeAddonConfigurationInput, optFns ...func(*Options)) (*DescribeAddonConfigurationOutput, error) { - if params == nil { - params = &DescribeAddonConfigurationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddonConfiguration", params, optFns, c.addOperationDescribeAddonConfigurationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddonConfigurationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddonConfigurationInput struct { - - // The name of the add-on. The name must match one of the names returned by - // DescribeAddonVersions . - // - // This member is required. - AddonName *string - - // The version of the add-on. The version must match one of the versions returned - // by [DescribeAddonVersions]DescribeAddonVersions . - // - // [DescribeAddonVersions]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html - // - // This member is required. - AddonVersion *string - - noSmithyDocumentSerde -} - -type DescribeAddonConfigurationOutput struct { - - // The name of the add-on. - AddonName *string - - // The version of the add-on. The version must match one of the versions returned - // by [DescribeAddonVersions]DescribeAddonVersions . - // - // [DescribeAddonVersions]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html - AddonVersion *string - - // A JSON schema that's used to validate the configuration values you provide when - // an add-on is created or updated. - ConfigurationSchema *string - - // The Kubernetes service account name used by the add-on, and any suggested IAM - // policies. Use this information to create an IAM Role for the add-on. - PodIdentityConfiguration []types.AddonPodIdentityConfiguration - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddonConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAddonConfiguration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAddonConfiguration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddonConfiguration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeAddonConfigurationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddonConfiguration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAddonConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddonConfiguration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.go deleted file mode 100644 index c5b78cd09127..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes the versions for an add-on. -// -// Information such as the Kubernetes versions that you can use the add-on with, -// the owner , publisher , and the type of the add-on are returned. -func (c *Client) DescribeAddonVersions(ctx context.Context, params *DescribeAddonVersionsInput, optFns ...func(*Options)) (*DescribeAddonVersionsOutput, error) { - if params == nil { - params = &DescribeAddonVersionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAddonVersions", params, optFns, c.addOperationDescribeAddonVersionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAddonVersionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAddonVersionsInput struct { - - // The name of the add-on. The name must match one of the names returned by [ListAddons] - // ListAddons . - // - // [ListAddons]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html - AddonName *string - - // The Kubernetes versions that you can use the add-on with. - KubernetesVersion *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // The owner of the add-on. For valid owners , don't specify a value for this - // property. - Owners []string - - // The publisher of the add-on. For valid publishers , don't specify a value for - // this property. - Publishers []string - - // The type of the add-on. For valid types , don't specify a value for this - // property. - Types []string - - noSmithyDocumentSerde -} - -type DescribeAddonVersionsOutput struct { - - // The list of available versions with Kubernetes version compatibility and other - // properties. - Addons []types.AddonInfo - - // The nextToken value to include in a future DescribeAddonVersions request. When - // the results of a DescribeAddonVersions request exceed maxResults , you can use - // this value to retrieve the next page of results. This value is null when there - // are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAddonVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeAddonVersions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeAddonVersions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAddonVersions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddonVersions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// DescribeAddonVersionsPaginatorOptions is the paginator options for -// DescribeAddonVersions -type DescribeAddonVersionsPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeAddonVersionsPaginator is a paginator for DescribeAddonVersions -type DescribeAddonVersionsPaginator struct { - options DescribeAddonVersionsPaginatorOptions - client DescribeAddonVersionsAPIClient - params *DescribeAddonVersionsInput - nextToken *string - firstPage bool -} - -// NewDescribeAddonVersionsPaginator returns a new DescribeAddonVersionsPaginator -func NewDescribeAddonVersionsPaginator(client DescribeAddonVersionsAPIClient, params *DescribeAddonVersionsInput, optFns ...func(*DescribeAddonVersionsPaginatorOptions)) *DescribeAddonVersionsPaginator { - if params == nil { - params = &DescribeAddonVersionsInput{} - } - - options := DescribeAddonVersionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeAddonVersionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeAddonVersionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeAddonVersions page. -func (p *DescribeAddonVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddonVersionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeAddonVersions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeAddonVersionsAPIClient is a client that implements the -// DescribeAddonVersions operation. -type DescribeAddonVersionsAPIClient interface { - DescribeAddonVersions(context.Context, *DescribeAddonVersionsInput, ...func(*Options)) (*DescribeAddonVersionsOutput, error) -} - -var _ DescribeAddonVersionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeAddonVersions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAddonVersions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCapability.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCapability.go deleted file mode 100644 index 041582f167c3..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCapability.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns detailed information about a specific managed capability in your Amazon -// EKS cluster, including its current status, configuration, health information, -// and any issues that may be affecting its operation. -func (c *Client) DescribeCapability(ctx context.Context, params *DescribeCapabilityInput, optFns ...func(*Options)) (*DescribeCapabilityOutput, error) { - if params == nil { - params = &DescribeCapabilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCapability", params, optFns, c.addOperationDescribeCapabilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCapabilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCapabilityInput struct { - - // The name of the capability to describe. - // - // This member is required. - CapabilityName *string - - // The name of the Amazon EKS cluster that contains the capability you want to - // describe. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DescribeCapabilityOutput struct { - - // An object containing detailed information about the capability, including its - // name, ARN, type, status, version, configuration, health status, and timestamps - // for when it was created and last modified. - Capability *types.Capability - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCapabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCapability{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCapability{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCapabilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapability(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeCapability(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCapability", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go deleted file mode 100644 index 0036535c20ee..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go +++ /dev/null @@ -1,605 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes an Amazon EKS cluster. -// -// The API server endpoint and certificate authority data returned by this -// operation are required for kubelet and kubectl to communicate with your -// Kubernetes API server. For more information, see [Creating or updating a kubeconfig file for an Amazon EKS cluster]kubeconfig . -// -// The API server endpoint and certificate authority data aren't available until -// the cluster reaches the ACTIVE state. -// -// [Creating or updating a kubeconfig file for an Amazon EKS cluster]: https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html -func (c *Client) DescribeCluster(ctx context.Context, params *DescribeClusterInput, optFns ...func(*Options)) (*DescribeClusterOutput, error) { - if params == nil { - params = &DescribeClusterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCluster", params, optFns, c.addOperationDescribeClusterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClusterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClusterInput struct { - - // The name of your cluster. - // - // This member is required. - Name *string - - noSmithyDocumentSerde -} - -type DescribeClusterOutput struct { - - // The full description of your specified cluster. - Cluster *types.Cluster - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCluster{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCluster{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCluster"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeClusterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCluster(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ClusterActiveWaiterOptions are waiter options for ClusterActiveWaiter -type ClusterActiveWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ClusterActiveWaiter will use default minimum delay of 30 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ClusterActiveWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeClusterInput, *DescribeClusterOutput, error) (bool, error) -} - -// ClusterActiveWaiter defines the waiters for ClusterActive -type ClusterActiveWaiter struct { - client DescribeClusterAPIClient - - options ClusterActiveWaiterOptions -} - -// NewClusterActiveWaiter constructs a ClusterActiveWaiter. -func NewClusterActiveWaiter(client DescribeClusterAPIClient, optFns ...func(*ClusterActiveWaiterOptions)) *ClusterActiveWaiter { - options := ClusterActiveWaiterOptions{} - options.MinDelay = 30 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = clusterActiveStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ClusterActiveWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ClusterActive waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *ClusterActiveWaiter) Wait(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterActiveWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ClusterActive waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *ClusterActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterActiveWaiterOptions)) (*DescribeClusterOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeCluster(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ClusterActive waiter") -} - -func clusterActiveStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "DELETING" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "ACTIVE" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// ClusterDeletedWaiterOptions are waiter options for ClusterDeletedWaiter -type ClusterDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // ClusterDeletedWaiter will use default minimum delay of 30 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, ClusterDeletedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeClusterInput, *DescribeClusterOutput, error) (bool, error) -} - -// ClusterDeletedWaiter defines the waiters for ClusterDeleted -type ClusterDeletedWaiter struct { - client DescribeClusterAPIClient - - options ClusterDeletedWaiterOptions -} - -// NewClusterDeletedWaiter constructs a ClusterDeletedWaiter. -func NewClusterDeletedWaiter(client DescribeClusterAPIClient, optFns ...func(*ClusterDeletedWaiterOptions)) *ClusterDeletedWaiter { - options := ClusterDeletedWaiterOptions{} - options.MinDelay = 30 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = clusterDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &ClusterDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for ClusterDeleted waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. -func (w *ClusterDeletedWaiter) Wait(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for ClusterDeleted waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *ClusterDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeClusterInput, maxWaitDur time.Duration, optFns ...func(*ClusterDeletedWaiterOptions)) (*DescribeClusterOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeCluster(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for ClusterDeleted waiter") -} - -func clusterDeletedStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "ACTIVE" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "CREATING" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Cluster - var v2 types.ClusterStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "PENDING" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var errorType *types.ResourceNotFoundException - if errors.As(err, &errorType) { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeClusterAPIClient is a client that implements the DescribeCluster -// operation. -type DescribeClusterAPIClient interface { - DescribeCluster(context.Context, *DescribeClusterInput, ...func(*Options)) (*DescribeClusterOutput, error) -} - -var _ DescribeClusterAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeCluster(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCluster", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeClusterVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeClusterVersions.go deleted file mode 100644 index 829b637b5857..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeClusterVersions.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists available Kubernetes versions for Amazon EKS clusters. -func (c *Client) DescribeClusterVersions(ctx context.Context, params *DescribeClusterVersionsInput, optFns ...func(*Options)) (*DescribeClusterVersionsOutput, error) { - if params == nil { - params = &DescribeClusterVersionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeClusterVersions", params, optFns, c.addOperationDescribeClusterVersionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeClusterVersionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeClusterVersionsInput struct { - - // The type of cluster to filter versions by. - ClusterType *string - - // List of specific cluster versions to describe. - ClusterVersions []string - - // Filter to show only default versions. - DefaultOnly *bool - - // Include all available versions in the response. - IncludeAll *bool - - // Maximum number of results to return. - MaxResults *int32 - - // Pagination token for the next set of results. - NextToken *string - - // This field is deprecated. Use versionStatus instead, as that field matches for - // input and output of this action. - // - // Filter versions by their current status. - // - // Deprecated: status has been replaced by versionStatus - Status types.ClusterVersionStatus - - // Filter versions by their current status. - VersionStatus types.VersionStatus - - noSmithyDocumentSerde -} - -type DescribeClusterVersionsOutput struct { - - // List of cluster version information objects. - ClusterVersions []types.ClusterVersionInformation - - // Pagination token for the next set of results. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeClusterVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeClusterVersions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeClusterVersions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeClusterVersions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClusterVersions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// DescribeClusterVersionsPaginatorOptions is the paginator options for -// DescribeClusterVersions -type DescribeClusterVersionsPaginatorOptions struct { - // Maximum number of results to return. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// DescribeClusterVersionsPaginator is a paginator for DescribeClusterVersions -type DescribeClusterVersionsPaginator struct { - options DescribeClusterVersionsPaginatorOptions - client DescribeClusterVersionsAPIClient - params *DescribeClusterVersionsInput - nextToken *string - firstPage bool -} - -// NewDescribeClusterVersionsPaginator returns a new -// DescribeClusterVersionsPaginator -func NewDescribeClusterVersionsPaginator(client DescribeClusterVersionsAPIClient, params *DescribeClusterVersionsInput, optFns ...func(*DescribeClusterVersionsPaginatorOptions)) *DescribeClusterVersionsPaginator { - if params == nil { - params = &DescribeClusterVersionsInput{} - } - - options := DescribeClusterVersionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &DescribeClusterVersionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *DescribeClusterVersionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next DescribeClusterVersions page. -func (p *DescribeClusterVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterVersionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.DescribeClusterVersions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// DescribeClusterVersionsAPIClient is a client that implements the -// DescribeClusterVersions operation. -type DescribeClusterVersionsAPIClient interface { - DescribeClusterVersions(context.Context, *DescribeClusterVersionsInput, ...func(*Options)) (*DescribeClusterVersionsOutput, error) -} - -var _ DescribeClusterVersionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeClusterVersions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeClusterVersions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeEksAnywhereSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeEksAnywhereSubscription.go deleted file mode 100644 index f2523eb01082..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeEksAnywhereSubscription.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns descriptive information about a subscription. -func (c *Client) DescribeEksAnywhereSubscription(ctx context.Context, params *DescribeEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DescribeEksAnywhereSubscriptionOutput, error) { - if params == nil { - params = &DescribeEksAnywhereSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeEksAnywhereSubscription", params, optFns, c.addOperationDescribeEksAnywhereSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeEksAnywhereSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeEksAnywhereSubscriptionInput struct { - - // The ID of the subscription. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DescribeEksAnywhereSubscriptionOutput struct { - - // The full description of the subscription. - Subscription *types.EksAnywhereSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEksAnywhereSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEksAnywhereSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeEksAnywhereSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeFargateProfile.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeFargateProfile.go deleted file mode 100644 index 41995c87f0a7..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeFargateProfile.go +++ /dev/null @@ -1,560 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes an Fargate profile. -func (c *Client) DescribeFargateProfile(ctx context.Context, params *DescribeFargateProfileInput, optFns ...func(*Options)) (*DescribeFargateProfileOutput, error) { - if params == nil { - params = &DescribeFargateProfileInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeFargateProfile", params, optFns, c.addOperationDescribeFargateProfileMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeFargateProfileOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeFargateProfileInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the Fargate profile to describe. - // - // This member is required. - FargateProfileName *string - - noSmithyDocumentSerde -} - -type DescribeFargateProfileOutput struct { - - // The full description of your Fargate profile. - FargateProfile *types.FargateProfile - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeFargateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeFargateProfile{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeFargateProfile{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFargateProfile"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeFargateProfileValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFargateProfile(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// FargateProfileActiveWaiterOptions are waiter options for -// FargateProfileActiveWaiter -type FargateProfileActiveWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // FargateProfileActiveWaiter will use default minimum delay of 10 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, FargateProfileActiveWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeFargateProfileInput, *DescribeFargateProfileOutput, error) (bool, error) -} - -// FargateProfileActiveWaiter defines the waiters for FargateProfileActive -type FargateProfileActiveWaiter struct { - client DescribeFargateProfileAPIClient - - options FargateProfileActiveWaiterOptions -} - -// NewFargateProfileActiveWaiter constructs a FargateProfileActiveWaiter. -func NewFargateProfileActiveWaiter(client DescribeFargateProfileAPIClient, optFns ...func(*FargateProfileActiveWaiterOptions)) *FargateProfileActiveWaiter { - options := FargateProfileActiveWaiterOptions{} - options.MinDelay = 10 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = fargateProfileActiveStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &FargateProfileActiveWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for FargateProfileActive waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *FargateProfileActiveWaiter) Wait(ctx context.Context, params *DescribeFargateProfileInput, maxWaitDur time.Duration, optFns ...func(*FargateProfileActiveWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for FargateProfileActive waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *FargateProfileActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeFargateProfileInput, maxWaitDur time.Duration, optFns ...func(*FargateProfileActiveWaiterOptions)) (*DescribeFargateProfileOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeFargateProfile(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for FargateProfileActive waiter") -} - -func fargateProfileActiveStateRetryable(ctx context.Context, input *DescribeFargateProfileInput, output *DescribeFargateProfileOutput, err error) (bool, error) { - - if err == nil { - v1 := output.FargateProfile - var v2 types.FargateProfileStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "CREATE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.FargateProfile - var v2 types.FargateProfileStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "ACTIVE" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// FargateProfileDeletedWaiterOptions are waiter options for -// FargateProfileDeletedWaiter -type FargateProfileDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // FargateProfileDeletedWaiter will use default minimum delay of 30 seconds. Note - // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, FargateProfileDeletedWaiter will use default max delay of 120 - // seconds. Note that MaxDelay must resolve to value greater than or equal to the - // MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeFargateProfileInput, *DescribeFargateProfileOutput, error) (bool, error) -} - -// FargateProfileDeletedWaiter defines the waiters for FargateProfileDeleted -type FargateProfileDeletedWaiter struct { - client DescribeFargateProfileAPIClient - - options FargateProfileDeletedWaiterOptions -} - -// NewFargateProfileDeletedWaiter constructs a FargateProfileDeletedWaiter. -func NewFargateProfileDeletedWaiter(client DescribeFargateProfileAPIClient, optFns ...func(*FargateProfileDeletedWaiterOptions)) *FargateProfileDeletedWaiter { - options := FargateProfileDeletedWaiterOptions{} - options.MinDelay = 30 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = fargateProfileDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &FargateProfileDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for FargateProfileDeleted waiter. The maxWaitDur -// is the maximum wait duration the waiter will wait. The maxWaitDur is required -// and must be greater than zero. -func (w *FargateProfileDeletedWaiter) Wait(ctx context.Context, params *DescribeFargateProfileInput, maxWaitDur time.Duration, optFns ...func(*FargateProfileDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for FargateProfileDeleted waiter and -// returns the output of the successful operation. The maxWaitDur is the maximum -// wait duration the waiter will wait. The maxWaitDur is required and must be -// greater than zero. -func (w *FargateProfileDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeFargateProfileInput, maxWaitDur time.Duration, optFns ...func(*FargateProfileDeletedWaiterOptions)) (*DescribeFargateProfileOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeFargateProfile(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for FargateProfileDeleted waiter") -} - -func fargateProfileDeletedStateRetryable(ctx context.Context, input *DescribeFargateProfileInput, output *DescribeFargateProfileOutput, err error) (bool, error) { - - if err == nil { - v1 := output.FargateProfile - var v2 types.FargateProfileStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "DELETE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var errorType *types.ResourceNotFoundException - if errors.As(err, &errorType) { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeFargateProfileAPIClient is a client that implements the -// DescribeFargateProfile operation. -type DescribeFargateProfileAPIClient interface { - DescribeFargateProfile(context.Context, *DescribeFargateProfileInput, ...func(*Options)) (*DescribeFargateProfileOutput, error) -} - -var _ DescribeFargateProfileAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeFargateProfile(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeFargateProfile", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeIdentityProviderConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeIdentityProviderConfig.go deleted file mode 100644 index 814d90c74cd2..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeIdentityProviderConfig.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes an identity provider configuration. -func (c *Client) DescribeIdentityProviderConfig(ctx context.Context, params *DescribeIdentityProviderConfigInput, optFns ...func(*Options)) (*DescribeIdentityProviderConfigOutput, error) { - if params == nil { - params = &DescribeIdentityProviderConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeIdentityProviderConfig", params, optFns, c.addOperationDescribeIdentityProviderConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeIdentityProviderConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeIdentityProviderConfigInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // An object representing an identity provider configuration. - // - // This member is required. - IdentityProviderConfig *types.IdentityProviderConfig - - noSmithyDocumentSerde -} - -type DescribeIdentityProviderConfigOutput struct { - - // The object that represents an OpenID Connect (OIDC) identity provider - // configuration. - IdentityProviderConfig *types.IdentityProviderConfigResponse - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeIdentityProviderConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIdentityProviderConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeIdentityProviderConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIdentityProviderConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeIdentityProviderConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeIdentityProviderConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsight.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsight.go deleted file mode 100644 index 30ef8f9da3b2..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsight.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns details about an insight that you specify using its ID. -func (c *Client) DescribeInsight(ctx context.Context, params *DescribeInsightInput, optFns ...func(*Options)) (*DescribeInsightOutput, error) { - if params == nil { - params = &DescribeInsightInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInsight", params, optFns, c.addOperationDescribeInsightMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInsightOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInsightInput struct { - - // The name of the cluster to describe the insight for. - // - // This member is required. - ClusterName *string - - // The identity of the insight to describe. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DescribeInsightOutput struct { - - // The full description of the insight. - Insight *types.Insight - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInsightMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeInsight{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeInsight{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInsight"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeInsightValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInsight(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeInsight(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInsight", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsightsRefresh.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsightsRefresh.go deleted file mode 100644 index d2da69a742d7..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsightsRefresh.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Returns the status of the latest on-demand cluster insights refresh operation. -func (c *Client) DescribeInsightsRefresh(ctx context.Context, params *DescribeInsightsRefreshInput, optFns ...func(*Options)) (*DescribeInsightsRefreshOutput, error) { - if params == nil { - params = &DescribeInsightsRefreshInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeInsightsRefresh", params, optFns, c.addOperationDescribeInsightsRefreshMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeInsightsRefreshOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeInsightsRefreshInput struct { - - // The name of the cluster associated with the insights refresh operation. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DescribeInsightsRefreshOutput struct { - - // The date and time when the insights refresh operation ended. - EndedAt *time.Time - - // The message associated with the insights refresh operation. - Message *string - - // The date and time when the insights refresh operation started. - StartedAt *time.Time - - // The current status of the insights refresh operation. - Status types.InsightsRefreshStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeInsightsRefreshMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeInsightsRefresh{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeInsightsRefresh{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInsightsRefresh"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeInsightsRefreshValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInsightsRefresh(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeInsightsRefresh(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeInsightsRefresh", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeNodegroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeNodegroup.go deleted file mode 100644 index d2bb4d03c23c..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeNodegroup.go +++ /dev/null @@ -1,556 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "errors" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - smithyhttp "github.com/aws/smithy-go/transport/http" - smithywaiter "github.com/aws/smithy-go/waiter" - "time" -) - -// Describes a managed node group. -func (c *Client) DescribeNodegroup(ctx context.Context, params *DescribeNodegroupInput, optFns ...func(*Options)) (*DescribeNodegroupOutput, error) { - if params == nil { - params = &DescribeNodegroupInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeNodegroup", params, optFns, c.addOperationDescribeNodegroupMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeNodegroupOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeNodegroupInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the node group to describe. - // - // This member is required. - NodegroupName *string - - noSmithyDocumentSerde -} - -type DescribeNodegroupOutput struct { - - // The full description of your node group. - Nodegroup *types.Nodegroup - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeNodegroupMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeNodegroup{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeNodegroup{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeNodegroup"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeNodegroupValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNodegroup(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// NodegroupActiveWaiterOptions are waiter options for NodegroupActiveWaiter -type NodegroupActiveWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // NodegroupActiveWaiter will use default minimum delay of 30 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, NodegroupActiveWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeNodegroupInput, *DescribeNodegroupOutput, error) (bool, error) -} - -// NodegroupActiveWaiter defines the waiters for NodegroupActive -type NodegroupActiveWaiter struct { - client DescribeNodegroupAPIClient - - options NodegroupActiveWaiterOptions -} - -// NewNodegroupActiveWaiter constructs a NodegroupActiveWaiter. -func NewNodegroupActiveWaiter(client DescribeNodegroupAPIClient, optFns ...func(*NodegroupActiveWaiterOptions)) *NodegroupActiveWaiter { - options := NodegroupActiveWaiterOptions{} - options.MinDelay = 30 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = nodegroupActiveStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &NodegroupActiveWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for NodegroupActive waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *NodegroupActiveWaiter) Wait(ctx context.Context, params *DescribeNodegroupInput, maxWaitDur time.Duration, optFns ...func(*NodegroupActiveWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for NodegroupActive waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *NodegroupActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeNodegroupInput, maxWaitDur time.Duration, optFns ...func(*NodegroupActiveWaiterOptions)) (*DescribeNodegroupOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeNodegroup(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for NodegroupActive waiter") -} - -func nodegroupActiveStateRetryable(ctx context.Context, input *DescribeNodegroupInput, output *DescribeNodegroupOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Nodegroup - var v2 types.NodegroupStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "CREATE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err == nil { - v1 := output.Nodegroup - var v2 types.NodegroupStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "ACTIVE" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// NodegroupDeletedWaiterOptions are waiter options for NodegroupDeletedWaiter -type NodegroupDeletedWaiterOptions struct { - - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - // - // Passing options here is functionally equivalent to passing values to this - // config's ClientOptions field that extend the inner client's APIOptions directly. - APIOptions []func(*middleware.Stack) error - - // Functional options to be passed to all operations invoked by this client. - // - // Function values that modify the inner APIOptions are applied after the waiter - // config's own APIOptions modifiers. - ClientOptions []func(*Options) - - // MinDelay is the minimum amount of time to delay between retries. If unset, - // NodegroupDeletedWaiter will use default minimum delay of 30 seconds. Note that - // MinDelay must resolve to a value lesser than or equal to the MaxDelay. - MinDelay time.Duration - - // MaxDelay is the maximum amount of time to delay between retries. If unset or - // set to zero, NodegroupDeletedWaiter will use default max delay of 120 seconds. - // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. - MaxDelay time.Duration - - // LogWaitAttempts is used to enable logging for waiter retry attempts - LogWaitAttempts bool - - // Retryable is function that can be used to override the service defined - // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. - // - // By default service-modeled logic will populate this option. This option can - // thus be used to define a custom waiter state with fall-back to service-modeled - // waiter state mutators.The function returns an error in case of a failure state. - // In case of retry state, this function returns a bool value of true and nil - // error, while in case of success it returns a bool value of false and nil error. - Retryable func(context.Context, *DescribeNodegroupInput, *DescribeNodegroupOutput, error) (bool, error) -} - -// NodegroupDeletedWaiter defines the waiters for NodegroupDeleted -type NodegroupDeletedWaiter struct { - client DescribeNodegroupAPIClient - - options NodegroupDeletedWaiterOptions -} - -// NewNodegroupDeletedWaiter constructs a NodegroupDeletedWaiter. -func NewNodegroupDeletedWaiter(client DescribeNodegroupAPIClient, optFns ...func(*NodegroupDeletedWaiterOptions)) *NodegroupDeletedWaiter { - options := NodegroupDeletedWaiterOptions{} - options.MinDelay = 30 * time.Second - options.MaxDelay = 120 * time.Second - options.Retryable = nodegroupDeletedStateRetryable - - for _, fn := range optFns { - fn(&options) - } - return &NodegroupDeletedWaiter{ - client: client, - options: options, - } -} - -// Wait calls the waiter function for NodegroupDeleted waiter. The maxWaitDur is -// the maximum wait duration the waiter will wait. The maxWaitDur is required and -// must be greater than zero. -func (w *NodegroupDeletedWaiter) Wait(ctx context.Context, params *DescribeNodegroupInput, maxWaitDur time.Duration, optFns ...func(*NodegroupDeletedWaiterOptions)) error { - _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) - return err -} - -// WaitForOutput calls the waiter function for NodegroupDeleted waiter and returns -// the output of the successful operation. The maxWaitDur is the maximum wait -// duration the waiter will wait. The maxWaitDur is required and must be greater -// than zero. -func (w *NodegroupDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeNodegroupInput, maxWaitDur time.Duration, optFns ...func(*NodegroupDeletedWaiterOptions)) (*DescribeNodegroupOutput, error) { - if maxWaitDur <= 0 { - return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") - } - - options := w.options - for _, fn := range optFns { - fn(&options) - } - - if options.MaxDelay <= 0 { - options.MaxDelay = 120 * time.Second - } - - if options.MinDelay > options.MaxDelay { - return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) - } - - ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) - defer cancelFn() - - logger := smithywaiter.Logger{} - remainingTime := maxWaitDur - - var attempt int64 - for { - - attempt++ - apiOptions := options.APIOptions - start := time.Now() - - if options.LogWaitAttempts { - logger.Attempt = attempt - apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) - apiOptions = append(apiOptions, logger.AddLogger) - } - - out, err := w.client.DescribeNodegroup(ctx, params, func(o *Options) { - baseOpts := []func(*Options){ - addIsWaiterUserAgent, - } - o.APIOptions = append(o.APIOptions, apiOptions...) - for _, opt := range baseOpts { - opt(o) - } - for _, opt := range options.ClientOptions { - opt(o) - } - }) - - retryable, err := options.Retryable(ctx, params, out, err) - if err != nil { - return nil, err - } - if !retryable { - return out, nil - } - - remainingTime -= time.Since(start) - if remainingTime < options.MinDelay || remainingTime <= 0 { - break - } - - // compute exponential backoff between waiter retries - delay, err := smithywaiter.ComputeDelay( - attempt, options.MinDelay, options.MaxDelay, remainingTime, - ) - if err != nil { - return nil, fmt.Errorf("error computing waiter delay, %w", err) - } - - remainingTime -= delay - // sleep for the delay amount before invoking a request - if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return nil, fmt.Errorf("request cancelled while waiting, %w", err) - } - } - return nil, fmt.Errorf("exceeded max wait time for NodegroupDeleted waiter") -} - -func nodegroupDeletedStateRetryable(ctx context.Context, input *DescribeNodegroupInput, output *DescribeNodegroupOutput, err error) (bool, error) { - - if err == nil { - v1 := output.Nodegroup - var v2 types.NodegroupStatus - if v1 != nil { - v3 := v1.Status - v2 = v3 - } - expectedValue := "DELETE_FAILED" - var pathValue string - pathValue = string(v2) - if pathValue == expectedValue { - return false, fmt.Errorf("waiter state transitioned to Failure") - } - } - - if err != nil { - var errorType *types.ResourceNotFoundException - if errors.As(err, &errorType) { - return false, nil - } - } - - if err != nil { - return false, err - } - return true, nil -} - -// DescribeNodegroupAPIClient is a client that implements the DescribeNodegroup -// operation. -type DescribeNodegroupAPIClient interface { - DescribeNodegroup(context.Context, *DescribeNodegroupInput, ...func(*Options)) (*DescribeNodegroupOutput, error) -} - -var _ DescribeNodegroupAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opDescribeNodegroup(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeNodegroup", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribePodIdentityAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribePodIdentityAssociation.go deleted file mode 100644 index b26b17795d54..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribePodIdentityAssociation.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns descriptive information about an EKS Pod Identity association. -// -// This action requires the ID of the association. You can get the ID from the -// response to the CreatePodIdentityAssocation for newly created associations. Or, -// you can list the IDs for associations with ListPodIdentityAssociations and -// filter the list by namespace or service account. -func (c *Client) DescribePodIdentityAssociation(ctx context.Context, params *DescribePodIdentityAssociationInput, optFns ...func(*Options)) (*DescribePodIdentityAssociationOutput, error) { - if params == nil { - params = &DescribePodIdentityAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePodIdentityAssociation", params, optFns, c.addOperationDescribePodIdentityAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePodIdentityAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePodIdentityAssociationInput struct { - - // The ID of the association that you want the description of. - // - // This member is required. - AssociationId *string - - // The name of the cluster that the association is in. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type DescribePodIdentityAssociationOutput struct { - - // The full description of the EKS Pod Identity association. - Association *types.PodIdentityAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePodIdentityAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribePodIdentityAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePodIdentityAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePodIdentityAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeUpdate.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeUpdate.go deleted file mode 100644 index 0abc757a40d8..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeUpdate.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes an update to an Amazon EKS resource. -// -// When the status of the update is Successful , the update is complete. If an -// update fails, the status is Failed , and an error detail explains the reason for -// the failure. -func (c *Client) DescribeUpdate(ctx context.Context, params *DescribeUpdateInput, optFns ...func(*Options)) (*DescribeUpdateOutput, error) { - if params == nil { - params = &DescribeUpdateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeUpdate", params, optFns, c.addOperationDescribeUpdateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeUpdateOutput) - out.ResultMetadata = metadata - return out, nil -} - -// Describes an update request. -type DescribeUpdateInput struct { - - // The name of the Amazon EKS cluster associated with the update. - // - // This member is required. - Name *string - - // The ID of the update to describe. - // - // This member is required. - UpdateId *string - - // The name of the add-on. The name must match one of the names returned by [ListAddons] - // ListAddons . This parameter is required if the update is an add-on update. - // - // [ListAddons]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html - AddonName *string - - // The name of the capability for which you want to describe updates. - CapabilityName *string - - // The name of the Amazon EKS node group associated with the update. This - // parameter is required if the update is a node group update. - NodegroupName *string - - noSmithyDocumentSerde -} - -type DescribeUpdateOutput struct { - - // The full description of the specified update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeUpdateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeUpdate{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeUpdate{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeUpdate"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeUpdateValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeUpdate(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeUpdate(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeUpdate", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateAccessPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateAccessPolicy.go deleted file mode 100644 index fd449611fc7a..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateAccessPolicy.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates an access policy from an access entry. -func (c *Client) DisassociateAccessPolicy(ctx context.Context, params *DisassociateAccessPolicyInput, optFns ...func(*Options)) (*DisassociateAccessPolicyOutput, error) { - if params == nil { - params = &DisassociateAccessPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateAccessPolicy", params, optFns, c.addOperationDisassociateAccessPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateAccessPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateAccessPolicyInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the policy to disassociate from the access entry. For a list of - // associated policies ARNs, use ListAssociatedAccessPolicies . - // - // This member is required. - PolicyArn *string - - // The ARN of the IAM principal for the AccessEntry . - // - // This member is required. - PrincipalArn *string - - noSmithyDocumentSerde -} - -type DisassociateAccessPolicyOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateAccessPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateAccessPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateAccessPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisassociateAccessPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateAccessPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateAccessPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateIdentityProviderConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateIdentityProviderConfig.go deleted file mode 100644 index aa8ca73c04a1..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateIdentityProviderConfig.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates an identity provider configuration from a cluster. -// -// If you disassociate an identity provider from your cluster, users included in -// the provider can no longer access the cluster. However, you can still access the -// cluster with IAM principals. -func (c *Client) DisassociateIdentityProviderConfig(ctx context.Context, params *DisassociateIdentityProviderConfigInput, optFns ...func(*Options)) (*DisassociateIdentityProviderConfigOutput, error) { - if params == nil { - params = &DisassociateIdentityProviderConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateIdentityProviderConfig", params, optFns, c.addOperationDisassociateIdentityProviderConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateIdentityProviderConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateIdentityProviderConfigInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // An object representing an identity provider configuration. - // - // This member is required. - IdentityProviderConfig *types.IdentityProviderConfig - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - noSmithyDocumentSerde -} - -type DisassociateIdentityProviderConfigOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateIdentityProviderConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateIdentityProviderConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateIdentityProviderConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opDisassociateIdentityProviderConfigMiddleware(stack, options); err != nil { - return err - } - if err = addOpDisassociateIdentityProviderConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateIdentityProviderConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpDisassociateIdentityProviderConfig struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpDisassociateIdentityProviderConfig) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpDisassociateIdentityProviderConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*DisassociateIdentityProviderConfigInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *DisassociateIdentityProviderConfigInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opDisassociateIdentityProviderConfigMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpDisassociateIdentityProviderConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opDisassociateIdentityProviderConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateIdentityProviderConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessEntries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessEntries.go deleted file mode 100644 index 5d7e2a618b0e..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessEntries.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the access entries for your cluster. -func (c *Client) ListAccessEntries(ctx context.Context, params *ListAccessEntriesInput, optFns ...func(*Options)) (*ListAccessEntriesOutput, error) { - if params == nil { - params = &ListAccessEntriesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccessEntries", params, optFns, c.addOperationListAccessEntriesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccessEntriesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccessEntriesInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of an AccessPolicy . When you specify an access policy ARN, only the - // access entries associated to that access policy are returned. For a list of - // available policy ARNs, use ListAccessPolicies . - AssociatedPolicyArn *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccessEntriesOutput struct { - - // The list of access entries that exist for the cluster. - AccessEntries []string - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccessEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessEntries{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessEntries{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccessEntries"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAccessEntriesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessEntries(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAccessEntriesPaginatorOptions is the paginator options for ListAccessEntries -type ListAccessEntriesPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccessEntriesPaginator is a paginator for ListAccessEntries -type ListAccessEntriesPaginator struct { - options ListAccessEntriesPaginatorOptions - client ListAccessEntriesAPIClient - params *ListAccessEntriesInput - nextToken *string - firstPage bool -} - -// NewListAccessEntriesPaginator returns a new ListAccessEntriesPaginator -func NewListAccessEntriesPaginator(client ListAccessEntriesAPIClient, params *ListAccessEntriesInput, optFns ...func(*ListAccessEntriesPaginatorOptions)) *ListAccessEntriesPaginator { - if params == nil { - params = &ListAccessEntriesInput{} - } - - options := ListAccessEntriesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccessEntriesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccessEntriesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccessEntries page. -func (p *ListAccessEntriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessEntriesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccessEntries(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccessEntriesAPIClient is a client that implements the ListAccessEntries -// operation. -type ListAccessEntriesAPIClient interface { - ListAccessEntries(context.Context, *ListAccessEntriesInput, ...func(*Options)) (*ListAccessEntriesOutput, error) -} - -var _ ListAccessEntriesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccessEntries(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccessEntries", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessPolicies.go deleted file mode 100644 index 170ac358d629..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessPolicies.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the available access policies. -func (c *Client) ListAccessPolicies(ctx context.Context, params *ListAccessPoliciesInput, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { - if params == nil { - params = &ListAccessPoliciesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccessPolicies", params, optFns, c.addOperationListAccessPoliciesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccessPoliciesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccessPoliciesInput struct { - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccessPoliciesOutput struct { - - // The list of available access policies. You can't view the contents of an access - // policy using the API. To view the contents, see [Access policy permissions]in the Amazon EKS User Guide. - // - // [Access policy permissions]: https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html#access-policy-permissions - AccessPolicies []types.AccessPolicy - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccessPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessPolicies{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessPolicies{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccessPolicies"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPolicies(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAccessPoliciesPaginatorOptions is the paginator options for -// ListAccessPolicies -type ListAccessPoliciesPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccessPoliciesPaginator is a paginator for ListAccessPolicies -type ListAccessPoliciesPaginator struct { - options ListAccessPoliciesPaginatorOptions - client ListAccessPoliciesAPIClient - params *ListAccessPoliciesInput - nextToken *string - firstPage bool -} - -// NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator -func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator { - if params == nil { - params = &ListAccessPoliciesInput{} - } - - options := ListAccessPoliciesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccessPoliciesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccessPoliciesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccessPolicies page. -func (p *ListAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccessPolicies(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccessPoliciesAPIClient is a client that implements the ListAccessPolicies -// operation. -type ListAccessPoliciesAPIClient interface { - ListAccessPolicies(context.Context, *ListAccessPoliciesInput, ...func(*Options)) (*ListAccessPoliciesOutput, error) -} - -var _ ListAccessPoliciesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccessPolicies", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAddons.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAddons.go deleted file mode 100644 index aa792f86c751..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAddons.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the installed add-ons. -func (c *Client) ListAddons(ctx context.Context, params *ListAddonsInput, optFns ...func(*Options)) (*ListAddonsOutput, error) { - if params == nil { - params = &ListAddonsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAddons", params, optFns, c.addOperationListAddonsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAddonsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAddonsInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAddonsOutput struct { - - // A list of installed add-ons. - Addons []string - - // The nextToken value to include in a future ListAddons request. When the results - // of a ListAddons request exceed maxResults , you can use this value to retrieve - // the next page of results. This value is null when there are no more results to - // return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAddonsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAddons{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAddons{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAddons"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAddonsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAddons(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAddonsPaginatorOptions is the paginator options for ListAddons -type ListAddonsPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAddonsPaginator is a paginator for ListAddons -type ListAddonsPaginator struct { - options ListAddonsPaginatorOptions - client ListAddonsAPIClient - params *ListAddonsInput - nextToken *string - firstPage bool -} - -// NewListAddonsPaginator returns a new ListAddonsPaginator -func NewListAddonsPaginator(client ListAddonsAPIClient, params *ListAddonsInput, optFns ...func(*ListAddonsPaginatorOptions)) *ListAddonsPaginator { - if params == nil { - params = &ListAddonsInput{} - } - - options := ListAddonsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAddonsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAddonsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAddons page. -func (p *ListAddonsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAddonsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAddons(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAddonsAPIClient is a client that implements the ListAddons operation. -type ListAddonsAPIClient interface { - ListAddons(context.Context, *ListAddonsInput, ...func(*Options)) (*ListAddonsOutput, error) -} - -var _ ListAddonsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAddons(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAddons", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAssociatedAccessPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAssociatedAccessPolicies.go deleted file mode 100644 index 0506910d38a3..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAssociatedAccessPolicies.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the access policies associated with an access entry. -func (c *Client) ListAssociatedAccessPolicies(ctx context.Context, params *ListAssociatedAccessPoliciesInput, optFns ...func(*Options)) (*ListAssociatedAccessPoliciesOutput, error) { - if params == nil { - params = &ListAssociatedAccessPoliciesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAssociatedAccessPolicies", params, optFns, c.addOperationListAssociatedAccessPoliciesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAssociatedAccessPoliciesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAssociatedAccessPoliciesInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . - // - // This member is required. - PrincipalArn *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAssociatedAccessPoliciesOutput struct { - - // The list of access policies associated with the access entry. - AssociatedAccessPolicies []types.AssociatedAccessPolicy - - // The name of your cluster. - ClusterName *string - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // The ARN of the IAM principal for the AccessEntry . - PrincipalArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAssociatedAccessPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssociatedAccessPolicies{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssociatedAccessPolicies{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAssociatedAccessPolicies"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAssociatedAccessPoliciesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociatedAccessPolicies(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAssociatedAccessPoliciesPaginatorOptions is the paginator options for -// ListAssociatedAccessPolicies -type ListAssociatedAccessPoliciesPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAssociatedAccessPoliciesPaginator is a paginator for -// ListAssociatedAccessPolicies -type ListAssociatedAccessPoliciesPaginator struct { - options ListAssociatedAccessPoliciesPaginatorOptions - client ListAssociatedAccessPoliciesAPIClient - params *ListAssociatedAccessPoliciesInput - nextToken *string - firstPage bool -} - -// NewListAssociatedAccessPoliciesPaginator returns a new -// ListAssociatedAccessPoliciesPaginator -func NewListAssociatedAccessPoliciesPaginator(client ListAssociatedAccessPoliciesAPIClient, params *ListAssociatedAccessPoliciesInput, optFns ...func(*ListAssociatedAccessPoliciesPaginatorOptions)) *ListAssociatedAccessPoliciesPaginator { - if params == nil { - params = &ListAssociatedAccessPoliciesInput{} - } - - options := ListAssociatedAccessPoliciesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAssociatedAccessPoliciesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAssociatedAccessPoliciesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAssociatedAccessPolicies page. -func (p *ListAssociatedAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedAccessPoliciesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAssociatedAccessPolicies(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAssociatedAccessPoliciesAPIClient is a client that implements the -// ListAssociatedAccessPolicies operation. -type ListAssociatedAccessPoliciesAPIClient interface { - ListAssociatedAccessPolicies(context.Context, *ListAssociatedAccessPoliciesInput, ...func(*Options)) (*ListAssociatedAccessPoliciesOutput, error) -} - -var _ ListAssociatedAccessPoliciesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAssociatedAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAssociatedAccessPolicies", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListCapabilities.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListCapabilities.go deleted file mode 100644 index 4148818315a2..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListCapabilities.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all managed capabilities in your Amazon EKS cluster. You can use this -// operation to get an overview of all capabilities and their current status. -func (c *Client) ListCapabilities(ctx context.Context, params *ListCapabilitiesInput, optFns ...func(*Options)) (*ListCapabilitiesOutput, error) { - if params == nil { - params = &ListCapabilitiesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCapabilities", params, optFns, c.addOperationListCapabilitiesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCapabilitiesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCapabilitiesInput struct { - - // The name of the Amazon EKS cluster for which you want to list capabilities. - // - // This member is required. - ClusterName *string - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. If you - // don't specify a value, the default is 100 results. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - NextToken *string - - noSmithyDocumentSerde -} - -type ListCapabilitiesOutput struct { - - // A list of capability summary objects, each containing basic information about a - // capability including its name, ARN, type, status, version, and timestamps. - Capabilities []types.CapabilitySummary - - // The nextToken value to include in a future ListCapabilities request. When the - // results of a ListCapabilities request exceed maxResults , you can use this value - // to retrieve the next page of results. This value is null when there are no more - // results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCapabilitiesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListCapabilities{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCapabilities{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCapabilities"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListCapabilitiesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCapabilities(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCapabilitiesPaginatorOptions is the paginator options for ListCapabilities -type ListCapabilitiesPaginatorOptions struct { - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. If you - // don't specify a value, the default is 100 results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCapabilitiesPaginator is a paginator for ListCapabilities -type ListCapabilitiesPaginator struct { - options ListCapabilitiesPaginatorOptions - client ListCapabilitiesAPIClient - params *ListCapabilitiesInput - nextToken *string - firstPage bool -} - -// NewListCapabilitiesPaginator returns a new ListCapabilitiesPaginator -func NewListCapabilitiesPaginator(client ListCapabilitiesAPIClient, params *ListCapabilitiesInput, optFns ...func(*ListCapabilitiesPaginatorOptions)) *ListCapabilitiesPaginator { - if params == nil { - params = &ListCapabilitiesInput{} - } - - options := ListCapabilitiesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCapabilitiesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCapabilitiesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCapabilities page. -func (p *ListCapabilitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCapabilitiesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCapabilities(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCapabilitiesAPIClient is a client that implements the ListCapabilities -// operation. -type ListCapabilitiesAPIClient interface { - ListCapabilities(context.Context, *ListCapabilitiesInput, ...func(*Options)) (*ListCapabilitiesOutput, error) -} - -var _ ListCapabilitiesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCapabilities(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCapabilities", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListClusters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListClusters.go deleted file mode 100644 index f24df83c0479..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListClusters.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the Amazon EKS clusters in your Amazon Web Services account in the -// specified Amazon Web Services Region. -func (c *Client) ListClusters(ctx context.Context, params *ListClustersInput, optFns ...func(*Options)) (*ListClustersOutput, error) { - if params == nil { - params = &ListClustersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListClusters", params, optFns, c.addOperationListClustersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListClustersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListClustersInput struct { - - // Indicates whether external clusters are included in the returned list. Use ' all - // ' to return [https://docs.aws.amazon.com/eks/latest/userguide/eks-connector.html]connected clusters, or blank to return only Amazon EKS clusters. ' - // all ' must be in lowercase otherwise an error occurs. - // - // [https://docs.aws.amazon.com/eks/latest/userguide/eks-connector.html]: https://docs.aws.amazon.com/eks/latest/userguide/eks-connector.html - Include []string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListClustersOutput struct { - - // A list of all of the clusters for your account in the specified Amazon Web - // Services Region . - Clusters []string - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListClusters{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClusters{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListClusters"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClusters(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListClustersPaginatorOptions is the paginator options for ListClusters -type ListClustersPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListClustersPaginator is a paginator for ListClusters -type ListClustersPaginator struct { - options ListClustersPaginatorOptions - client ListClustersAPIClient - params *ListClustersInput - nextToken *string - firstPage bool -} - -// NewListClustersPaginator returns a new ListClustersPaginator -func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { - if params == nil { - params = &ListClustersInput{} - } - - options := ListClustersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListClustersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListClustersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListClusters page. -func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListClusters(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListClustersAPIClient is a client that implements the ListClusters operation. -type ListClustersAPIClient interface { - ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) -} - -var _ ListClustersAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListClusters", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListEksAnywhereSubscriptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListEksAnywhereSubscriptions.go deleted file mode 100644 index 32cf8b52dcc8..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListEksAnywhereSubscriptions.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Displays the full description of the subscription. -func (c *Client) ListEksAnywhereSubscriptions(ctx context.Context, params *ListEksAnywhereSubscriptionsInput, optFns ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, error) { - if params == nil { - params = &ListEksAnywhereSubscriptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListEksAnywhereSubscriptions", params, optFns, c.addOperationListEksAnywhereSubscriptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListEksAnywhereSubscriptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListEksAnywhereSubscriptionsInput struct { - - // An array of subscription statuses to filter on. - IncludeStatus []types.EksAnywhereSubscriptionStatus - - // The maximum number of cluster results returned by ListEksAnywhereSubscriptions - // in paginated output. When you use this parameter, ListEksAnywhereSubscriptions - // returns only maxResults results in a single page along with a nextToken response - // element. You can see the remaining results of the initial request by sending - // another ListEksAnywhereSubscriptions request with the returned nextToken value. - // This value can be between 1 and 100. If you don't use this parameter, - // ListEksAnywhereSubscriptions returns up to 10 results and a nextToken value if - // applicable. - MaxResults *int32 - - // The nextToken value returned from a previous paginated - // ListEksAnywhereSubscriptions request where maxResults was used and the results - // exceeded the value of that parameter. Pagination continues from the end of the - // previous results that returned the nextToken value. - NextToken *string - - noSmithyDocumentSerde -} - -type ListEksAnywhereSubscriptionsOutput struct { - - // The nextToken value to include in a future ListEksAnywhereSubscriptions - // request. When the results of a ListEksAnywhereSubscriptions request exceed - // maxResults, you can use this value to retrieve the next page of results. This - // value is null when there are no more results to return. - NextToken *string - - // A list of all subscription objects in the region, filtered by includeStatus and - // paginated by nextToken and maxResults. - Subscriptions []types.EksAnywhereSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListEksAnywhereSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListEksAnywhereSubscriptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEksAnywhereSubscriptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListEksAnywhereSubscriptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEksAnywhereSubscriptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListEksAnywhereSubscriptionsPaginatorOptions is the paginator options for -// ListEksAnywhereSubscriptions -type ListEksAnywhereSubscriptionsPaginatorOptions struct { - // The maximum number of cluster results returned by ListEksAnywhereSubscriptions - // in paginated output. When you use this parameter, ListEksAnywhereSubscriptions - // returns only maxResults results in a single page along with a nextToken response - // element. You can see the remaining results of the initial request by sending - // another ListEksAnywhereSubscriptions request with the returned nextToken value. - // This value can be between 1 and 100. If you don't use this parameter, - // ListEksAnywhereSubscriptions returns up to 10 results and a nextToken value if - // applicable. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListEksAnywhereSubscriptionsPaginator is a paginator for -// ListEksAnywhereSubscriptions -type ListEksAnywhereSubscriptionsPaginator struct { - options ListEksAnywhereSubscriptionsPaginatorOptions - client ListEksAnywhereSubscriptionsAPIClient - params *ListEksAnywhereSubscriptionsInput - nextToken *string - firstPage bool -} - -// NewListEksAnywhereSubscriptionsPaginator returns a new -// ListEksAnywhereSubscriptionsPaginator -func NewListEksAnywhereSubscriptionsPaginator(client ListEksAnywhereSubscriptionsAPIClient, params *ListEksAnywhereSubscriptionsInput, optFns ...func(*ListEksAnywhereSubscriptionsPaginatorOptions)) *ListEksAnywhereSubscriptionsPaginator { - if params == nil { - params = &ListEksAnywhereSubscriptionsInput{} - } - - options := ListEksAnywhereSubscriptionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListEksAnywhereSubscriptionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListEksAnywhereSubscriptionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListEksAnywhereSubscriptions page. -func (p *ListEksAnywhereSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListEksAnywhereSubscriptions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListEksAnywhereSubscriptionsAPIClient is a client that implements the -// ListEksAnywhereSubscriptions operation. -type ListEksAnywhereSubscriptionsAPIClient interface { - ListEksAnywhereSubscriptions(context.Context, *ListEksAnywhereSubscriptionsInput, ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, error) -} - -var _ ListEksAnywhereSubscriptionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListEksAnywhereSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListEksAnywhereSubscriptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListFargateProfiles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListFargateProfiles.go deleted file mode 100644 index b7122712ce70..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListFargateProfiles.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the Fargate profiles associated with the specified cluster in your Amazon -// Web Services account in the specified Amazon Web Services Region. -func (c *Client) ListFargateProfiles(ctx context.Context, params *ListFargateProfilesInput, optFns ...func(*Options)) (*ListFargateProfilesOutput, error) { - if params == nil { - params = &ListFargateProfilesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListFargateProfiles", params, optFns, c.addOperationListFargateProfilesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListFargateProfilesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListFargateProfilesInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListFargateProfilesOutput struct { - - // A list of all of the Fargate profiles associated with the specified cluster. - FargateProfileNames []string - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListFargateProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListFargateProfiles{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFargateProfiles{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListFargateProfiles"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListFargateProfilesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFargateProfiles(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListFargateProfilesPaginatorOptions is the paginator options for -// ListFargateProfiles -type ListFargateProfilesPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListFargateProfilesPaginator is a paginator for ListFargateProfiles -type ListFargateProfilesPaginator struct { - options ListFargateProfilesPaginatorOptions - client ListFargateProfilesAPIClient - params *ListFargateProfilesInput - nextToken *string - firstPage bool -} - -// NewListFargateProfilesPaginator returns a new ListFargateProfilesPaginator -func NewListFargateProfilesPaginator(client ListFargateProfilesAPIClient, params *ListFargateProfilesInput, optFns ...func(*ListFargateProfilesPaginatorOptions)) *ListFargateProfilesPaginator { - if params == nil { - params = &ListFargateProfilesInput{} - } - - options := ListFargateProfilesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListFargateProfilesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListFargateProfilesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListFargateProfiles page. -func (p *ListFargateProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFargateProfilesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListFargateProfiles(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListFargateProfilesAPIClient is a client that implements the -// ListFargateProfiles operation. -type ListFargateProfilesAPIClient interface { - ListFargateProfiles(context.Context, *ListFargateProfilesInput, ...func(*Options)) (*ListFargateProfilesOutput, error) -} - -var _ ListFargateProfilesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListFargateProfiles(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListFargateProfiles", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListIdentityProviderConfigs.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListIdentityProviderConfigs.go deleted file mode 100644 index 8d0f1d2415db..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListIdentityProviderConfigs.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the identity provider configurations for your cluster. -func (c *Client) ListIdentityProviderConfigs(ctx context.Context, params *ListIdentityProviderConfigsInput, optFns ...func(*Options)) (*ListIdentityProviderConfigsOutput, error) { - if params == nil { - params = &ListIdentityProviderConfigsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListIdentityProviderConfigs", params, optFns, c.addOperationListIdentityProviderConfigsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListIdentityProviderConfigsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListIdentityProviderConfigsInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListIdentityProviderConfigsOutput struct { - - // The identity provider configurations for the cluster. - IdentityProviderConfigs []types.IdentityProviderConfig - - // The nextToken value to include in a future ListIdentityProviderConfigsResponse - // request. When the results of a ListIdentityProviderConfigsResponse request - // exceed maxResults , you can use this value to retrieve the next page of results. - // This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListIdentityProviderConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListIdentityProviderConfigs{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIdentityProviderConfigs{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListIdentityProviderConfigs"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListIdentityProviderConfigsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIdentityProviderConfigs(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListIdentityProviderConfigsPaginatorOptions is the paginator options for -// ListIdentityProviderConfigs -type ListIdentityProviderConfigsPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListIdentityProviderConfigsPaginator is a paginator for -// ListIdentityProviderConfigs -type ListIdentityProviderConfigsPaginator struct { - options ListIdentityProviderConfigsPaginatorOptions - client ListIdentityProviderConfigsAPIClient - params *ListIdentityProviderConfigsInput - nextToken *string - firstPage bool -} - -// NewListIdentityProviderConfigsPaginator returns a new -// ListIdentityProviderConfigsPaginator -func NewListIdentityProviderConfigsPaginator(client ListIdentityProviderConfigsAPIClient, params *ListIdentityProviderConfigsInput, optFns ...func(*ListIdentityProviderConfigsPaginatorOptions)) *ListIdentityProviderConfigsPaginator { - if params == nil { - params = &ListIdentityProviderConfigsInput{} - } - - options := ListIdentityProviderConfigsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListIdentityProviderConfigsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListIdentityProviderConfigsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListIdentityProviderConfigs page. -func (p *ListIdentityProviderConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentityProviderConfigsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListIdentityProviderConfigs(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListIdentityProviderConfigsAPIClient is a client that implements the -// ListIdentityProviderConfigs operation. -type ListIdentityProviderConfigsAPIClient interface { - ListIdentityProviderConfigs(context.Context, *ListIdentityProviderConfigsInput, ...func(*Options)) (*ListIdentityProviderConfigsOutput, error) -} - -var _ ListIdentityProviderConfigsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListIdentityProviderConfigs(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListIdentityProviderConfigs", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListInsights.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListInsights.go deleted file mode 100644 index da8e4b3cea3b..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListInsights.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a list of all insights checked for against the specified cluster. You -// can filter which insights are returned by category, associated Kubernetes -// version, and status. The default filter lists all categories and every status. -// -// The following lists the available categories: -// -// - UPGRADE_READINESS : Amazon EKS identifies issues that could impact your -// ability to upgrade to new versions of Kubernetes. These are called upgrade -// insights. -// -// - MISCONFIGURATION : Amazon EKS identifies misconfiguration in your EKS Hybrid -// Nodes setup that could impair functionality of your cluster or workloads. These -// are called configuration insights. -func (c *Client) ListInsights(ctx context.Context, params *ListInsightsInput, optFns ...func(*Options)) (*ListInsightsOutput, error) { - if params == nil { - params = &ListInsightsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListInsights", params, optFns, c.addOperationListInsightsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListInsightsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListInsightsInput struct { - - // The name of the Amazon EKS cluster associated with the insights. - // - // This member is required. - ClusterName *string - - // The criteria to filter your list of insights for your cluster. You can filter - // which insights are returned by category, associated Kubernetes version, and - // status. - Filter *types.InsightsFilter - - // The maximum number of identity provider configurations returned by ListInsights - // in paginated output. When you use this parameter, ListInsights returns only - // maxResults results in a single page along with a nextToken response element. - // You can see the remaining results of the initial request by sending another - // ListInsights request with the returned nextToken value. This value can be - // between 1 and 100. If you don't use this parameter, ListInsights returns up to - // 100 results and a nextToken value, if applicable. - MaxResults *int32 - - // The nextToken value returned from a previous paginated ListInsights request. - // When the results of a ListInsights request exceed maxResults , you can use this - // value to retrieve the next page of results. This value is null when there are - // no more results to return. - NextToken *string - - noSmithyDocumentSerde -} - -type ListInsightsOutput struct { - - // The returned list of insights. - Insights []types.InsightSummary - - // The nextToken value to include in a future ListInsights request. When the - // results of a ListInsights request exceed maxResults , you can use this value to - // retrieve the next page of results. This value is null when there are no more - // results to return. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListInsightsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListInsights{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInsights{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListInsights"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListInsightsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInsights(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListInsightsPaginatorOptions is the paginator options for ListInsights -type ListInsightsPaginatorOptions struct { - // The maximum number of identity provider configurations returned by ListInsights - // in paginated output. When you use this parameter, ListInsights returns only - // maxResults results in a single page along with a nextToken response element. - // You can see the remaining results of the initial request by sending another - // ListInsights request with the returned nextToken value. This value can be - // between 1 and 100. If you don't use this parameter, ListInsights returns up to - // 100 results and a nextToken value, if applicable. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListInsightsPaginator is a paginator for ListInsights -type ListInsightsPaginator struct { - options ListInsightsPaginatorOptions - client ListInsightsAPIClient - params *ListInsightsInput - nextToken *string - firstPage bool -} - -// NewListInsightsPaginator returns a new ListInsightsPaginator -func NewListInsightsPaginator(client ListInsightsAPIClient, params *ListInsightsInput, optFns ...func(*ListInsightsPaginatorOptions)) *ListInsightsPaginator { - if params == nil { - params = &ListInsightsInput{} - } - - options := ListInsightsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListInsightsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListInsightsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListInsights page. -func (p *ListInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInsightsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListInsights(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListInsightsAPIClient is a client that implements the ListInsights operation. -type ListInsightsAPIClient interface { - ListInsights(context.Context, *ListInsightsInput, ...func(*Options)) (*ListInsightsOutput, error) -} - -var _ ListInsightsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListInsights(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListInsights", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListNodegroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListNodegroups.go deleted file mode 100644 index 0cf71f7d55ad..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListNodegroups.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the managed node groups associated with the specified cluster in your -// Amazon Web Services account in the specified Amazon Web Services Region. -// Self-managed node groups aren't listed. -func (c *Client) ListNodegroups(ctx context.Context, params *ListNodegroupsInput, optFns ...func(*Options)) (*ListNodegroupsOutput, error) { - if params == nil { - params = &ListNodegroupsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListNodegroups", params, optFns, c.addOperationListNodegroupsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListNodegroupsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListNodegroupsInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - noSmithyDocumentSerde -} - -type ListNodegroupsOutput struct { - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // A list of all of the node groups associated with the specified cluster. - Nodegroups []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListNodegroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListNodegroups{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNodegroups{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListNodegroups"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListNodegroupsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNodegroups(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListNodegroupsPaginatorOptions is the paginator options for ListNodegroups -type ListNodegroupsPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListNodegroupsPaginator is a paginator for ListNodegroups -type ListNodegroupsPaginator struct { - options ListNodegroupsPaginatorOptions - client ListNodegroupsAPIClient - params *ListNodegroupsInput - nextToken *string - firstPage bool -} - -// NewListNodegroupsPaginator returns a new ListNodegroupsPaginator -func NewListNodegroupsPaginator(client ListNodegroupsAPIClient, params *ListNodegroupsInput, optFns ...func(*ListNodegroupsPaginatorOptions)) *ListNodegroupsPaginator { - if params == nil { - params = &ListNodegroupsInput{} - } - - options := ListNodegroupsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListNodegroupsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListNodegroupsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListNodegroups page. -func (p *ListNodegroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodegroupsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListNodegroups(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListNodegroupsAPIClient is a client that implements the ListNodegroups -// operation. -type ListNodegroupsAPIClient interface { - ListNodegroups(context.Context, *ListNodegroupsInput, ...func(*Options)) (*ListNodegroupsOutput, error) -} - -var _ ListNodegroupsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListNodegroups(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListNodegroups", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListPodIdentityAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListPodIdentityAssociations.go deleted file mode 100644 index f3eba51543f3..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListPodIdentityAssociations.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// List the EKS Pod Identity associations in a cluster. You can filter the list by -// the namespace that the association is in or the service account that the -// association uses. -func (c *Client) ListPodIdentityAssociations(ctx context.Context, params *ListPodIdentityAssociationsInput, optFns ...func(*Options)) (*ListPodIdentityAssociationsOutput, error) { - if params == nil { - params = &ListPodIdentityAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListPodIdentityAssociations", params, optFns, c.addOperationListPodIdentityAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListPodIdentityAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListPodIdentityAssociationsInput struct { - - // The name of the cluster that the associations are in. - // - // This member is required. - ClusterName *string - - // The maximum number of EKS Pod Identity association results returned by - // ListPodIdentityAssociations in paginated output. When you use this parameter, - // ListPodIdentityAssociations returns only maxResults results in a single page - // along with a nextToken response element. You can see the remaining results of - // the initial request by sending another ListPodIdentityAssociations request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, ListPodIdentityAssociations returns up to 100 results and a - // nextToken value if applicable. - MaxResults *int32 - - // The name of the Kubernetes namespace inside the cluster that the associations - // are in. - Namespace *string - - // The nextToken value returned from a previous paginated ListUpdates request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // The name of the Kubernetes service account that the associations use. - ServiceAccount *string - - noSmithyDocumentSerde -} - -type ListPodIdentityAssociationsOutput struct { - - // The list of summarized descriptions of the associations that are in the cluster - // and match any filters that you provided. - // - // Each summary is simplified by removing these fields compared to the full [PodIdentityAssociation] - // PodIdentityAssociation : - // - // - The IAM role: roleArn - // - // - The timestamp that the association was created at: createdAt - // - // - The most recent timestamp that the association was modified at:. modifiedAt - // - // - The tags on the association: tags - // - // [PodIdentityAssociation]: https://docs.aws.amazon.com/eks/latest/APIReference/API_PodIdentityAssociation.html - Associations []types.PodIdentityAssociationSummary - - // The nextToken value to include in a future ListPodIdentityAssociations request. - // When the results of a ListPodIdentityAssociations request exceed maxResults , - // you can use this value to retrieve the next page of results. This value is null - // when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListPodIdentityAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListPodIdentityAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPodIdentityAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListPodIdentityAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListPodIdentityAssociationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPodIdentityAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListPodIdentityAssociationsPaginatorOptions is the paginator options for -// ListPodIdentityAssociations -type ListPodIdentityAssociationsPaginatorOptions struct { - // The maximum number of EKS Pod Identity association results returned by - // ListPodIdentityAssociations in paginated output. When you use this parameter, - // ListPodIdentityAssociations returns only maxResults results in a single page - // along with a nextToken response element. You can see the remaining results of - // the initial request by sending another ListPodIdentityAssociations request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, ListPodIdentityAssociations returns up to 100 results and a - // nextToken value if applicable. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListPodIdentityAssociationsPaginator is a paginator for -// ListPodIdentityAssociations -type ListPodIdentityAssociationsPaginator struct { - options ListPodIdentityAssociationsPaginatorOptions - client ListPodIdentityAssociationsAPIClient - params *ListPodIdentityAssociationsInput - nextToken *string - firstPage bool -} - -// NewListPodIdentityAssociationsPaginator returns a new -// ListPodIdentityAssociationsPaginator -func NewListPodIdentityAssociationsPaginator(client ListPodIdentityAssociationsAPIClient, params *ListPodIdentityAssociationsInput, optFns ...func(*ListPodIdentityAssociationsPaginatorOptions)) *ListPodIdentityAssociationsPaginator { - if params == nil { - params = &ListPodIdentityAssociationsInput{} - } - - options := ListPodIdentityAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListPodIdentityAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListPodIdentityAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListPodIdentityAssociations page. -func (p *ListPodIdentityAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPodIdentityAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListPodIdentityAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListPodIdentityAssociationsAPIClient is a client that implements the -// ListPodIdentityAssociations operation. -type ListPodIdentityAssociationsAPIClient interface { - ListPodIdentityAssociations(context.Context, *ListPodIdentityAssociationsInput, ...func(*Options)) (*ListPodIdentityAssociationsOutput, error) -} - -var _ ListPodIdentityAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListPodIdentityAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListPodIdentityAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListTagsForResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListTagsForResource.go deleted file mode 100644 index dce75d9a6466..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListTagsForResource.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// List the tags for an Amazon EKS resource. -func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if params == nil { - params = &ListTagsForResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTagsForResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTagsForResourceInput struct { - - // The Amazon Resource Name (ARN) that identifies the resource to list tags for. - // - // This member is required. - ResourceArn *string - - noSmithyDocumentSerde -} - -type ListTagsForResourceOutput struct { - - // The tags for the resource. - Tags map[string]string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTagsForResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListUpdates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListUpdates.go deleted file mode 100644 index d2791515562f..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListUpdates.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the updates associated with an Amazon EKS resource in your Amazon Web -// Services account, in the specified Amazon Web Services Region. -func (c *Client) ListUpdates(ctx context.Context, params *ListUpdatesInput, optFns ...func(*Options)) (*ListUpdatesOutput, error) { - if params == nil { - params = &ListUpdatesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListUpdates", params, optFns, c.addOperationListUpdatesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListUpdatesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListUpdatesInput struct { - - // The name of the Amazon EKS cluster to list updates for. - // - // This member is required. - Name *string - - // The names of the installed add-ons that have available updates. - AddonName *string - - // The name of the capability for which you want to list updates. - CapabilityName *string - - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - MaxResults *int32 - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // The name of the Amazon EKS managed node group to list updates for. - NodegroupName *string - - noSmithyDocumentSerde -} - -type ListUpdatesOutput struct { - - // The nextToken value returned from a previous paginated request, where maxResults - // was used and the results exceeded the value of that parameter. Pagination - // continues from the end of the previous results that returned the nextToken - // value. This value is null when there are no more results to return. - // - // This token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string - - // A list of all the updates for the specified cluster and Region. - UpdateIds []string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListUpdatesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListUpdates{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUpdates{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListUpdates"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListUpdatesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUpdates(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListUpdatesPaginatorOptions is the paginator options for ListUpdates -type ListUpdatesPaginatorOptions struct { - // The maximum number of results, returned in paginated output. You receive - // maxResults in a single page, along with a nextToken response element. You can - // see the remaining results of the initial request by sending another request with - // the returned nextToken value. This value can be between 1 and 100. If you don't - // use this parameter, 100 results and a nextToken value, if applicable, are - // returned. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListUpdatesPaginator is a paginator for ListUpdates -type ListUpdatesPaginator struct { - options ListUpdatesPaginatorOptions - client ListUpdatesAPIClient - params *ListUpdatesInput - nextToken *string - firstPage bool -} - -// NewListUpdatesPaginator returns a new ListUpdatesPaginator -func NewListUpdatesPaginator(client ListUpdatesAPIClient, params *ListUpdatesInput, optFns ...func(*ListUpdatesPaginatorOptions)) *ListUpdatesPaginator { - if params == nil { - params = &ListUpdatesInput{} - } - - options := ListUpdatesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListUpdatesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListUpdatesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListUpdates page. -func (p *ListUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUpdatesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListUpdates(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListUpdatesAPIClient is a client that implements the ListUpdates operation. -type ListUpdatesAPIClient interface { - ListUpdates(context.Context, *ListUpdatesInput, ...func(*Options)) (*ListUpdatesOutput, error) -} - -var _ ListUpdatesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListUpdates(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListUpdates", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_RegisterCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_RegisterCluster.go deleted file mode 100644 index 66461658a439..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_RegisterCluster.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Connects a Kubernetes cluster to the Amazon EKS control plane. -// -// Any Kubernetes cluster can be connected to the Amazon EKS control plane to view -// current information about the cluster and its nodes. -// -// Cluster connection requires two steps. First, send a [RegisterClusterRequest]RegisterClusterRequest to -// add it to the Amazon EKS control plane. -// -// Second, a [Manifest] containing the activationID and activationCode must be applied to -// the Kubernetes cluster through it's native provider to provide visibility. -// -// After the manifest is updated and applied, the connected cluster is visible to -// the Amazon EKS control plane. If the manifest isn't applied within three days, -// the connected cluster will no longer be visible and must be deregistered using -// DeregisterCluster . -// -// [RegisterClusterRequest]: https://docs.aws.amazon.com/eks/latest/APIReference/API_RegisterClusterRequest.html -// [Manifest]: https://amazon-eks.s3.us-west-2.amazonaws.com/eks-connector/manifests/eks-connector/latest/eks-connector.yaml -func (c *Client) RegisterCluster(ctx context.Context, params *RegisterClusterInput, optFns ...func(*Options)) (*RegisterClusterOutput, error) { - if params == nil { - params = &RegisterClusterInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterCluster", params, optFns, c.addOperationRegisterClusterMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterClusterOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterClusterInput struct { - - // The configuration settings required to connect the Kubernetes cluster to the - // Amazon EKS control plane. - // - // This member is required. - ConnectorConfig *types.ConnectorConfigRequest - - // A unique name for this cluster in your Amazon Web Services Region. - // - // This member is required. - Name *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -type RegisterClusterOutput struct { - - // An object representing an Amazon EKS cluster. - Cluster *types.Cluster - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterCluster{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterCluster{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterCluster"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opRegisterClusterMiddleware(stack, options); err != nil { - return err - } - if err = addOpRegisterClusterValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterCluster(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpRegisterCluster struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpRegisterCluster) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpRegisterCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*RegisterClusterInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *RegisterClusterInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opRegisterClusterMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpRegisterCluster{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opRegisterCluster(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterCluster", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_StartInsightsRefresh.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_StartInsightsRefresh.go deleted file mode 100644 index ecf9bb9b9f56..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_StartInsightsRefresh.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Initiates an on-demand refresh operation for cluster insights, getting the -// latest analysis outside of the standard refresh schedule. -func (c *Client) StartInsightsRefresh(ctx context.Context, params *StartInsightsRefreshInput, optFns ...func(*Options)) (*StartInsightsRefreshOutput, error) { - if params == nil { - params = &StartInsightsRefreshInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartInsightsRefresh", params, optFns, c.addOperationStartInsightsRefreshMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartInsightsRefreshOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartInsightsRefreshInput struct { - - // The name of the cluster for the refresh insights operation. - // - // This member is required. - ClusterName *string - - noSmithyDocumentSerde -} - -type StartInsightsRefreshOutput struct { - - // The message associated with the insights refresh operation. - Message *string - - // The current status of the insights refresh operation. - Status types.InsightsRefreshStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartInsightsRefreshMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpStartInsightsRefresh{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartInsightsRefresh{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartInsightsRefresh"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartInsightsRefreshValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartInsightsRefresh(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartInsightsRefresh(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartInsightsRefresh", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_TagResource.go deleted file mode 100644 index 23c6f393d9ed..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_TagResource.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates the specified tags to an Amazon EKS resource with the specified -// resourceArn . If existing tags on a resource are not specified in the request -// parameters, they aren't changed. When a resource is deleted, the tags associated -// with that resource are also deleted. Tags that you create for Amazon EKS -// resources don't propagate to any other resources associated with the cluster. -// For example, if you tag a cluster with this operation, that tag doesn't -// automatically propagate to the subnets and nodes associated with the cluster. -func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { - if params == nil { - params = &TagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TagResourceInput struct { - - // The Amazon Resource Name (ARN) of the resource to add tags to. - // - // This member is required. - ResourceArn *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - // - // This member is required. - Tags map[string]string - - noSmithyDocumentSerde -} - -type TagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UntagResource.go deleted file mode 100644 index 4e97988d7f52..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UntagResource.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes specified tags from an Amazon EKS resource. -func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { - if params == nil { - params = &UntagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UntagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UntagResourceInput struct { - - // The Amazon Resource Name (ARN) of the resource to delete tags from. - // - // This member is required. - ResourceArn *string - - // The keys of the tags to remove. - // - // This member is required. - TagKeys []string - - noSmithyDocumentSerde -} - -type UntagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUntagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UntagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAccessEntry.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAccessEntry.go deleted file mode 100644 index 1e0f40c6d99d..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAccessEntry.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an access entry. -func (c *Client) UpdateAccessEntry(ctx context.Context, params *UpdateAccessEntryInput, optFns ...func(*Options)) (*UpdateAccessEntryOutput, error) { - if params == nil { - params = &UpdateAccessEntryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateAccessEntry", params, optFns, c.addOperationUpdateAccessEntryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateAccessEntryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateAccessEntryInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The ARN of the IAM principal for the AccessEntry . - // - // This member is required. - PrincipalArn *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The value for name that you've specified for kind: Group as a subject in a - // Kubernetes RoleBinding or ClusterRoleBinding object. Amazon EKS doesn't confirm - // that the value for name exists in any bindings on your cluster. You can specify - // one or more names. - // - // Kubernetes authorizes the principalArn of the access entry to access any - // cluster objects that you've specified in a Kubernetes Role or ClusterRole - // object that is also specified in a binding's roleRef . For more information - // about creating Kubernetes RoleBinding , ClusterRoleBinding , Role , or - // ClusterRole objects, see [Using RBAC Authorization in the Kubernetes documentation]. - // - // If you want Amazon EKS to authorize the principalArn (instead of, or in - // addition to Kubernetes authorizing the principalArn ), you can associate one or - // more access policies to the access entry using AssociateAccessPolicy . If you - // associate any access policies, the principalARN has all permissions assigned in - // the associated access policies and all permissions in any Kubernetes Role or - // ClusterRole objects that the group names are bound to. - // - // [Using RBAC Authorization in the Kubernetes documentation]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ - KubernetesGroups []string - - // The username to authenticate to Kubernetes with. We recommend not specifying a - // username and letting Amazon EKS specify it for you. For more information about - // the value Amazon EKS specifies for you, or constraints before specifying your - // own username, see [Creating access entries]in the Amazon EKS User Guide. - // - // [Creating access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html#creating-access-entries - Username *string - - noSmithyDocumentSerde -} - -type UpdateAccessEntryOutput struct { - - // The ARN of the IAM principal for the AccessEntry . - AccessEntry *types.AccessEntry - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateAccessEntryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAccessEntry{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAccessEntry{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAccessEntry"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateAccessEntryMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateAccessEntryValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccessEntry(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateAccessEntry struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateAccessEntry) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAccessEntryInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateAccessEntryMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAccessEntry{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateAccessEntry(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateAccessEntry", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAddon.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAddon.go deleted file mode 100644 index eb849fc1a7e0..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAddon.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an Amazon EKS add-on. -func (c *Client) UpdateAddon(ctx context.Context, params *UpdateAddonInput, optFns ...func(*Options)) (*UpdateAddonOutput, error) { - if params == nil { - params = &UpdateAddonInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateAddon", params, optFns, c.addOperationUpdateAddonMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateAddonOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateAddonInput struct { - - // The name of the add-on. The name must match one of the names returned by [ListAddons] - // ListAddons . - // - // [ListAddons]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html - // - // This member is required. - AddonName *string - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The version of the add-on. The version must match one of the versions returned - // by [DescribeAddonVersions]DescribeAddonVersions . - // - // [DescribeAddonVersions]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html - AddonVersion *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The set of configuration values for the add-on that's created. The values that - // you provide are validated against the schema returned by - // DescribeAddonConfiguration . - ConfigurationValues *string - - // An array of EKS Pod Identity associations to be updated. Each association maps - // a Kubernetes service account to an IAM role. If this value is left blank, no - // change. If an empty array is provided, existing associations owned by the add-on - // are deleted. - // - // For more information, see [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity] in the Amazon EKS User Guide. - // - // [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html - PodIdentityAssociations []types.AddonPodIdentityAssociations - - // How to resolve field value conflicts for an Amazon EKS add-on if you've changed - // a value from the Amazon EKS default value. Conflicts are handled based on the - // option you choose: - // - // - None – Amazon EKS doesn't change the value. The update might fail. - // - // - Overwrite – Amazon EKS overwrites the changed value back to the Amazon EKS - // default value. - // - // - Preserve – Amazon EKS preserves the value. If you choose this option, we - // recommend that you test any field and value changes on a non-production cluster - // before updating the add-on on your production cluster. - ResolveConflicts types.ResolveConflicts - - // The Amazon Resource Name (ARN) of an existing IAM role to bind to the add-on's - // service account. The role must be assigned the IAM permissions required by the - // add-on. If you don't specify an existing IAM role, then the add-on uses the - // permissions assigned to the node IAM role. For more information, see [Amazon EKS node IAM role]in the - // Amazon EKS User Guide. - // - // To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) - // provider created for your cluster. For more information, see [Enabling IAM roles for service accounts on your cluster]in the Amazon EKS - // User Guide. - // - // [Enabling IAM roles for service accounts on your cluster]: https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html - // [Amazon EKS node IAM role]: https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html - ServiceAccountRoleArn *string - - noSmithyDocumentSerde -} - -type UpdateAddonOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateAddonMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAddon{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAddon{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAddon"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateAddonMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateAddonValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAddon(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateAddon struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateAddon) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateAddonInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAddonInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateAddonMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAddon{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateAddon(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateAddon", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateCapability.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateCapability.go deleted file mode 100644 index 8bde094521e7..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateCapability.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates the configuration of a managed capability in your Amazon EKS cluster. -// You can update the IAM role, configuration settings, and delete propagation -// policy for a capability. -// -// When you update a capability, Amazon EKS applies the changes and may restart -// capability components as needed. The capability remains available during the -// update process, but some operations may be temporarily unavailable. -func (c *Client) UpdateCapability(ctx context.Context, params *UpdateCapabilityInput, optFns ...func(*Options)) (*UpdateCapabilityOutput, error) { - if params == nil { - params = &UpdateCapabilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateCapability", params, optFns, c.addOperationUpdateCapabilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateCapabilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateCapabilityInput struct { - - // The name of the capability to update configuration for. - // - // This member is required. - CapabilityName *string - - // The name of the Amazon EKS cluster that contains the capability you want to - // update configuration for. - // - // This member is required. - ClusterName *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. This token is valid for 24 hours after creation. - ClientRequestToken *string - - // The updated configuration settings for the capability. You only need to specify - // the configuration parameters you want to change. For Argo CD capabilities, you - // can update RBAC role mappings and network access settings. - Configuration *types.UpdateCapabilityConfiguration - - // The updated delete propagation policy for the capability. Currently, the only - // supported value is RETAIN . - DeletePropagationPolicy types.CapabilityDeletePropagationPolicy - - // The Amazon Resource Name (ARN) of the IAM role that the capability uses to - // interact with Amazon Web Services services. If you specify a new role ARN, the - // capability will start using the new role for all subsequent operations. - RoleArn *string - - noSmithyDocumentSerde -} - -type UpdateCapabilityOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateCapabilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCapability{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCapability{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCapability"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateCapabilityMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateCapabilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCapability(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateCapability struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateCapability) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateCapabilityInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateCapabilityMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateCapability{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateCapability(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateCapability", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterConfig.go deleted file mode 100644 index fd179254da27..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterConfig.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an Amazon EKS cluster configuration. Your cluster continues to function -// during the update. The response output includes an update ID that you can use to -// track the status of your cluster update with DescribeUpdate . -// -// You can use this operation to do the following actions: -// -// - You can use this API operation to enable or disable exporting the -// Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, -// cluster control plane logs aren't exported to CloudWatch Logs. For more -// information, see [Amazon EKS Cluster control plane logs]in the Amazon EKS User Guide . -// -// CloudWatch Logs ingestion, archive storage, and data scanning rates apply to -// -// exported control plane logs. For more information, see [CloudWatch Pricing]. -// -// - You can also use this API operation to enable or disable public and private -// access to your cluster's Kubernetes API server endpoint. By default, public -// access is enabled, and private access is disabled. For more information, see [Cluster API server endpoint] -// in the Amazon EKS User Guide . -// -// - You can also use this API operation to choose different subnets and -// security groups for the cluster. You must specify at least two subnets that are -// in different Availability Zones. You can't change which VPC the subnets are -// from, the subnets must be in the same VPC as the subnets that the cluster was -// created with. For more information about the VPC requirements, see [https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html]in the -// Amazon EKS User Guide . -// -// - You can also use this API operation to enable or disable ARC zonal shift. -// If zonal shift is enabled, Amazon Web Services configures zonal autoshift for -// the cluster. -// -// - You can also use this API operation to add, change, or remove the -// configuration in the cluster for EKS Hybrid Nodes. To remove the configuration, -// use the remoteNetworkConfig key with an object containing both subkeys with -// empty arrays for each. Here is an inline example: "remoteNetworkConfig": { -// "remoteNodeNetworks": [], "remotePodNetworks": [] } . -// -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful ), the cluster status moves to Active . -// -// [Amazon EKS Cluster control plane logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html -// -// [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html -// [CloudWatch Pricing]: http://aws.amazon.com/cloudwatch/pricing/ -// [https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html -func (c *Client) UpdateClusterConfig(ctx context.Context, params *UpdateClusterConfigInput, optFns ...func(*Options)) (*UpdateClusterConfigOutput, error) { - if params == nil { - params = &UpdateClusterConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateClusterConfig", params, optFns, c.addOperationUpdateClusterConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateClusterConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateClusterConfigInput struct { - - // The name of the Amazon EKS cluster to update. - // - // This member is required. - Name *string - - // The access configuration for the cluster. - AccessConfig *types.UpdateAccessConfigRequest - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Update the configuration of the compute capability of your EKS Auto Mode - // cluster. For example, enable the capability. - ComputeConfig *types.ComputeConfigRequest - - // The control plane scaling tier configuration. For more information, see EKS - // Provisioned Control Plane in the Amazon EKS User Guide. - ControlPlaneScalingConfig *types.ControlPlaneScalingConfig - - // Specifies whether to enable or disable deletion protection for the cluster. - // When enabled ( true ), the cluster cannot be deleted until deletion protection - // is explicitly disabled. When disabled ( false ), the cluster can be deleted - // normally. - DeletionProtection *bool - - // The Kubernetes network configuration for the cluster. - KubernetesNetworkConfig *types.KubernetesNetworkConfigRequest - - // Enable or disable exporting the Kubernetes control plane logs for your cluster - // to CloudWatch Logs . By default, cluster control plane logs aren't exported to - // CloudWatch Logs . For more information, see [Amazon EKS cluster control plane logs]in the Amazon EKS User Guide . - // - // CloudWatch Logs ingestion, archive storage, and data scanning rates apply to - // exported control plane logs. For more information, see [CloudWatch Pricing]. - // - // [CloudWatch Pricing]: http://aws.amazon.com/cloudwatch/pricing/ - // [Amazon EKS cluster control plane logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html - Logging *types.Logging - - // The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or - // remove this configuration after the cluster is created. - RemoteNetworkConfig *types.RemoteNetworkConfigRequest - - // An object representing the VPC configuration to use for an Amazon EKS cluster. - ResourcesVpcConfig *types.VpcConfigRequest - - // Update the configuration of the block storage capability of your EKS Auto Mode - // cluster. For example, enable the capability. - StorageConfig *types.StorageConfigRequest - - // You can enable or disable extended support for clusters currently on standard - // support. You cannot disable extended support once it starts. You must enable - // extended support before your cluster exits standard support. - UpgradePolicy *types.UpgradePolicyRequest - - // Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, - // Amazon Web Services configures zonal autoshift for the cluster. - // - // Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC - // zonal shift is designed to be a temporary measure that allows you to move - // traffic for a resource away from an impaired AZ until the zonal shift expires or - // you cancel it. You can extend the zonal shift if necessary. - // - // You can start a zonal shift for an EKS cluster, or you can allow Amazon Web - // Services to do it for you by enabling zonal autoshift. This shift updates the - // flow of east-to-west network traffic in your cluster to only consider network - // endpoints for Pods running on worker nodes in healthy AZs. Additionally, any ALB - // or NLB handling ingress traffic for applications in your EKS cluster will - // automatically route traffic to targets in the healthy AZs. For more information - // about zonal shift in EKS, see [Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS]in the Amazon EKS User Guide . - // - // [Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS]: https://docs.aws.amazon.com/eks/latest/userguide/zone-shift.html - ZonalShiftConfig *types.ZonalShiftConfigRequest - - noSmithyDocumentSerde -} - -type UpdateClusterConfigOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateClusterConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClusterConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClusterConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateClusterConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateClusterConfigMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateClusterConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClusterConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateClusterConfig struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateClusterConfig) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateClusterConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateClusterConfigInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateClusterConfigInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateClusterConfigMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateClusterConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateClusterConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateClusterConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterVersion.go deleted file mode 100644 index 33a371e081c7..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterVersion.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster -// continues to function during the update. The response output includes an update -// ID that you can use to track the status of your cluster update with the [DescribeUpdate] -// DescribeUpdate API operation. -// -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful ), the cluster status moves to Active . -// -// If your cluster has managed node groups attached to it, all of your node -// groups' Kubernetes versions must match the cluster's Kubernetes version in order -// to update the cluster to a new Kubernetes version. -// -// [DescribeUpdate]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeUpdate.html -func (c *Client) UpdateClusterVersion(ctx context.Context, params *UpdateClusterVersionInput, optFns ...func(*Options)) (*UpdateClusterVersionOutput, error) { - if params == nil { - params = &UpdateClusterVersionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateClusterVersion", params, optFns, c.addOperationUpdateClusterVersionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateClusterVersionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateClusterVersionInput struct { - - // The name of the Amazon EKS cluster to update. - // - // This member is required. - Name *string - - // The desired Kubernetes version following a successful update. - // - // This member is required. - Version *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Set this value to true to override upgrade-blocking readiness checks when - // updating a cluster. - Force bool - - noSmithyDocumentSerde -} - -type UpdateClusterVersionOutput struct { - - // The full description of the specified update - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateClusterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClusterVersion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClusterVersion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateClusterVersion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateClusterVersionMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateClusterVersionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClusterVersion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateClusterVersion struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateClusterVersion) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateClusterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateClusterVersionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateClusterVersionInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateClusterVersionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateClusterVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateClusterVersion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateClusterVersion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateEksAnywhereSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateEksAnywhereSubscription.go deleted file mode 100644 index 553a643c0e3f..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateEksAnywhereSubscription.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Update an EKS Anywhere Subscription. Only auto renewal and tags can be updated -// after subscription creation. -func (c *Client) UpdateEksAnywhereSubscription(ctx context.Context, params *UpdateEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*UpdateEksAnywhereSubscriptionOutput, error) { - if params == nil { - params = &UpdateEksAnywhereSubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateEksAnywhereSubscription", params, optFns, c.addOperationUpdateEksAnywhereSubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateEksAnywhereSubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateEksAnywhereSubscriptionInput struct { - - // A boolean indicating whether or not to automatically renew the subscription. - // - // This member is required. - AutoRenew bool - - // The ID of the subscription. - // - // This member is required. - Id *string - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - ClientRequestToken *string - - noSmithyDocumentSerde -} - -type UpdateEksAnywhereSubscriptionOutput struct { - - // The full description of the updated subscription. - Subscription *types.EksAnywhereSubscription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEksAnywhereSubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateEksAnywhereSubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateEksAnywhereSubscriptionMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEksAnywhereSubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateEksAnywhereSubscription struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateEksAnywhereSubscription) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateEksAnywhereSubscriptionInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateEksAnywhereSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateEksAnywhereSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateEksAnywhereSubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupConfig.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupConfig.go deleted file mode 100644 index 9a09c2504125..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupConfig.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an Amazon EKS managed node group configuration. Your node group -// continues to function during the update. The response output includes an update -// ID that you can use to track the status of your node group update with the [DescribeUpdate] -// DescribeUpdate API operation. You can update the Kubernetes labels and taints -// for a node group and the scaling and version update configuration. -// -// [DescribeUpdate]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeUpdate.html -func (c *Client) UpdateNodegroupConfig(ctx context.Context, params *UpdateNodegroupConfigInput, optFns ...func(*Options)) (*UpdateNodegroupConfigOutput, error) { - if params == nil { - params = &UpdateNodegroupConfigInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateNodegroupConfig", params, optFns, c.addOperationUpdateNodegroupConfigMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateNodegroupConfigOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateNodegroupConfigInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the managed node group to update. - // - // This member is required. - NodegroupName *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // The Kubernetes labels to apply to the nodes in the node group after the update. - Labels *types.UpdateLabelsPayload - - // The node auto repair configuration for the node group. - NodeRepairConfig *types.NodeRepairConfig - - // The scaling configuration details for the Auto Scaling group after the update. - ScalingConfig *types.NodegroupScalingConfig - - // The Kubernetes taints to be applied to the nodes in the node group after the - // update. For more information, see [Node taints on managed node groups]. - // - // [Node taints on managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/node-taints-managed-node-groups.html - Taints *types.UpdateTaintsPayload - - // The node group update configuration. - UpdateConfig *types.NodegroupUpdateConfig - - noSmithyDocumentSerde -} - -type UpdateNodegroupConfigOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateNodegroupConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateNodegroupConfig{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateNodegroupConfig{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateNodegroupConfig"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateNodegroupConfigMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateNodegroupConfigValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNodegroupConfig(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateNodegroupConfig struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateNodegroupConfig) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateNodegroupConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateNodegroupConfigInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateNodegroupConfigInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateNodegroupConfigMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateNodegroupConfig{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateNodegroupConfig(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateNodegroupConfig", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupVersion.go deleted file mode 100644 index 5dec84bb8f51..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupVersion.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates the Kubernetes version or AMI version of an Amazon EKS managed node -// group. -// -// You can update a node group using a launch template only if the node group was -// originally deployed with a launch template. Additionally, the launch template ID -// or name must match what was used when the node group was created. You can update -// the launch template version with necessary changes. -// -// If you need to update a custom AMI in a node group that was deployed with a -// launch template, then update your custom AMI, specify the new ID in a new -// version of the launch template, and then update the node group to the new -// version of the launch template. -// -// If you update without a launch template, then you can update to the latest -// available AMI version of a node group's current Kubernetes version by not -// specifying a Kubernetes version in the request. You can update to the latest AMI -// version of your cluster's current Kubernetes version by specifying your -// cluster's Kubernetes version in the request. For information about Linux -// versions, see [Amazon EKS optimized Amazon Linux AMI versions]in the Amazon EKS User Guide. For information about Windows -// versions, see [Amazon EKS optimized Windows AMI versions]in the Amazon EKS User Guide. -// -// You cannot roll back a node group to an earlier Kubernetes version or AMI -// version. -// -// When a node in a managed node group is terminated due to a scaling action or -// update, every Pod on that node is drained first. Amazon EKS attempts to drain -// the nodes gracefully and will fail if it is unable to do so. You can force the -// update if Amazon EKS is unable to drain the nodes as a result of a Pod -// disruption budget issue. -// -// [Amazon EKS optimized Amazon Linux AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html -// [Amazon EKS optimized Windows AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html -func (c *Client) UpdateNodegroupVersion(ctx context.Context, params *UpdateNodegroupVersionInput, optFns ...func(*Options)) (*UpdateNodegroupVersionOutput, error) { - if params == nil { - params = &UpdateNodegroupVersionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateNodegroupVersion", params, optFns, c.addOperationUpdateNodegroupVersionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateNodegroupVersionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateNodegroupVersionInput struct { - - // The name of your cluster. - // - // This member is required. - ClusterName *string - - // The name of the managed node group to update. - // - // This member is required. - NodegroupName *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Force the update if any Pod on the existing node group can't be drained due to - // a Pod disruption budget issue. If an update fails because all Pods can't be - // drained, you can force the update after it fails to terminate the old node - // whether or not any Pod is running on the node. - Force bool - - // An object representing a node group's launch template specification. You can - // only update a node group using a launch template if the node group was - // originally deployed with a launch template. When updating, you must specify the - // same launch template ID or name that was used to create the node group. - LaunchTemplate *types.LaunchTemplateSpecification - - // The AMI version of the Amazon EKS optimized AMI to use for the update. By - // default, the latest available AMI version for the node group's Kubernetes - // version is used. For information about Linux versions, see [Amazon EKS optimized Amazon Linux AMI versions]in the Amazon EKS - // User Guide. Amazon EKS managed node groups support the November 2022 and later - // releases of the Windows AMIs. For information about Windows versions, see [Amazon EKS optimized Windows AMI versions]in - // the Amazon EKS User Guide. - // - // If you specify launchTemplate , and your launch template uses a custom AMI, then - // don't specify releaseVersion , or the node group update will fail. For more - // information about using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS - // User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - // [Amazon EKS optimized Amazon Linux AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html - // [Amazon EKS optimized Windows AMI versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-ami-versions-windows.html - ReleaseVersion *string - - // The Kubernetes version to update to. If no version is specified, then the node - // group will be updated to match the cluster's current Kubernetes version, and the - // latest available AMI for that version will be used. You can also specify the - // Kubernetes version of the cluster to update the node group to the latest AMI - // version of the cluster's Kubernetes version. If you specify launchTemplate , and - // your launch template uses a custom AMI, then don't specify version , or the node - // group update will fail. For more information about using launch templates with - // Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. - // - // [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html - Version *string - - noSmithyDocumentSerde -} - -type UpdateNodegroupVersionOutput struct { - - // An object representing an asynchronous update. - Update *types.Update - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateNodegroupVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateNodegroupVersion{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateNodegroupVersion{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateNodegroupVersion"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdateNodegroupVersionMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdateNodegroupVersionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNodegroupVersion(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdateNodegroupVersion struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdateNodegroupVersion) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdateNodegroupVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdateNodegroupVersionInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateNodegroupVersionInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdateNodegroupVersionMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateNodegroupVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdateNodegroupVersion(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateNodegroupVersion", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdatePodIdentityAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdatePodIdentityAssociation.go deleted file mode 100644 index 5e07eac2dbaa..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdatePodIdentityAssociation.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates a EKS Pod Identity association. In an update, you can change the IAM -// role, the target IAM role, or disableSessionTags . You must change at least one -// of these in an update. An association can't be moved between clusters, -// namespaces, or service accounts. If you need to edit the namespace or service -// account, you need to delete the association and then create a new association -// with your desired settings. -// -// Similar to Amazon Web Services IAM behavior, EKS Pod Identity associations are -// eventually consistent, and may take several seconds to be effective after the -// initial API call returns successfully. You must design your applications to -// account for these potential delays. We recommend that you don’t include -// association create/updates in the critical, high-availability code paths of your -// application. Instead, make changes in a separate initialization or setup routine -// that you run less frequently. -// -// You can set a target IAM role in the same or a different account for advanced -// scenarios. With a target role, EKS Pod Identity automatically performs two role -// assumptions in sequence: first assuming the role in the association that is in -// this account, then using those credentials to assume the target IAM role. This -// process provides your Pod with temporary credentials that have the permissions -// defined in the target role, allowing secure access to resources in another -// Amazon Web Services account. -func (c *Client) UpdatePodIdentityAssociation(ctx context.Context, params *UpdatePodIdentityAssociationInput, optFns ...func(*Options)) (*UpdatePodIdentityAssociationOutput, error) { - if params == nil { - params = &UpdatePodIdentityAssociationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdatePodIdentityAssociation", params, optFns, c.addOperationUpdatePodIdentityAssociationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdatePodIdentityAssociationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdatePodIdentityAssociationInput struct { - - // The ID of the association to be updated. - // - // This member is required. - AssociationId *string - - // The name of the cluster that you want to update the association in. - // - // This member is required. - ClusterName *string - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Disable the automatic sessions tags that are appended by EKS Pod Identity. - // - // EKS Pod Identity adds a pre-defined set of session tags when it assumes the - // role. You can use these tags to author a single role that can work across - // resources by allowing access to Amazon Web Services resources based on matching - // tags. By default, EKS Pod Identity attaches six tags, including tags for cluster - // name, namespace, and service account name. For the list of tags added by EKS Pod - // Identity, see [List of session tags added by EKS Pod Identity]in the Amazon EKS User Guide. - // - // Amazon Web Services compresses inline session policies, managed policy ARNs, - // and session tags into a packed binary format that has a separate limit. If you - // receive a PackedPolicyTooLarge error indicating the packed binary format has - // exceeded the size limit, you can attempt to reduce the size by disabling the - // session tags added by EKS Pod Identity. - // - // [List of session tags added by EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/pod-id-abac.html#pod-id-abac-tags - DisableSessionTags *bool - - // The new IAM role to change in the association. - RoleArn *string - - // The Amazon Resource Name (ARN) of the target IAM role to associate with the - // service account. This role is assumed by using the EKS Pod Identity association - // role, then the credentials for this role are injected into the Pod. - // - // When you run applications on Amazon EKS, your application might need to access - // Amazon Web Services resources from a different role that exists in the same or - // different Amazon Web Services account. For example, your application running in - // “Account A” might need to access resources, such as buckets in “Account B” or - // within “Account A” itself. You can create a association to access Amazon Web - // Services resources in “Account B” by creating two IAM roles: a role in “Account - // A” and a role in “Account B” (which can be the same or different account), each - // with the necessary trust and permission policies. After you provide these roles - // in the IAM role and Target IAM role fields, EKS will perform role chaining to - // ensure your application gets the required permissions. This means Role A will - // assume Role B, allowing your Pods to securely access resources like S3 buckets - // in the target account. - TargetRoleArn *string - - noSmithyDocumentSerde -} - -type UpdatePodIdentityAssociationOutput struct { - - // The full description of the association that was updated. - Association *types.PodIdentityAssociation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdatePodIdentityAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePodIdentityAssociation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePodIdentityAssociation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addIdempotencyToken_opUpdatePodIdentityAssociationMiddleware(stack, options); err != nil { - return err - } - if err = addOpUpdatePodIdentityAssociationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePodIdentityAssociation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -type idempotencyToken_initializeOpUpdatePodIdentityAssociation struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpUpdatePodIdentityAssociation) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpUpdatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*UpdatePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdatePodIdentityAssociationInput ") - } - - if input.ClientRequestToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientRequestToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opUpdatePodIdentityAssociationMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpUpdatePodIdentityAssociation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opUpdatePodIdentityAssociation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdatePodIdentityAssociation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/auth.go deleted file mode 100644 index 0f2912da39d2..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/auth.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { - params.Region = options.Region - return nil -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { - params := &AuthResolverParameters{ - Operation: operation, - } - - if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { - return nil, err - } - - return params, nil -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "eks") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) - } - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/deserializers.go deleted file mode 100644 index 57ec7feabb23..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/deserializers.go +++ /dev/null @@ -1,18914 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strings" -) - -type awsRestjson1_deserializeOpAssociateAccessPolicy struct { -} - -func (*awsRestjson1_deserializeOpAssociateAccessPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpAssociateAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorAssociateAccessPolicy(response, &metadata) - } - output := &AssociateAccessPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentAssociateAccessPolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorAssociateAccessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentAssociateAccessPolicyOutput(v **AssociateAccessPolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AssociateAccessPolicyOutput - if *v == nil { - sv = &AssociateAccessPolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "associatedAccessPolicy": - if err := awsRestjson1_deserializeDocumentAssociatedAccessPolicy(&sv.AssociatedAccessPolicy, value); err != nil { - return err - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "principalArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PrincipalArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpAssociateEncryptionConfig struct { -} - -func (*awsRestjson1_deserializeOpAssociateEncryptionConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpAssociateEncryptionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorAssociateEncryptionConfig(response, &metadata) - } - output := &AssociateEncryptionConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentAssociateEncryptionConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorAssociateEncryptionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentAssociateEncryptionConfigOutput(v **AssociateEncryptionConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AssociateEncryptionConfigOutput - if *v == nil { - sv = &AssociateEncryptionConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpAssociateIdentityProviderConfig struct { -} - -func (*awsRestjson1_deserializeOpAssociateIdentityProviderConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpAssociateIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorAssociateIdentityProviderConfig(response, &metadata) - } - output := &AssociateIdentityProviderConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentAssociateIdentityProviderConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorAssociateIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentAssociateIdentityProviderConfigOutput(v **AssociateIdentityProviderConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AssociateIdentityProviderConfigOutput - if *v == nil { - sv = &AssociateIdentityProviderConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateAccessEntry struct { -} - -func (*awsRestjson1_deserializeOpCreateAccessEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateAccessEntry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAccessEntry(response, &metadata) - } - output := &CreateAccessEntryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateAccessEntryOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateAccessEntry(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateAccessEntryOutput(v **CreateAccessEntryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateAccessEntryOutput - if *v == nil { - sv = &CreateAccessEntryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessEntry": - if err := awsRestjson1_deserializeDocumentAccessEntry(&sv.AccessEntry, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateAddon struct { -} - -func (*awsRestjson1_deserializeOpCreateAddon) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateAddon(response, &metadata) - } - output := &CreateAddonOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateAddonOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateAddonOutput(v **CreateAddonOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateAddonOutput - if *v == nil { - sv = &CreateAddonOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addon": - if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateCapability struct { -} - -func (*awsRestjson1_deserializeOpCreateCapability) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateCapability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateCapability(response, &metadata) - } - output := &CreateCapabilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateCapabilityOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateCapability(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateCapabilityOutput(v **CreateCapabilityOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateCapabilityOutput - if *v == nil { - sv = &CreateCapabilityOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "capability": - if err := awsRestjson1_deserializeDocumentCapability(&sv.Capability, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateCluster struct { -} - -func (*awsRestjson1_deserializeOpCreateCluster) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateCluster(response, &metadata) - } - output := &CreateClusterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateClusterOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - case strings.EqualFold("UnsupportedAvailabilityZoneException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateClusterOutput(v **CreateClusterOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateClusterOutput - if *v == nil { - sv = &CreateClusterOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateEksAnywhereSubscription struct { -} - -func (*awsRestjson1_deserializeOpCreateEksAnywhereSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateEksAnywhereSubscription(response, &metadata) - } - output := &CreateEksAnywhereSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateEksAnywhereSubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateEksAnywhereSubscriptionOutput(v **CreateEksAnywhereSubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateEksAnywhereSubscriptionOutput - if *v == nil { - sv = &CreateEksAnywhereSubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateFargateProfile struct { -} - -func (*awsRestjson1_deserializeOpCreateFargateProfile) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFargateProfile(response, &metadata) - } - output := &CreateFargateProfileOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("UnsupportedAvailabilityZoneException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(v **CreateFargateProfileOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateFargateProfileOutput - if *v == nil { - sv = &CreateFargateProfileOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateNodegroup struct { -} - -func (*awsRestjson1_deserializeOpCreateNodegroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateNodegroup(response, &metadata) - } - output := &CreateNodegroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateNodegroupOutput - if *v == nil { - sv = &CreateNodegroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreatePodIdentityAssociation struct { -} - -func (*awsRestjson1_deserializeOpCreatePodIdentityAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreatePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreatePodIdentityAssociation(response, &metadata) - } - output := &CreatePodIdentityAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentCreatePodIdentityAssociationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreatePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreatePodIdentityAssociationOutput(v **CreatePodIdentityAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreatePodIdentityAssociationOutput - if *v == nil { - sv = &CreatePodIdentityAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "association": - if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteAccessEntry struct { -} - -func (*awsRestjson1_deserializeOpDeleteAccessEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteAccessEntry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAccessEntry(response, &metadata) - } - output := &DeleteAccessEntryOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteAccessEntry(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteAddon struct { -} - -func (*awsRestjson1_deserializeOpDeleteAddon) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAddon(response, &metadata) - } - output := &DeleteAddonOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteAddonOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteAddonOutput(v **DeleteAddonOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteAddonOutput - if *v == nil { - sv = &DeleteAddonOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addon": - if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteCapability struct { -} - -func (*awsRestjson1_deserializeOpDeleteCapability) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteCapability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteCapability(response, &metadata) - } - output := &DeleteCapabilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteCapabilityOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteCapability(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteCapabilityOutput(v **DeleteCapabilityOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteCapabilityOutput - if *v == nil { - sv = &DeleteCapabilityOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "capability": - if err := awsRestjson1_deserializeDocumentCapability(&sv.Capability, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteCluster struct { -} - -func (*awsRestjson1_deserializeOpDeleteCluster) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteCluster(response, &metadata) - } - output := &DeleteClusterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteClusterOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteClusterOutput - if *v == nil { - sv = &DeleteClusterOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteEksAnywhereSubscription struct { -} - -func (*awsRestjson1_deserializeOpDeleteEksAnywhereSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteEksAnywhereSubscription(response, &metadata) - } - output := &DeleteEksAnywhereSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteEksAnywhereSubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteEksAnywhereSubscriptionOutput(v **DeleteEksAnywhereSubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteEksAnywhereSubscriptionOutput - if *v == nil { - sv = &DeleteEksAnywhereSubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteFargateProfile struct { -} - -func (*awsRestjson1_deserializeOpDeleteFargateProfile) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFargateProfile(response, &metadata) - } - output := &DeleteFargateProfileOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(v **DeleteFargateProfileOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteFargateProfileOutput - if *v == nil { - sv = &DeleteFargateProfileOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteNodegroup struct { -} - -func (*awsRestjson1_deserializeOpDeleteNodegroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteNodegroup(response, &metadata) - } - output := &DeleteNodegroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteNodegroupOutput - if *v == nil { - sv = &DeleteNodegroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeletePodIdentityAssociation struct { -} - -func (*awsRestjson1_deserializeOpDeletePodIdentityAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeletePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePodIdentityAssociation(response, &metadata) - } - output := &DeletePodIdentityAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeletePodIdentityAssociationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeletePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeletePodIdentityAssociationOutput(v **DeletePodIdentityAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeletePodIdentityAssociationOutput - if *v == nil { - sv = &DeletePodIdentityAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "association": - if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeregisterCluster struct { -} - -func (*awsRestjson1_deserializeOpDeregisterCluster) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeregisterCluster(response, &metadata) - } - output := &DeregisterClusterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(v **DeregisterClusterOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeregisterClusterOutput - if *v == nil { - sv = &DeregisterClusterOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeAccessEntry struct { -} - -func (*awsRestjson1_deserializeOpDescribeAccessEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeAccessEntry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccessEntry(response, &metadata) - } - output := &DescribeAccessEntryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeAccessEntryOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeAccessEntry(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeAccessEntryOutput(v **DescribeAccessEntryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAccessEntryOutput - if *v == nil { - sv = &DescribeAccessEntryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessEntry": - if err := awsRestjson1_deserializeDocumentAccessEntry(&sv.AccessEntry, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeAddon struct { -} - -func (*awsRestjson1_deserializeOpDescribeAddon) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddon(response, &metadata) - } - output := &DescribeAddonOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeAddonOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeAddonOutput(v **DescribeAddonOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAddonOutput - if *v == nil { - sv = &DescribeAddonOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addon": - if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeAddonConfiguration struct { -} - -func (*awsRestjson1_deserializeOpDescribeAddonConfiguration) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response, &metadata) - } - output := &DescribeAddonConfigurationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(v **DescribeAddonConfigurationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAddonConfigurationOutput - if *v == nil { - sv = &DescribeAddonConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "addonVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonVersion = ptr.String(jtv) - } - - case "configurationSchema": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ConfigurationSchema = ptr.String(jtv) - } - - case "podIdentityConfiguration": - if err := awsRestjson1_deserializeDocumentAddonPodIdentityConfigurationList(&sv.PodIdentityConfiguration, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeAddonVersions struct { -} - -func (*awsRestjson1_deserializeOpDescribeAddonVersions) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonVersions(response, &metadata) - } - output := &DescribeAddonVersionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(v **DescribeAddonVersionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAddonVersionsOutput - if *v == nil { - sv = &DescribeAddonVersionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addons": - if err := awsRestjson1_deserializeDocumentAddons(&sv.Addons, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeCapability struct { -} - -func (*awsRestjson1_deserializeOpDescribeCapability) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeCapability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeCapability(response, &metadata) - } - output := &DescribeCapabilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeCapabilityOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeCapability(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeCapabilityOutput(v **DescribeCapabilityOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeCapabilityOutput - if *v == nil { - sv = &DescribeCapabilityOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "capability": - if err := awsRestjson1_deserializeDocumentCapability(&sv.Capability, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeCluster struct { -} - -func (*awsRestjson1_deserializeOpDescribeCluster) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeCluster(response, &metadata) - } - output := &DescribeClusterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeClusterOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeClusterOutput - if *v == nil { - sv = &DescribeClusterOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeClusterVersions struct { -} - -func (*awsRestjson1_deserializeOpDescribeClusterVersions) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeClusterVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeClusterVersions(response, &metadata) - } - output := &DescribeClusterVersionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeClusterVersionsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeClusterVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeClusterVersionsOutput(v **DescribeClusterVersionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeClusterVersionsOutput - if *v == nil { - sv = &DescribeClusterVersionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterVersions": - if err := awsRestjson1_deserializeDocumentClusterVersionList(&sv.ClusterVersions, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeEksAnywhereSubscription struct { -} - -func (*awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response, &metadata) - } - output := &DescribeEksAnywhereSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v **DescribeEksAnywhereSubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeEksAnywhereSubscriptionOutput - if *v == nil { - sv = &DescribeEksAnywhereSubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeFargateProfile struct { -} - -func (*awsRestjson1_deserializeOpDescribeFargateProfile) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeFargateProfile(response, &metadata) - } - output := &DescribeFargateProfileOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeFargateProfileOutput(v **DescribeFargateProfileOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeFargateProfileOutput - if *v == nil { - sv = &DescribeFargateProfileOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeIdentityProviderConfig struct { -} - -func (*awsRestjson1_deserializeOpDescribeIdentityProviderConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response, &metadata) - } - output := &DescribeIdentityProviderConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeIdentityProviderConfigOutput(v **DescribeIdentityProviderConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeIdentityProviderConfigOutput - if *v == nil { - sv = &DescribeIdentityProviderConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "identityProviderConfig": - if err := awsRestjson1_deserializeDocumentIdentityProviderConfigResponse(&sv.IdentityProviderConfig, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeInsight struct { -} - -func (*awsRestjson1_deserializeOpDescribeInsight) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeInsight(response, &metadata) - } - output := &DescribeInsightOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeInsightOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeInsightOutput(v **DescribeInsightOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeInsightOutput - if *v == nil { - sv = &DescribeInsightOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "insight": - if err := awsRestjson1_deserializeDocumentInsight(&sv.Insight, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeInsightsRefresh struct { -} - -func (*awsRestjson1_deserializeOpDescribeInsightsRefresh) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeInsightsRefresh) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeInsightsRefresh(response, &metadata) - } - output := &DescribeInsightsRefreshOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeInsightsRefreshOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeInsightsRefresh(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeInsightsRefreshOutput(v **DescribeInsightsRefreshOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeInsightsRefreshOutput - if *v == nil { - sv = &DescribeInsightsRefreshOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "endedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "startedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InsightsRefreshStatus to be of type string, got %T instead", value) - } - sv.Status = types.InsightsRefreshStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeNodegroup struct { -} - -func (*awsRestjson1_deserializeOpDescribeNodegroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeNodegroup(response, &metadata) - } - output := &DescribeNodegroupOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeNodegroupOutput(v **DescribeNodegroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeNodegroupOutput - if *v == nil { - sv = &DescribeNodegroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribePodIdentityAssociation struct { -} - -func (*awsRestjson1_deserializeOpDescribePodIdentityAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribePodIdentityAssociation(response, &metadata) - } - output := &DescribePodIdentityAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribePodIdentityAssociationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribePodIdentityAssociationOutput(v **DescribePodIdentityAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribePodIdentityAssociationOutput - if *v == nil { - sv = &DescribePodIdentityAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "association": - if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeUpdate struct { -} - -func (*awsRestjson1_deserializeOpDescribeUpdate) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeUpdate(response, &metadata) - } - output := &DescribeUpdateOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(v **DescribeUpdateOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeUpdateOutput - if *v == nil { - sv = &DescribeUpdateOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDisassociateAccessPolicy struct { -} - -func (*awsRestjson1_deserializeOpDisassociateAccessPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisassociateAccessPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateAccessPolicy(response, &metadata) - } - output := &DisassociateAccessPolicyOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDisassociateAccessPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDisassociateIdentityProviderConfig struct { -} - -func (*awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response, &metadata) - } - output := &DisassociateIdentityProviderConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(v **DisassociateIdentityProviderConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DisassociateIdentityProviderConfigOutput - if *v == nil { - sv = &DisassociateIdentityProviderConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAccessEntries struct { -} - -func (*awsRestjson1_deserializeOpListAccessEntries) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAccessEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAccessEntries(response, &metadata) - } - output := &ListAccessEntriesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListAccessEntriesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAccessEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAccessEntriesOutput(v **ListAccessEntriesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAccessEntriesOutput - if *v == nil { - sv = &ListAccessEntriesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessEntries": - if err := awsRestjson1_deserializeDocumentStringList(&sv.AccessEntries, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAccessPolicies struct { -} - -func (*awsRestjson1_deserializeOpListAccessPolicies) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAccessPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAccessPolicies(response, &metadata) - } - output := &ListAccessPoliciesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAccessPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAccessPoliciesOutput(v **ListAccessPoliciesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAccessPoliciesOutput - if *v == nil { - sv = &ListAccessPoliciesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessPolicies": - if err := awsRestjson1_deserializeDocumentAccessPoliciesList(&sv.AccessPolicies, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAddons struct { -} - -func (*awsRestjson1_deserializeOpListAddons) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAddons(response, &metadata) - } - output := &ListAddonsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListAddonsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAddons(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAddonsOutput(v **ListAddonsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAddonsOutput - if *v == nil { - sv = &ListAddonsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addons": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Addons, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListAssociatedAccessPolicies struct { -} - -func (*awsRestjson1_deserializeOpListAssociatedAccessPolicies) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListAssociatedAccessPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAssociatedAccessPolicies(response, &metadata) - } - output := &ListAssociatedAccessPoliciesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListAssociatedAccessPoliciesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListAssociatedAccessPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListAssociatedAccessPoliciesOutput(v **ListAssociatedAccessPoliciesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAssociatedAccessPoliciesOutput - if *v == nil { - sv = &ListAssociatedAccessPoliciesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "associatedAccessPolicies": - if err := awsRestjson1_deserializeDocumentAssociatedAccessPoliciesList(&sv.AssociatedAccessPolicies, value); err != nil { - return err - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "principalArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PrincipalArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListCapabilities struct { -} - -func (*awsRestjson1_deserializeOpListCapabilities) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListCapabilities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCapabilities(response, &metadata) - } - output := &ListCapabilitiesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListCapabilitiesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListCapabilities(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListCapabilitiesOutput(v **ListCapabilitiesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCapabilitiesOutput - if *v == nil { - sv = &ListCapabilitiesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "capabilities": - if err := awsRestjson1_deserializeDocumentCapabilitySummaryList(&sv.Capabilities, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListClusters struct { -} - -func (*awsRestjson1_deserializeOpListClusters) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListClusters(response, &metadata) - } - output := &ListClustersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListClustersOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListClustersOutput - if *v == nil { - sv = &ListClustersOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusters": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Clusters, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListEksAnywhereSubscriptions struct { -} - -func (*awsRestjson1_deserializeOpListEksAnywhereSubscriptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListEksAnywhereSubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListEksAnywhereSubscriptions(response, &metadata) - } - output := &ListEksAnywhereSubscriptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListEksAnywhereSubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(v **ListEksAnywhereSubscriptionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListEksAnywhereSubscriptionsOutput - if *v == nil { - sv = &ListEksAnywhereSubscriptionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "subscriptions": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(&sv.Subscriptions, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListFargateProfiles struct { -} - -func (*awsRestjson1_deserializeOpListFargateProfiles) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListFargateProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFargateProfiles(response, &metadata) - } - output := &ListFargateProfilesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListFargateProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListFargateProfilesOutput(v **ListFargateProfilesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListFargateProfilesOutput - if *v == nil { - sv = &ListFargateProfilesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "fargateProfileNames": - if err := awsRestjson1_deserializeDocumentStringList(&sv.FargateProfileNames, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListIdentityProviderConfigs struct { -} - -func (*awsRestjson1_deserializeOpListIdentityProviderConfigs) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListIdentityProviderConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response, &metadata) - } - output := &ListIdentityProviderConfigsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListIdentityProviderConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListIdentityProviderConfigsOutput(v **ListIdentityProviderConfigsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListIdentityProviderConfigsOutput - if *v == nil { - sv = &ListIdentityProviderConfigsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "identityProviderConfigs": - if err := awsRestjson1_deserializeDocumentIdentityProviderConfigs(&sv.IdentityProviderConfigs, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListInsights struct { -} - -func (*awsRestjson1_deserializeOpListInsights) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListInsights) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInsights(response, &metadata) - } - output := &ListInsightsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListInsightsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListInsightsOutput(v **ListInsightsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListInsightsOutput - if *v == nil { - sv = &ListInsightsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "insights": - if err := awsRestjson1_deserializeDocumentInsightSummaries(&sv.Insights, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListNodegroups struct { -} - -func (*awsRestjson1_deserializeOpListNodegroups) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListNodegroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListNodegroups(response, &metadata) - } - output := &ListNodegroupsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListNodegroupsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListNodegroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListNodegroupsOutput(v **ListNodegroupsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListNodegroupsOutput - if *v == nil { - sv = &ListNodegroupsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "nodegroups": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Nodegroups, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListPodIdentityAssociations struct { -} - -func (*awsRestjson1_deserializeOpListPodIdentityAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListPodIdentityAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPodIdentityAssociations(response, &metadata) - } - output := &ListPodIdentityAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListPodIdentityAssociationsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListPodIdentityAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListPodIdentityAssociationsOutput(v **ListPodIdentityAssociationsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListPodIdentityAssociationsOutput - if *v == nil { - sv = &ListPodIdentityAssociationsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "associations": - if err := awsRestjson1_deserializeDocumentPodIdentityAssociationSummaries(&sv.Associations, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListTagsForResource struct { -} - -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) - } - output := &ListTagsForResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListUpdates struct { -} - -func (*awsRestjson1_deserializeOpListUpdates) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListUpdates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListUpdates(response, &metadata) - } - output := &ListUpdatesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListUpdatesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListUpdates(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListUpdatesOutput(v **ListUpdatesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListUpdatesOutput - if *v == nil { - sv = &ListUpdatesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "updateIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.UpdateIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpRegisterCluster struct { -} - -func (*awsRestjson1_deserializeOpRegisterCluster) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpRegisterCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterCluster(response, &metadata) - } - output := &RegisterClusterOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentRegisterClusterOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorRegisterCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourcePropagationDelayException", errorCode): - return awsRestjson1_deserializeErrorResourcePropagationDelayException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentRegisterClusterOutput(v **RegisterClusterOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *RegisterClusterOutput - if *v == nil { - sv = &RegisterClusterOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStartInsightsRefresh struct { -} - -func (*awsRestjson1_deserializeOpStartInsightsRefresh) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpStartInsightsRefresh) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartInsightsRefresh(response, &metadata) - } - output := &StartInsightsRefreshOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentStartInsightsRefreshOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorStartInsightsRefresh(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentStartInsightsRefreshOutput(v **StartInsightsRefreshOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartInsightsRefreshOutput - if *v == nil { - sv = &StartInsightsRefreshOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InsightsRefreshStatus to be of type string, got %T instead", value) - } - sv.Status = types.InsightsRefreshStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTagResource struct { -} - -func (*awsRestjson1_deserializeOpTagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) - } - output := &TagResourceOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUntagResource struct { -} - -func (*awsRestjson1_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("BadRequestException", errorCode): - return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) - - case strings.EqualFold("NotFoundException", errorCode): - return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUpdateAccessEntry struct { -} - -func (*awsRestjson1_deserializeOpUpdateAccessEntry) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateAccessEntry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccessEntry(response, &metadata) - } - output := &UpdateAccessEntryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateAccessEntryOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateAccessEntry(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateAccessEntryOutput(v **UpdateAccessEntryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateAccessEntryOutput - if *v == nil { - sv = &UpdateAccessEntryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessEntry": - if err := awsRestjson1_deserializeDocumentAccessEntry(&sv.AccessEntry, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateAddon struct { -} - -func (*awsRestjson1_deserializeOpUpdateAddon) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAddon(response, &metadata) - } - output := &UpdateAddonOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateAddonOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateAddonOutput(v **UpdateAddonOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateAddonOutput - if *v == nil { - sv = &UpdateAddonOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateCapability struct { -} - -func (*awsRestjson1_deserializeOpUpdateCapability) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateCapability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateCapability(response, &metadata) - } - output := &UpdateCapabilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateCapabilityOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateCapability(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateCapabilityOutput(v **UpdateCapabilityOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateCapabilityOutput - if *v == nil { - sv = &UpdateCapabilityOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateClusterConfig struct { -} - -func (*awsRestjson1_deserializeOpUpdateClusterConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateClusterConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateClusterConfig(response, &metadata) - } - output := &UpdateClusterConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateClusterConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateClusterConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateClusterConfigOutput(v **UpdateClusterConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateClusterConfigOutput - if *v == nil { - sv = &UpdateClusterConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateClusterVersion struct { -} - -func (*awsRestjson1_deserializeOpUpdateClusterVersion) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateClusterVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateClusterVersion(response, &metadata) - } - output := &UpdateClusterVersionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateClusterVersionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("InvalidStateException", errorCode): - return awsRestjson1_deserializeErrorInvalidStateException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateClusterVersionOutput(v **UpdateClusterVersionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateClusterVersionOutput - if *v == nil { - sv = &UpdateClusterVersionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateEksAnywhereSubscription struct { -} - -func (*awsRestjson1_deserializeOpUpdateEksAnywhereSubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateEksAnywhereSubscription(response, &metadata) - } - output := &UpdateEksAnywhereSubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(v **UpdateEksAnywhereSubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateEksAnywhereSubscriptionOutput - if *v == nil { - sv = &UpdateEksAnywhereSubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "subscription": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateNodegroupConfig struct { -} - -func (*awsRestjson1_deserializeOpUpdateNodegroupConfig) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateNodegroupConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateNodegroupConfig(response, &metadata) - } - output := &UpdateNodegroupConfigOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateNodegroupConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateNodegroupConfigOutput(v **UpdateNodegroupConfigOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateNodegroupConfigOutput - if *v == nil { - sv = &UpdateNodegroupConfigOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateNodegroupVersion struct { -} - -func (*awsRestjson1_deserializeOpUpdateNodegroupVersion) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateNodegroupVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response, &metadata) - } - output := &UpdateNodegroupVersionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateNodegroupVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateNodegroupVersionOutput(v **UpdateNodegroupVersionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateNodegroupVersionOutput - if *v == nil { - sv = &UpdateNodegroupVersionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdatePodIdentityAssociation struct { -} - -func (*awsRestjson1_deserializeOpUpdatePodIdentityAssociation) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdatePodIdentityAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePodIdentityAssociation(response, &metadata) - } - output := &UpdatePodIdentityAssociationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUpdatePodIdentityAssociationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdatePodIdentityAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServerException", errorCode): - return awsRestjson1_deserializeErrorServerException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdatePodIdentityAssociationOutput(v **UpdatePodIdentityAssociationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdatePodIdentityAssociationOutput - if *v == nil { - sv = &UpdatePodIdentityAssociationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "association": - if err := awsRestjson1_deserializeDocumentPodIdentityAssociation(&sv.Association, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.BadRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ClientException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentClientException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidParameterException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidStateException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidStateException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceInUseException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceInUseException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceLimitExceededException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceLimitExceededException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourcePropagationDelayException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourcePropagationDelayException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourcePropagationDelayException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServerException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentServerException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceUnavailableException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.UnsupportedAvailabilityZoneException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentUnsupportedAvailabilityZoneException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeDocumentAccessConfigResponse(v **types.AccessConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessConfigResponse - if *v == nil { - sv = &types.AccessConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "authenticationMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthenticationMode to be of type string, got %T instead", value) - } - sv.AuthenticationMode = types.AuthenticationMode(jtv) - } - - case "bootstrapClusterCreatorAdminPermissions": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.BootstrapClusterCreatorAdminPermissions = ptr.Bool(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessDeniedException - if *v == nil { - sv = &types.AccessDeniedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAccessEntry(v **types.AccessEntry, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessEntry - if *v == nil { - sv = &types.AccessEntry{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessEntryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AccessEntryArn = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "kubernetesGroups": - if err := awsRestjson1_deserializeDocumentStringList(&sv.KubernetesGroups, value); err != nil { - return err - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "principalArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PrincipalArn = ptr.String(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - case "username": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Username = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAccessPoliciesList(v *[]types.AccessPolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AccessPolicy - if *v == nil { - cv = []types.AccessPolicy{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AccessPolicy - destAddr := &col - if err := awsRestjson1_deserializeDocumentAccessPolicy(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAccessPolicy(v **types.AccessPolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessPolicy - if *v == nil { - sv = &types.AccessPolicy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAccessScope(v **types.AccessScope, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessScope - if *v == nil { - sv = &types.AccessScope{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "namespaces": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Namespaces, value); err != nil { - return err - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessScopeType to be of type string, got %T instead", value) - } - sv.Type = types.AccessScopeType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAdditionalInfoMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentAddon(v **types.Addon, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Addon - if *v == nil { - sv = &types.Addon{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonArn = ptr.String(jtv) - } - - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "addonVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonVersion = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClusterName to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "configurationValues": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ConfigurationValues = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "health": - if err := awsRestjson1_deserializeDocumentAddonHealth(&sv.Health, value); err != nil { - return err - } - - case "marketplaceInformation": - if err := awsRestjson1_deserializeDocumentMarketplaceInformation(&sv.MarketplaceInformation, value); err != nil { - return err - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "namespaceConfig": - if err := awsRestjson1_deserializeDocumentAddonNamespaceConfigResponse(&sv.NamespaceConfig, value); err != nil { - return err - } - - case "owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Owner = ptr.String(jtv) - } - - case "podIdentityAssociations": - if err := awsRestjson1_deserializeDocumentStringList(&sv.PodIdentityAssociations, value); err != nil { - return err - } - - case "publisher": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Publisher = ptr.String(jtv) - } - - case "serviceAccountRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceAccountRoleArn = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AddonStatus to be of type string, got %T instead", value) - } - sv.Status = types.AddonStatus(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonCompatibilityDetail(v **types.AddonCompatibilityDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonCompatibilityDetail - if *v == nil { - sv = &types.AddonCompatibilityDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "compatibleVersions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.CompatibleVersions, value); err != nil { - return err - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonCompatibilityDetails(v *[]types.AddonCompatibilityDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AddonCompatibilityDetail - if *v == nil { - cv = []types.AddonCompatibilityDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AddonCompatibilityDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentAddonCompatibilityDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAddonHealth(v **types.AddonHealth, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonHealth - if *v == nil { - sv = &types.AddonHealth{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issues": - if err := awsRestjson1_deserializeDocumentAddonIssueList(&sv.Issues, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonInfo(v **types.AddonInfo, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonInfo - if *v == nil { - sv = &types.AddonInfo{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "addonVersions": - if err := awsRestjson1_deserializeDocumentAddonVersionInfoList(&sv.AddonVersions, value); err != nil { - return err - } - - case "defaultNamespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.DefaultNamespace = ptr.String(jtv) - } - - case "marketplaceInformation": - if err := awsRestjson1_deserializeDocumentMarketplaceInformation(&sv.MarketplaceInformation, value); err != nil { - return err - } - - case "owner": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Owner = ptr.String(jtv) - } - - case "publisher": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Publisher = ptr.String(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonIssue(v **types.AddonIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonIssue - if *v == nil { - sv = &types.AddonIssue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AddonIssueCode to be of type string, got %T instead", value) - } - sv.Code = types.AddonIssueCode(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ResourceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonIssueList(v *[]types.AddonIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AddonIssue - if *v == nil { - cv = []types.AddonIssue{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AddonIssue - destAddr := &col - if err := awsRestjson1_deserializeDocumentAddonIssue(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAddonNamespaceConfigResponse(v **types.AddonNamespaceConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonNamespaceConfigResponse - if *v == nil { - sv = &types.AddonNamespaceConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected namespace to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonPodIdentityConfiguration(v **types.AddonPodIdentityConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonPodIdentityConfiguration - if *v == nil { - sv = &types.AddonPodIdentityConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "recommendedManagedPolicies": - if err := awsRestjson1_deserializeDocumentStringList(&sv.RecommendedManagedPolicies, value); err != nil { - return err - } - - case "serviceAccount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceAccount = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonPodIdentityConfigurationList(v *[]types.AddonPodIdentityConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AddonPodIdentityConfiguration - if *v == nil { - cv = []types.AddonPodIdentityConfiguration{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AddonPodIdentityConfiguration - destAddr := &col - if err := awsRestjson1_deserializeDocumentAddonPodIdentityConfiguration(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAddons(v *[]types.AddonInfo, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AddonInfo - if *v == nil { - cv = []types.AddonInfo{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AddonInfo - destAddr := &col - if err := awsRestjson1_deserializeDocumentAddonInfo(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAddonVersionInfo(v **types.AddonVersionInfo, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AddonVersionInfo - if *v == nil { - sv = &types.AddonVersionInfo{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonVersion = ptr.String(jtv) - } - - case "architecture": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Architecture, value); err != nil { - return err - } - - case "compatibilities": - if err := awsRestjson1_deserializeDocumentCompatibilities(&sv.Compatibilities, value); err != nil { - return err - } - - case "computeTypes": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ComputeTypes, value); err != nil { - return err - } - - case "requiresConfiguration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.RequiresConfiguration = jtv - } - - case "requiresIamPermissions": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.RequiresIamPermissions = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAddonVersionInfoList(v *[]types.AddonVersionInfo, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AddonVersionInfo - if *v == nil { - cv = []types.AddonVersionInfo{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AddonVersionInfo - destAddr := &col - if err := awsRestjson1_deserializeDocumentAddonVersionInfo(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentArgoCdAwsIdcConfigResponse(v **types.ArgoCdAwsIdcConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ArgoCdAwsIdcConfigResponse - if *v == nil { - sv = &types.ArgoCdAwsIdcConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "idcInstanceArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IdcInstanceArn = ptr.String(jtv) - } - - case "idcManagedApplicationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IdcManagedApplicationArn = ptr.String(jtv) - } - - case "idcRegion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IdcRegion = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentArgoCdConfigResponse(v **types.ArgoCdConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ArgoCdConfigResponse - if *v == nil { - sv = &types.ArgoCdConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "awsIdc": - if err := awsRestjson1_deserializeDocumentArgoCdAwsIdcConfigResponse(&sv.AwsIdc, value); err != nil { - return err - } - - case "namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - case "networkAccess": - if err := awsRestjson1_deserializeDocumentArgoCdNetworkAccessConfigResponse(&sv.NetworkAccess, value); err != nil { - return err - } - - case "rbacRoleMappings": - if err := awsRestjson1_deserializeDocumentArgoCdRoleMappingList(&sv.RbacRoleMappings, value); err != nil { - return err - } - - case "serverUrl": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServerUrl = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentArgoCdNetworkAccessConfigResponse(v **types.ArgoCdNetworkAccessConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ArgoCdNetworkAccessConfigResponse - if *v == nil { - sv = &types.ArgoCdNetworkAccessConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "vpceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.VpceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentArgoCdRoleMapping(v **types.ArgoCdRoleMapping, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ArgoCdRoleMapping - if *v == nil { - sv = &types.ArgoCdRoleMapping{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "identities": - if err := awsRestjson1_deserializeDocumentSsoIdentityList(&sv.Identities, value); err != nil { - return err - } - - case "role": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ArgoCdRole to be of type string, got %T instead", value) - } - sv.Role = types.ArgoCdRole(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentArgoCdRoleMappingList(v *[]types.ArgoCdRoleMapping, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ArgoCdRoleMapping - if *v == nil { - cv = []types.ArgoCdRoleMapping{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ArgoCdRoleMapping - destAddr := &col - if err := awsRestjson1_deserializeDocumentArgoCdRoleMapping(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAssociatedAccessPoliciesList(v *[]types.AssociatedAccessPolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AssociatedAccessPolicy - if *v == nil { - cv = []types.AssociatedAccessPolicy{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AssociatedAccessPolicy - destAddr := &col - if err := awsRestjson1_deserializeDocumentAssociatedAccessPolicy(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentAssociatedAccessPolicy(v **types.AssociatedAccessPolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AssociatedAccessPolicy - if *v == nil { - sv = &types.AssociatedAccessPolicy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessScope": - if err := awsRestjson1_deserializeDocumentAccessScope(&sv.AccessScope, value); err != nil { - return err - } - - case "associatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.AssociatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "policyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PolicyArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAutoScalingGroup(v **types.AutoScalingGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AutoScalingGroup - if *v == nil { - sv = &types.AutoScalingGroup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentAutoScalingGroupList(v *[]types.AutoScalingGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AutoScalingGroup - if *v == nil { - cv = []types.AutoScalingGroup{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AutoScalingGroup - destAddr := &col - if err := awsRestjson1_deserializeDocumentAutoScalingGroup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.BadRequestException - if *v == nil { - sv = &types.BadRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentBlockStorage(v **types.BlockStorage, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.BlockStorage - if *v == nil { - sv = &types.BlockStorage{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapability(v **types.Capability, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Capability - if *v == nil { - sv = &types.Capability{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "capabilityName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.CapabilityName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "configuration": - if err := awsRestjson1_deserializeDocumentCapabilityConfigurationResponse(&sv.Configuration, value); err != nil { - return err - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "deletePropagationPolicy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityDeletePropagationPolicy to be of type string, got %T instead", value) - } - sv.DeletePropagationPolicy = types.CapabilityDeletePropagationPolicy(jtv) - } - - case "health": - if err := awsRestjson1_deserializeDocumentCapabilityHealth(&sv.Health, value); err != nil { - return err - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityStatus to be of type string, got %T instead", value) - } - sv.Status = types.CapabilityStatus(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityType to be of type string, got %T instead", value) - } - sv.Type = types.CapabilityType(jtv) - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilityConfigurationResponse(v **types.CapabilityConfigurationResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CapabilityConfigurationResponse - if *v == nil { - sv = &types.CapabilityConfigurationResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "argoCd": - if err := awsRestjson1_deserializeDocumentArgoCdConfigResponse(&sv.ArgoCd, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilityHealth(v **types.CapabilityHealth, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CapabilityHealth - if *v == nil { - sv = &types.CapabilityHealth{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issues": - if err := awsRestjson1_deserializeDocumentCapabilityIssueList(&sv.Issues, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilityIssue(v **types.CapabilityIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CapabilityIssue - if *v == nil { - sv = &types.CapabilityIssue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityIssueCode to be of type string, got %T instead", value) - } - sv.Code = types.CapabilityIssueCode(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilityIssueList(v *[]types.CapabilityIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CapabilityIssue - if *v == nil { - cv = []types.CapabilityIssue{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CapabilityIssue - destAddr := &col - if err := awsRestjson1_deserializeDocumentCapabilityIssue(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilitySummary(v **types.CapabilitySummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CapabilitySummary - if *v == nil { - sv = &types.CapabilitySummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "capabilityName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.CapabilityName = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityStatus to be of type string, got %T instead", value) - } - sv.Status = types.CapabilityStatus(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapabilityType to be of type string, got %T instead", value) - } - sv.Type = types.CapabilityType(jtv) - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCapabilitySummaryList(v *[]types.CapabilitySummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CapabilitySummary - if *v == nil { - cv = []types.CapabilitySummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CapabilitySummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentCapabilitySummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Certificate - if *v == nil { - sv = &types.Certificate{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "data": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Data = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClientException - if *v == nil { - sv = &types.ClientException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClientStat(v **types.ClientStat, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClientStat - if *v == nil { - sv = &types.ClientStat{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "lastRequestTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastRequestTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "numberOfRequestsLast30Days": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.NumberOfRequestsLast30Days = int32(i64) - } - - case "userAgent": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.UserAgent = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClientStats(v *[]types.ClientStat, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ClientStat - if *v == nil { - cv = []types.ClientStat{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ClientStat - destAddr := &col - if err := awsRestjson1_deserializeDocumentClientStat(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCluster(v **types.Cluster, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Cluster - if *v == nil { - sv = &types.Cluster{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accessConfig": - if err := awsRestjson1_deserializeDocumentAccessConfigResponse(&sv.AccessConfig, value); err != nil { - return err - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "certificateAuthority": - if err := awsRestjson1_deserializeDocumentCertificate(&sv.CertificateAuthority, value); err != nil { - return err - } - - case "clientRequestToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClientRequestToken = ptr.String(jtv) - } - - case "computeConfig": - if err := awsRestjson1_deserializeDocumentComputeConfigResponse(&sv.ComputeConfig, value); err != nil { - return err - } - - case "connectorConfig": - if err := awsRestjson1_deserializeDocumentConnectorConfigResponse(&sv.ConnectorConfig, value); err != nil { - return err - } - - case "controlPlaneScalingConfig": - if err := awsRestjson1_deserializeDocumentControlPlaneScalingConfig(&sv.ControlPlaneScalingConfig, value); err != nil { - return err - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "deletionProtection": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.DeletionProtection = ptr.Bool(jtv) - } - - case "encryptionConfig": - if err := awsRestjson1_deserializeDocumentEncryptionConfigList(&sv.EncryptionConfig, value); err != nil { - return err - } - - case "endpoint": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Endpoint = ptr.String(jtv) - } - - case "health": - if err := awsRestjson1_deserializeDocumentClusterHealth(&sv.Health, value); err != nil { - return err - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "identity": - if err := awsRestjson1_deserializeDocumentIdentity(&sv.Identity, value); err != nil { - return err - } - - case "kubernetesNetworkConfig": - if err := awsRestjson1_deserializeDocumentKubernetesNetworkConfigResponse(&sv.KubernetesNetworkConfig, value); err != nil { - return err - } - - case "logging": - if err := awsRestjson1_deserializeDocumentLogging(&sv.Logging, value); err != nil { - return err - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "outpostConfig": - if err := awsRestjson1_deserializeDocumentOutpostConfigResponse(&sv.OutpostConfig, value); err != nil { - return err - } - - case "platformVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PlatformVersion = ptr.String(jtv) - } - - case "remoteNetworkConfig": - if err := awsRestjson1_deserializeDocumentRemoteNetworkConfigResponse(&sv.RemoteNetworkConfig, value); err != nil { - return err - } - - case "resourcesVpcConfig": - if err := awsRestjson1_deserializeDocumentVpcConfigResponse(&sv.ResourcesVpcConfig, value); err != nil { - return err - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClusterStatus to be of type string, got %T instead", value) - } - sv.Status = types.ClusterStatus(jtv) - } - - case "storageConfig": - if err := awsRestjson1_deserializeDocumentStorageConfigResponse(&sv.StorageConfig, value); err != nil { - return err - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "upgradePolicy": - if err := awsRestjson1_deserializeDocumentUpgradePolicyResponse(&sv.UpgradePolicy, value); err != nil { - return err - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) - } - - case "zonalShiftConfig": - if err := awsRestjson1_deserializeDocumentZonalShiftConfigResponse(&sv.ZonalShiftConfig, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClusterHealth(v **types.ClusterHealth, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClusterHealth - if *v == nil { - sv = &types.ClusterHealth{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issues": - if err := awsRestjson1_deserializeDocumentClusterIssueList(&sv.Issues, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClusterIssue(v **types.ClusterIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClusterIssue - if *v == nil { - sv = &types.ClusterIssue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClusterIssueCode to be of type string, got %T instead", value) - } - sv.Code = types.ClusterIssueCode(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ResourceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClusterIssueList(v *[]types.ClusterIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ClusterIssue - if *v == nil { - cv = []types.ClusterIssue{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ClusterIssue - destAddr := &col - if err := awsRestjson1_deserializeDocumentClusterIssue(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentClusterVersionInformation(v **types.ClusterVersionInformation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClusterVersionInformation - if *v == nil { - sv = &types.ClusterVersionInformation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterType = ptr.String(jtv) - } - - case "clusterVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterVersion = ptr.String(jtv) - } - - case "defaultPlatformVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.DefaultPlatformVersion = ptr.String(jtv) - } - - case "defaultVersion": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.DefaultVersion = jtv - } - - case "endOfExtendedSupportDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EndOfExtendedSupportDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "endOfStandardSupportDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EndOfStandardSupportDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "kubernetesPatchVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.KubernetesPatchVersion = ptr.String(jtv) - } - - case "releaseDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ReleaseDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClusterVersionStatus to be of type string, got %T instead", value) - } - sv.Status = types.ClusterVersionStatus(jtv) - } - - case "versionStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VersionStatus to be of type string, got %T instead", value) - } - sv.VersionStatus = types.VersionStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentClusterVersionList(v *[]types.ClusterVersionInformation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ClusterVersionInformation - if *v == nil { - cv = []types.ClusterVersionInformation{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ClusterVersionInformation - destAddr := &col - if err := awsRestjson1_deserializeDocumentClusterVersionInformation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCompatibilities(v *[]types.Compatibility, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Compatibility - if *v == nil { - cv = []types.Compatibility{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Compatibility - destAddr := &col - if err := awsRestjson1_deserializeDocumentCompatibility(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentCompatibility(v **types.Compatibility, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Compatibility - if *v == nil { - sv = &types.Compatibility{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterVersion = ptr.String(jtv) - } - - case "defaultVersion": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.DefaultVersion = jtv - } - - case "platformVersions": - if err := awsRestjson1_deserializeDocumentStringList(&sv.PlatformVersions, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentComputeConfigResponse(v **types.ComputeConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ComputeConfigResponse - if *v == nil { - sv = &types.ComputeConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - case "nodePools": - if err := awsRestjson1_deserializeDocumentStringList(&sv.NodePools, value); err != nil { - return err - } - - case "nodeRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodeRoleArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentConnectorConfigResponse(v **types.ConnectorConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ConnectorConfigResponse - if *v == nil { - sv = &types.ConnectorConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "activationCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ActivationCode = ptr.String(jtv) - } - - case "activationExpiry": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ActivationExpiry = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "activationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ActivationId = ptr.String(jtv) - } - - case "provider": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Provider = ptr.String(jtv) - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentControlPlanePlacementResponse(v **types.ControlPlanePlacementResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ControlPlanePlacementResponse - if *v == nil { - sv = &types.ControlPlanePlacementResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "groupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.GroupName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentControlPlaneScalingConfig(v **types.ControlPlaneScalingConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ControlPlaneScalingConfig - if *v == nil { - sv = &types.ControlPlaneScalingConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tier": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProvisionedControlPlaneTier to be of type string, got %T instead", value) - } - sv.Tier = types.ProvisionedControlPlaneTier(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeprecationDetail(v **types.DeprecationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DeprecationDetail - if *v == nil { - sv = &types.DeprecationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clientStats": - if err := awsRestjson1_deserializeDocumentClientStats(&sv.ClientStats, value); err != nil { - return err - } - - case "replacedWith": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ReplacedWith = ptr.String(jtv) - } - - case "startServingReplacementVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.StartServingReplacementVersion = ptr.String(jtv) - } - - case "stopServingVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.StopServingVersion = ptr.String(jtv) - } - - case "usage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Usage = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeprecationDetails(v *[]types.DeprecationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DeprecationDetail - if *v == nil { - cv = []types.DeprecationDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DeprecationDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentDeprecationDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentEksAnywhereSubscription(v **types.EksAnywhereSubscription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EksAnywhereSubscription - if *v == nil { - sv = &types.EksAnywhereSubscription{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "autoRenew": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.AutoRenew = jtv - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "effectiveDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EffectiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "expirationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "licenseArns": - if err := awsRestjson1_deserializeDocumentStringList(&sv.LicenseArns, value); err != nil { - return err - } - - case "licenseQuantity": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.LicenseQuantity = int32(i64) - } - - case "licenses": - if err := awsRestjson1_deserializeDocumentLicenseList(&sv.Licenses, value); err != nil { - return err - } - - case "licenseType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EksAnywhereSubscriptionLicenseType to be of type string, got %T instead", value) - } - sv.LicenseType = types.EksAnywhereSubscriptionLicenseType(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Status = ptr.String(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "term": - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionTerm(&sv.Term, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(v *[]types.EksAnywhereSubscription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.EksAnywhereSubscription - if *v == nil { - cv = []types.EksAnywhereSubscription{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.EksAnywhereSubscription - destAddr := &col - if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentEksAnywhereSubscriptionTerm(v **types.EksAnywhereSubscriptionTerm, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EksAnywhereSubscriptionTerm - if *v == nil { - sv = &types.EksAnywhereSubscriptionTerm{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "duration": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Duration = int32(i64) - } - - case "unit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EksAnywhereSubscriptionTermUnit to be of type string, got %T instead", value) - } - sv.Unit = types.EksAnywhereSubscriptionTermUnit(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentElasticLoadBalancing(v **types.ElasticLoadBalancing, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ElasticLoadBalancing - if *v == nil { - sv = &types.ElasticLoadBalancing{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentEncryptionConfig(v **types.EncryptionConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EncryptionConfig - if *v == nil { - sv = &types.EncryptionConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "provider": - if err := awsRestjson1_deserializeDocumentProvider(&sv.Provider, value); err != nil { - return err - } - - case "resources": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentEncryptionConfigList(v *[]types.EncryptionConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.EncryptionConfig - if *v == nil { - cv = []types.EncryptionConfig{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.EncryptionConfig - destAddr := &col - if err := awsRestjson1_deserializeDocumentEncryptionConfig(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentErrorDetail(v **types.ErrorDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ErrorDetail - if *v == nil { - sv = &types.ErrorDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.ErrorCode(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "resourceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ResourceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentErrorDetails(v *[]types.ErrorDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ErrorDetail - if *v == nil { - cv = []types.ErrorDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ErrorDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentErrorDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfile(v **types.FargateProfile, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FargateProfile - if *v == nil { - sv = &types.FargateProfile{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "fargateProfileArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.FargateProfileArn = ptr.String(jtv) - } - - case "fargateProfileName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.FargateProfileName = ptr.String(jtv) - } - - case "health": - if err := awsRestjson1_deserializeDocumentFargateProfileHealth(&sv.Health, value); err != nil { - return err - } - - case "podExecutionRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.PodExecutionRoleArn = ptr.String(jtv) - } - - case "selectors": - if err := awsRestjson1_deserializeDocumentFargateProfileSelectors(&sv.Selectors, value); err != nil { - return err - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FargateProfileStatus to be of type string, got %T instead", value) - } - sv.Status = types.FargateProfileStatus(jtv) - } - - case "subnets": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Subnets, value); err != nil { - return err - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileHealth(v **types.FargateProfileHealth, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FargateProfileHealth - if *v == nil { - sv = &types.FargateProfileHealth{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issues": - if err := awsRestjson1_deserializeDocumentFargateProfileIssueList(&sv.Issues, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileIssue(v **types.FargateProfileIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FargateProfileIssue - if *v == nil { - sv = &types.FargateProfileIssue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FargateProfileIssueCode to be of type string, got %T instead", value) - } - sv.Code = types.FargateProfileIssueCode(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ResourceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileIssueList(v *[]types.FargateProfileIssue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.FargateProfileIssue - if *v == nil { - cv = []types.FargateProfileIssue{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.FargateProfileIssue - destAddr := &col - if err := awsRestjson1_deserializeDocumentFargateProfileIssue(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileLabel(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileSelector(v **types.FargateProfileSelector, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FargateProfileSelector - if *v == nil { - sv = &types.FargateProfileSelector{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "labels": - if err := awsRestjson1_deserializeDocumentFargateProfileLabel(&sv.Labels, value); err != nil { - return err - } - - case "namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentFargateProfileSelectors(v *[]types.FargateProfileSelector, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.FargateProfileSelector - if *v == nil { - cv = []types.FargateProfileSelector{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.FargateProfileSelector - destAddr := &col - if err := awsRestjson1_deserializeDocumentFargateProfileSelector(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentIdentity(v **types.Identity, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Identity - if *v == nil { - sv = &types.Identity{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "oidc": - if err := awsRestjson1_deserializeDocumentOIDC(&sv.Oidc, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentIdentityProviderConfig(v **types.IdentityProviderConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.IdentityProviderConfig - if *v == nil { - sv = &types.IdentityProviderConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentIdentityProviderConfigResponse(v **types.IdentityProviderConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.IdentityProviderConfigResponse - if *v == nil { - sv = &types.IdentityProviderConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "oidc": - if err := awsRestjson1_deserializeDocumentOidcIdentityProviderConfig(&sv.Oidc, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentIdentityProviderConfigs(v *[]types.IdentityProviderConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.IdentityProviderConfig - if *v == nil { - cv = []types.IdentityProviderConfig{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.IdentityProviderConfig - destAddr := &col - if err := awsRestjson1_deserializeDocumentIdentityProviderConfig(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInsight(v **types.Insight, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Insight - if *v == nil { - sv = &types.Insight{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalInfo": - if err := awsRestjson1_deserializeDocumentAdditionalInfoMap(&sv.AdditionalInfo, value); err != nil { - return err - } - - case "category": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Category to be of type string, got %T instead", value) - } - sv.Category = types.Category(jtv) - } - - case "categorySpecificSummary": - if err := awsRestjson1_deserializeDocumentInsightCategorySpecificSummary(&sv.CategorySpecificSummary, value); err != nil { - return err - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "insightStatus": - if err := awsRestjson1_deserializeDocumentInsightStatus(&sv.InsightStatus, value); err != nil { - return err - } - - case "kubernetesVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.KubernetesVersion = ptr.String(jtv) - } - - case "lastRefreshTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastRefreshTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "lastTransitionTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastTransitionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "recommendation": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Recommendation = ptr.String(jtv) - } - - case "resources": - if err := awsRestjson1_deserializeDocumentInsightResourceDetails(&sv.Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInsightCategorySpecificSummary(v **types.InsightCategorySpecificSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InsightCategorySpecificSummary - if *v == nil { - sv = &types.InsightCategorySpecificSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonCompatibilityDetails": - if err := awsRestjson1_deserializeDocumentAddonCompatibilityDetails(&sv.AddonCompatibilityDetails, value); err != nil { - return err - } - - case "deprecationDetails": - if err := awsRestjson1_deserializeDocumentDeprecationDetails(&sv.DeprecationDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInsightResourceDetail(v **types.InsightResourceDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InsightResourceDetail - if *v == nil { - sv = &types.InsightResourceDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "insightStatus": - if err := awsRestjson1_deserializeDocumentInsightStatus(&sv.InsightStatus, value); err != nil { - return err - } - - case "kubernetesResourceUri": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.KubernetesResourceUri = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInsightResourceDetails(v *[]types.InsightResourceDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.InsightResourceDetail - if *v == nil { - cv = []types.InsightResourceDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.InsightResourceDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentInsightResourceDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInsightStatus(v **types.InsightStatus, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InsightStatus - if *v == nil { - sv = &types.InsightStatus{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Reason = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InsightStatusValue to be of type string, got %T instead", value) - } - sv.Status = types.InsightStatusValue(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInsightSummaries(v *[]types.InsightSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.InsightSummary - if *v == nil { - cv = []types.InsightSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.InsightSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentInsightSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInsightSummary(v **types.InsightSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InsightSummary - if *v == nil { - sv = &types.InsightSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "category": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Category to be of type string, got %T instead", value) - } - sv.Category = types.Category(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "insightStatus": - if err := awsRestjson1_deserializeDocumentInsightStatus(&sv.InsightStatus, value); err != nil { - return err - } - - case "kubernetesVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.KubernetesVersion = ptr.String(jtv) - } - - case "lastRefreshTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastRefreshTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "lastTransitionTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastTransitionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidParameterException - if *v == nil { - sv = &types.InvalidParameterException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "fargateProfileName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.FargateProfileName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidRequestException - if *v == nil { - sv = &types.InvalidRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidStateException(v **types.InvalidStateException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidStateException - if *v == nil { - sv = &types.InvalidStateException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentIssue(v **types.Issue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Issue - if *v == nil { - sv = &types.Issue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NodegroupIssueCode to be of type string, got %T instead", value) - } - sv.Code = types.NodegroupIssueCode(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ResourceIds, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentIssueList(v *[]types.Issue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Issue - if *v == nil { - cv = []types.Issue{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Issue - destAddr := &col - if err := awsRestjson1_deserializeDocumentIssue(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentKubernetesNetworkConfigResponse(v **types.KubernetesNetworkConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.KubernetesNetworkConfigResponse - if *v == nil { - sv = &types.KubernetesNetworkConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "elasticLoadBalancing": - if err := awsRestjson1_deserializeDocumentElasticLoadBalancing(&sv.ElasticLoadBalancing, value); err != nil { - return err - } - - case "ipFamily": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected IpFamily to be of type string, got %T instead", value) - } - sv.IpFamily = types.IpFamily(jtv) - } - - case "serviceIpv4Cidr": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceIpv4Cidr = ptr.String(jtv) - } - - case "serviceIpv6Cidr": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceIpv6Cidr = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLabelsMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected labelValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentLaunchTemplateSpecification(v **types.LaunchTemplateSpecification, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LaunchTemplateSpecification - if *v == nil { - sv = &types.LaunchTemplateSpecification{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLicense(v **types.License, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.License - if *v == nil { - sv = &types.License{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "token": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Token = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLicenseList(v *[]types.License, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.License - if *v == nil { - cv = []types.License{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.License - destAddr := &col - if err := awsRestjson1_deserializeDocumentLicense(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Logging - if *v == nil { - sv = &types.Logging{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterLogging": - if err := awsRestjson1_deserializeDocumentLogSetups(&sv.ClusterLogging, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLogSetup(v **types.LogSetup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LogSetup - if *v == nil { - sv = &types.LogSetup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - case "types": - if err := awsRestjson1_deserializeDocumentLogTypes(&sv.Types, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentLogSetups(v *[]types.LogSetup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.LogSetup - if *v == nil { - cv = []types.LogSetup{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.LogSetup - destAddr := &col - if err := awsRestjson1_deserializeDocumentLogSetup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentLogTypes(v *[]types.LogType, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.LogType - if *v == nil { - cv = []types.LogType{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.LogType - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LogType to be of type string, got %T instead", value) - } - col = types.LogType(jtv) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentMarketplaceInformation(v **types.MarketplaceInformation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MarketplaceInformation - if *v == nil { - sv = &types.MarketplaceInformation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "productId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ProductId = ptr.String(jtv) - } - - case "productUrl": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ProductUrl = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodegroup(v **types.Nodegroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Nodegroup - if *v == nil { - sv = &types.Nodegroup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "amiType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AMITypes to be of type string, got %T instead", value) - } - sv.AmiType = types.AMITypes(jtv) - } - - case "capacityType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CapacityTypes to be of type string, got %T instead", value) - } - sv.CapacityType = types.CapacityTypes(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "diskSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected BoxedInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.DiskSize = ptr.Int32(int32(i64)) - } - - case "health": - if err := awsRestjson1_deserializeDocumentNodegroupHealth(&sv.Health, value); err != nil { - return err - } - - case "instanceTypes": - if err := awsRestjson1_deserializeDocumentStringList(&sv.InstanceTypes, value); err != nil { - return err - } - - case "labels": - if err := awsRestjson1_deserializeDocumentLabelsMap(&sv.Labels, value); err != nil { - return err - } - - case "launchTemplate": - if err := awsRestjson1_deserializeDocumentLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil { - return err - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "nodegroupArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupArn = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "nodeRepairConfig": - if err := awsRestjson1_deserializeDocumentNodeRepairConfig(&sv.NodeRepairConfig, value); err != nil { - return err - } - - case "nodeRole": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodeRole = ptr.String(jtv) - } - - case "releaseVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ReleaseVersion = ptr.String(jtv) - } - - case "remoteAccess": - if err := awsRestjson1_deserializeDocumentRemoteAccessConfig(&sv.RemoteAccess, value); err != nil { - return err - } - - case "resources": - if err := awsRestjson1_deserializeDocumentNodegroupResources(&sv.Resources, value); err != nil { - return err - } - - case "scalingConfig": - if err := awsRestjson1_deserializeDocumentNodegroupScalingConfig(&sv.ScalingConfig, value); err != nil { - return err - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NodegroupStatus to be of type string, got %T instead", value) - } - sv.Status = types.NodegroupStatus(jtv) - } - - case "subnets": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Subnets, value); err != nil { - return err - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "taints": - if err := awsRestjson1_deserializeDocumentTaintsList(&sv.Taints, value); err != nil { - return err - } - - case "updateConfig": - if err := awsRestjson1_deserializeDocumentNodegroupUpdateConfig(&sv.UpdateConfig, value); err != nil { - return err - } - - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodegroupHealth(v **types.NodegroupHealth, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodegroupHealth - if *v == nil { - sv = &types.NodegroupHealth{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issues": - if err := awsRestjson1_deserializeDocumentIssueList(&sv.Issues, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodegroupResources(v **types.NodegroupResources, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodegroupResources - if *v == nil { - sv = &types.NodegroupResources{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "autoScalingGroups": - if err := awsRestjson1_deserializeDocumentAutoScalingGroupList(&sv.AutoScalingGroups, value); err != nil { - return err - } - - case "remoteAccessSecurityGroup": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RemoteAccessSecurityGroup = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodegroupScalingConfig(v **types.NodegroupScalingConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodegroupScalingConfig - if *v == nil { - sv = &types.NodegroupScalingConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "desiredSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ZeroCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.DesiredSize = ptr.Int32(int32(i64)) - } - - case "maxSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Capacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxSize = ptr.Int32(int32(i64)) - } - - case "minSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ZeroCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MinSize = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodegroupUpdateConfig(v **types.NodegroupUpdateConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodegroupUpdateConfig - if *v == nil { - sv = &types.NodegroupUpdateConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "maxUnavailable": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonZeroInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxUnavailable = ptr.Int32(int32(i64)) - } - - case "maxUnavailablePercentage": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PercentCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxUnavailablePercentage = ptr.Int32(int32(i64)) - } - - case "updateStrategy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NodegroupUpdateStrategies to be of type string, got %T instead", value) - } - sv.UpdateStrategy = types.NodegroupUpdateStrategies(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodeRepairConfig(v **types.NodeRepairConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodeRepairConfig - if *v == nil { - sv = &types.NodeRepairConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - case "maxParallelNodesRepairedCount": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonZeroInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxParallelNodesRepairedCount = ptr.Int32(int32(i64)) - } - - case "maxParallelNodesRepairedPercentage": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PercentCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxParallelNodesRepairedPercentage = ptr.Int32(int32(i64)) - } - - case "maxUnhealthyNodeThresholdCount": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonZeroInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxUnhealthyNodeThresholdCount = ptr.Int32(int32(i64)) - } - - case "maxUnhealthyNodeThresholdPercentage": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PercentCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MaxUnhealthyNodeThresholdPercentage = ptr.Int32(int32(i64)) - } - - case "nodeRepairConfigOverrides": - if err := awsRestjson1_deserializeDocumentNodeRepairConfigOverridesList(&sv.NodeRepairConfigOverrides, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodeRepairConfigOverrides(v **types.NodeRepairConfigOverrides, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NodeRepairConfigOverrides - if *v == nil { - sv = &types.NodeRepairConfigOverrides{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "minRepairWaitTimeMins": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonZeroInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.MinRepairWaitTimeMins = ptr.Int32(int32(i64)) - } - - case "nodeMonitoringCondition": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodeMonitoringCondition = ptr.String(jtv) - } - - case "nodeUnhealthyReason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodeUnhealthyReason = ptr.String(jtv) - } - - case "repairAction": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RepairAction to be of type string, got %T instead", value) - } - sv.RepairAction = types.RepairAction(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentNodeRepairConfigOverridesList(v *[]types.NodeRepairConfigOverrides, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.NodeRepairConfigOverrides - if *v == nil { - cv = []types.NodeRepairConfigOverrides{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.NodeRepairConfigOverrides - destAddr := &col - if err := awsRestjson1_deserializeDocumentNodeRepairConfigOverrides(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NotFoundException - if *v == nil { - sv = &types.NotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentOIDC(v **types.OIDC, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OIDC - if *v == nil { - sv = &types.OIDC{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "issuer": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Issuer = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentOidcIdentityProviderConfig(v **types.OidcIdentityProviderConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OidcIdentityProviderConfig - if *v == nil { - sv = &types.OidcIdentityProviderConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clientId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClientId = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "groupsClaim": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.GroupsClaim = ptr.String(jtv) - } - - case "groupsPrefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.GroupsPrefix = ptr.String(jtv) - } - - case "identityProviderConfigArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IdentityProviderConfigArn = ptr.String(jtv) - } - - case "identityProviderConfigName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IdentityProviderConfigName = ptr.String(jtv) - } - - case "issuerUrl": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.IssuerUrl = ptr.String(jtv) - } - - case "requiredClaims": - if err := awsRestjson1_deserializeDocumentRequiredClaimsMap(&sv.RequiredClaims, value); err != nil { - return err - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected configStatus to be of type string, got %T instead", value) - } - sv.Status = types.ConfigStatus(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "usernameClaim": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.UsernameClaim = ptr.String(jtv) - } - - case "usernamePrefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.UsernamePrefix = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentOutpostConfigResponse(v **types.OutpostConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OutpostConfigResponse - if *v == nil { - sv = &types.OutpostConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "controlPlaneInstanceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ControlPlaneInstanceType = ptr.String(jtv) - } - - case "controlPlanePlacement": - if err := awsRestjson1_deserializeDocumentControlPlanePlacementResponse(&sv.ControlPlanePlacement, value); err != nil { - return err - } - - case "outpostArns": - if err := awsRestjson1_deserializeDocumentStringList(&sv.OutpostArns, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPodIdentityAssociation(v **types.PodIdentityAssociation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PodIdentityAssociation - if *v == nil { - sv = &types.PodIdentityAssociation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "associationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AssociationArn = ptr.String(jtv) - } - - case "associationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AssociationId = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "disableSessionTags": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.DisableSessionTags = ptr.Bool(jtv) - } - - case "externalId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ExternalId = ptr.String(jtv) - } - - case "modifiedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - case "ownerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.OwnerArn = ptr.String(jtv) - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) - } - - case "serviceAccount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceAccount = ptr.String(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "targetRoleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.TargetRoleArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPodIdentityAssociationSummaries(v *[]types.PodIdentityAssociationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PodIdentityAssociationSummary - if *v == nil { - cv = []types.PodIdentityAssociationSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PodIdentityAssociationSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentPodIdentityAssociationSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentPodIdentityAssociationSummary(v **types.PodIdentityAssociationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PodIdentityAssociationSummary - if *v == nil { - sv = &types.PodIdentityAssociationSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "associationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AssociationArn = ptr.String(jtv) - } - - case "associationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AssociationId = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - case "ownerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.OwnerArn = ptr.String(jtv) - } - - case "serviceAccount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ServiceAccount = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentProvider(v **types.Provider, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Provider - if *v == nil { - sv = &types.Provider{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "keyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.KeyArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRemoteAccessConfig(v **types.RemoteAccessConfig, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RemoteAccessConfig - if *v == nil { - sv = &types.RemoteAccessConfig{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ec2SshKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Ec2SshKey = ptr.String(jtv) - } - - case "sourceSecurityGroups": - if err := awsRestjson1_deserializeDocumentStringList(&sv.SourceSecurityGroups, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRemoteNetworkConfigResponse(v **types.RemoteNetworkConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RemoteNetworkConfigResponse - if *v == nil { - sv = &types.RemoteNetworkConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "remoteNodeNetworks": - if err := awsRestjson1_deserializeDocumentRemoteNodeNetworkList(&sv.RemoteNodeNetworks, value); err != nil { - return err - } - - case "remotePodNetworks": - if err := awsRestjson1_deserializeDocumentRemotePodNetworkList(&sv.RemotePodNetworks, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRemoteNodeNetwork(v **types.RemoteNodeNetwork, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RemoteNodeNetwork - if *v == nil { - sv = &types.RemoteNodeNetwork{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cidrs": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Cidrs, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRemoteNodeNetworkList(v *[]types.RemoteNodeNetwork, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RemoteNodeNetwork - if *v == nil { - cv = []types.RemoteNodeNetwork{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RemoteNodeNetwork - destAddr := &col - if err := awsRestjson1_deserializeDocumentRemoteNodeNetwork(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentRemotePodNetwork(v **types.RemotePodNetwork, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RemotePodNetwork - if *v == nil { - sv = &types.RemotePodNetwork{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "cidrs": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Cidrs, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRemotePodNetworkList(v *[]types.RemotePodNetwork, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RemotePodNetwork - if *v == nil { - cv = []types.RemotePodNetwork{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RemotePodNetwork - destAddr := &col - if err := awsRestjson1_deserializeDocumentRemotePodNetwork(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentRequiredClaimsMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected requiredClaimsValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceInUseException - if *v == nil { - sv = &types.ResourceInUseException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceLimitExceededException - if *v == nil { - sv = &types.ResourceLimitExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceNotFoundException - if *v == nil { - sv = &types.ResourceNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "fargateProfileName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.FargateProfileName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourcePropagationDelayException(v **types.ResourcePropagationDelayException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourcePropagationDelayException - if *v == nil { - sv = &types.ResourcePropagationDelayException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentServerException(v **types.ServerException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServerException - if *v == nil { - sv = &types.ServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "subscriptionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.SubscriptionId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServiceUnavailableException - if *v == nil { - sv = &types.ServiceUnavailableException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentSsoIdentity(v **types.SsoIdentity, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SsoIdentity - if *v == nil { - sv = &types.SsoIdentity{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SsoIdentityType to be of type string, got %T instead", value) - } - sv.Type = types.SsoIdentityType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentSsoIdentityList(v *[]types.SsoIdentity, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SsoIdentity - if *v == nil { - cv = []types.SsoIdentity{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SsoIdentity - destAddr := &col - if err := awsRestjson1_deserializeDocumentSsoIdentity(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentStorageConfigResponse(v **types.StorageConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.StorageConfigResponse - if *v == nil { - sv = &types.StorageConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "blockStorage": - if err := awsRestjson1_deserializeDocumentBlockStorage(&sv.BlockStorage, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentTaint(v **types.Taint, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Taint - if *v == nil { - sv = &types.Taint{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "effect": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TaintEffect to be of type string, got %T instead", value) - } - sv.Effect = types.TaintEffect(jtv) - } - - case "key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected taintKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected taintValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentTaintsList(v *[]types.Taint, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Taint - if *v == nil { - cv = []types.Taint{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Taint - destAddr := &col - if err := awsRestjson1_deserializeDocumentTaint(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ThrottlingException - if *v == nil { - sv = &types.ThrottlingException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUnsupportedAvailabilityZoneException(v **types.UnsupportedAvailabilityZoneException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UnsupportedAvailabilityZoneException - if *v == nil { - sv = &types.UnsupportedAvailabilityZoneException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterName = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "nodegroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NodegroupName = ptr.String(jtv) - } - - case "validZones": - if err := awsRestjson1_deserializeDocumentStringList(&sv.ValidZones, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUpdate(v **types.Update, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Update - if *v == nil { - sv = &types.Update{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "errors": - if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.Errors, value); err != nil { - return err - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "params": - if err := awsRestjson1_deserializeDocumentUpdateParams(&sv.Params, value); err != nil { - return err - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpdateStatus to be of type string, got %T instead", value) - } - sv.Status = types.UpdateStatus(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpdateType to be of type string, got %T instead", value) - } - sv.Type = types.UpdateType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUpdateParam(v **types.UpdateParam, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UpdateParam - if *v == nil { - sv = &types.UpdateParam{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UpdateParamType to be of type string, got %T instead", value) - } - sv.Type = types.UpdateParamType(jtv) - } - - case "value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentUpdateParams(v *[]types.UpdateParam, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.UpdateParam - if *v == nil { - cv = []types.UpdateParam{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.UpdateParam - destAddr := &col - if err := awsRestjson1_deserializeDocumentUpdateParam(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentUpgradePolicyResponse(v **types.UpgradePolicyResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UpgradePolicyResponse - if *v == nil { - sv = &types.UpgradePolicyResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "supportType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SupportType to be of type string, got %T instead", value) - } - sv.SupportType = types.SupportType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentVpcConfigResponse(v **types.VpcConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.VpcConfigResponse - if *v == nil { - sv = &types.VpcConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "clusterSecurityGroupId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ClusterSecurityGroupId = ptr.String(jtv) - } - - case "endpointPrivateAccess": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.EndpointPrivateAccess = jtv - } - - case "endpointPublicAccess": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.EndpointPublicAccess = jtv - } - - case "publicAccessCidrs": - if err := awsRestjson1_deserializeDocumentStringList(&sv.PublicAccessCidrs, value); err != nil { - return err - } - - case "securityGroupIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroupIds, value); err != nil { - return err - } - - case "subnetIds": - if err := awsRestjson1_deserializeDocumentStringList(&sv.SubnetIds, value); err != nil { - return err - } - - case "vpcId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.VpcId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentZonalShiftConfigResponse(v **types.ZonalShiftConfigResponse, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ZonalShiftConfigResponse - if *v == nil { - sv = &types.ZonalShiftConfigResponse{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BoxedBoolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/doc.go deleted file mode 100644 index 588db993c11a..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package eks provides the API client, operations, and parameter types for Amazon -// Elastic Kubernetes Service. -// -// Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes -// it easy for you to run Kubernetes on Amazon Web Services without needing to -// setup or maintain your own Kubernetes control plane. Kubernetes is an -// open-source system for automating the deployment, scaling, and management of -// containerized applications. -// -// Amazon EKS runs up-to-date versions of the open-source Kubernetes software, so -// you can use all the existing plugins and tooling from the Kubernetes community. -// Applications running on Amazon EKS are fully compatible with applications -// running on any standard Kubernetes environment, whether running in on-premises -// data centers or public clouds. This means that you can easily migrate any -// standard Kubernetes application to Amazon EKS without any code modification -// required. -package eks diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/endpoints.go deleted file mode 100644 index a0e50f670f54..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/endpoints.go +++ /dev/null @@ -1,590 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/endpoints/private/rulesfn" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "eks" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_EKS") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "EKS", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) (*string, error) { - if region == "" { - return nil, nil - } - if !rulesfn.IsValidHostLabel(region, true) { - return nil, fmt.Errorf("invalid input region %s", region) - } - - return aws.String(endpoints.MapFIPSRegion(region)), nil -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://eks-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - if _PartitionResult.Name == "aws" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://fips.eks.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _PartitionResult.Name == "aws-us-gov" { - uriString := func() string { - var out strings.Builder - out.WriteString("https://eks.") - out.WriteString(_Region) - out.WriteString(".amazonaws.com") - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://eks-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://eks.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://eks.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { - params := &EndpointParameters{} - - region, err := bindRegion(options.Region) - if err != nil { - return nil, err - } - params.Region = region - - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params, nil -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) - } - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/generated.json deleted file mode 100644 index ef8f2d52953b..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/generated.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AssociateAccessPolicy.go", - "api_op_AssociateEncryptionConfig.go", - "api_op_AssociateIdentityProviderConfig.go", - "api_op_CreateAccessEntry.go", - "api_op_CreateAddon.go", - "api_op_CreateCapability.go", - "api_op_CreateCluster.go", - "api_op_CreateEksAnywhereSubscription.go", - "api_op_CreateFargateProfile.go", - "api_op_CreateNodegroup.go", - "api_op_CreatePodIdentityAssociation.go", - "api_op_DeleteAccessEntry.go", - "api_op_DeleteAddon.go", - "api_op_DeleteCapability.go", - "api_op_DeleteCluster.go", - "api_op_DeleteEksAnywhereSubscription.go", - "api_op_DeleteFargateProfile.go", - "api_op_DeleteNodegroup.go", - "api_op_DeletePodIdentityAssociation.go", - "api_op_DeregisterCluster.go", - "api_op_DescribeAccessEntry.go", - "api_op_DescribeAddon.go", - "api_op_DescribeAddonConfiguration.go", - "api_op_DescribeAddonVersions.go", - "api_op_DescribeCapability.go", - "api_op_DescribeCluster.go", - "api_op_DescribeClusterVersions.go", - "api_op_DescribeEksAnywhereSubscription.go", - "api_op_DescribeFargateProfile.go", - "api_op_DescribeIdentityProviderConfig.go", - "api_op_DescribeInsight.go", - "api_op_DescribeInsightsRefresh.go", - "api_op_DescribeNodegroup.go", - "api_op_DescribePodIdentityAssociation.go", - "api_op_DescribeUpdate.go", - "api_op_DisassociateAccessPolicy.go", - "api_op_DisassociateIdentityProviderConfig.go", - "api_op_ListAccessEntries.go", - "api_op_ListAccessPolicies.go", - "api_op_ListAddons.go", - "api_op_ListAssociatedAccessPolicies.go", - "api_op_ListCapabilities.go", - "api_op_ListClusters.go", - "api_op_ListEksAnywhereSubscriptions.go", - "api_op_ListFargateProfiles.go", - "api_op_ListIdentityProviderConfigs.go", - "api_op_ListInsights.go", - "api_op_ListNodegroups.go", - "api_op_ListPodIdentityAssociations.go", - "api_op_ListTagsForResource.go", - "api_op_ListUpdates.go", - "api_op_RegisterCluster.go", - "api_op_StartInsightsRefresh.go", - "api_op_TagResource.go", - "api_op_UntagResource.go", - "api_op_UpdateAccessEntry.go", - "api_op_UpdateAddon.go", - "api_op_UpdateCapability.go", - "api_op_UpdateClusterConfig.go", - "api_op_UpdateClusterVersion.go", - "api_op_UpdateEksAnywhereSubscription.go", - "api_op_UpdateNodegroupConfig.go", - "api_op_UpdateNodegroupVersion.go", - "api_op_UpdatePodIdentityAssociation.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/enums.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.23", - "module": "github.com/aws/aws-sdk-go-v2/service/eks", - "unstable": false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/go_module_metadata.go deleted file mode 100644 index a7926342bd6c..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package eks - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.77.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints/endpoints.go deleted file mode 100644 index dc103a57fe57..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints/endpoints.go +++ /dev/null @@ -1,577 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver EKS endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "eks.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "fips.eks.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "eks-fips.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "af-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-northeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-4", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-5", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-6", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ap-southeast-7", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "ca-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-central-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-south-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "eu-west-3", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "fips-us-east-1", - }: endpoints.Endpoint{ - Hostname: "fips.eks.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-east-2", - }: endpoints.Endpoint{ - Hostname: "fips.eks.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-west-1", - }: endpoints.Endpoint{ - Hostname: "fips.eks.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-west-2", - }: endpoints.Endpoint{ - Hostname: "fips.eks.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "il-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "me-south-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "mx-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "sa-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "fips.eks.us-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-east-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "fips.eks.us-east-2.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "fips.eks.us-west-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "fips.eks.us-west-2.amazonaws.com", - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "eks.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.amazonaws.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "eks-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.amazonaws.com.cn", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "cn-north-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "cn-northwest-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "eks.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "eks-fips.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "eusc-de-east-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.c2s.ic.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.c2s.ic.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-iso-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-iso-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.sc2s.sgov.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isob-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-isob-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.cloud.adc-e.uk", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "eu-isoe-west-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.csp.hci.ic.gov", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "us-isof-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-isof-south-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "eks.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "eks-fips.{region}.api.aws", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "eks.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "fips-us-gov-east-1", - }: endpoints.Endpoint{ - Hostname: "eks.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-gov-west-1", - }: endpoints.Endpoint{ - Hostname: "eks.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-gov-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks.us-gov-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-gov-west-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "eks.us-gov-west-1.amazonaws.com", - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/options.go deleted file mode 100644 index 08a625bf275f..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/options.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // Provides idempotency tokens values that will be automatically populated into - // idempotent API operations. - IdempotencyTokenProvider IdempotencyTokenProvider - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/serializers.go deleted file mode 100644 index 82d902a8ff24..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/serializers.go +++ /dev/null @@ -1,7354 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpAssociateAccessPolicy struct { -} - -func (*awsRestjson1_serializeOpAssociateAccessPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpAssociateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateAccessPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}/access-policies") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsAssociateAccessPolicyInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentAssociateAccessPolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsAssociateAccessPolicyInput(v *AssociateAccessPolicyInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentAssociateAccessPolicyInput(v *AssociateAccessPolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccessScope != nil { - ok := object.Key("accessScope") - if err := awsRestjson1_serializeDocumentAccessScope(v.AccessScope, ok); err != nil { - return err - } - } - - if v.PolicyArn != nil { - ok := object.Key("policyArn") - ok.String(*v.PolicyArn) - } - - return nil -} - -type awsRestjson1_serializeOpAssociateEncryptionConfig struct { -} - -func (*awsRestjson1_serializeOpAssociateEncryptionConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpAssociateEncryptionConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateEncryptionConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/encryption-config/associate") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsAssociateEncryptionConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentAssociateEncryptionConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsAssociateEncryptionConfigInput(v *AssociateEncryptionConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentAssociateEncryptionConfigInput(v *AssociateEncryptionConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.EncryptionConfig != nil { - ok := object.Key("encryptionConfig") - if err := awsRestjson1_serializeDocumentEncryptionConfigList(v.EncryptionConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpAssociateIdentityProviderConfig struct { -} - -func (*awsRestjson1_serializeOpAssociateIdentityProviderConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpAssociateIdentityProviderConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateIdentityProviderConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/identity-provider-configs/associate") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsAssociateIdentityProviderConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentAssociateIdentityProviderConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsAssociateIdentityProviderConfigInput(v *AssociateIdentityProviderConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentAssociateIdentityProviderConfigInput(v *AssociateIdentityProviderConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Oidc != nil { - ok := object.Key("oidc") - if err := awsRestjson1_serializeDocumentOidcIdentityProviderConfigRequest(v.Oidc, ok); err != nil { - return err - } - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateAccessEntry struct { -} - -func (*awsRestjson1_serializeOpCreateAccessEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateAccessEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateAccessEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreateAccessEntryInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateAccessEntryInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateAccessEntryInput(v *CreateAccessEntryInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateAccessEntryInput(v *CreateAccessEntryInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.KubernetesGroups != nil { - ok := object.Key("kubernetesGroups") - if err := awsRestjson1_serializeDocumentStringList(v.KubernetesGroups, ok); err != nil { - return err - } - } - - if v.PrincipalArn != nil { - ok := object.Key("principalArn") - ok.String(*v.PrincipalArn) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if v.Type != nil { - ok := object.Key("type") - ok.String(*v.Type) - } - - if v.Username != nil { - ok := object.Key("username") - ok.String(*v.Username) - } - - return nil -} - -type awsRestjson1_serializeOpCreateAddon struct { -} - -func (*awsRestjson1_serializeOpCreateAddon) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateAddon) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateAddonInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/addons") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreateAddonInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateAddonInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateAddonInput(v *CreateAddonInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateAddonInput(v *CreateAddonInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AddonName != nil { - ok := object.Key("addonName") - ok.String(*v.AddonName) - } - - if v.AddonVersion != nil { - ok := object.Key("addonVersion") - ok.String(*v.AddonVersion) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.ConfigurationValues != nil { - ok := object.Key("configurationValues") - ok.String(*v.ConfigurationValues) - } - - if v.NamespaceConfig != nil { - ok := object.Key("namespaceConfig") - if err := awsRestjson1_serializeDocumentAddonNamespaceConfigRequest(v.NamespaceConfig, ok); err != nil { - return err - } - } - - if v.PodIdentityAssociations != nil { - ok := object.Key("podIdentityAssociations") - if err := awsRestjson1_serializeDocumentAddonPodIdentityAssociationsList(v.PodIdentityAssociations, ok); err != nil { - return err - } - } - - if len(v.ResolveConflicts) > 0 { - ok := object.Key("resolveConflicts") - ok.String(string(v.ResolveConflicts)) - } - - if v.ServiceAccountRoleArn != nil { - ok := object.Key("serviceAccountRoleArn") - ok.String(*v.ServiceAccountRoleArn) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateCapability struct { -} - -func (*awsRestjson1_serializeOpCreateCapability) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateCapability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateCapabilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/capabilities") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreateCapabilityInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateCapabilityInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateCapabilityInput(v *CreateCapabilityInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateCapabilityInput(v *CreateCapabilityInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CapabilityName != nil { - ok := object.Key("capabilityName") - ok.String(*v.CapabilityName) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Configuration != nil { - ok := object.Key("configuration") - if err := awsRestjson1_serializeDocumentCapabilityConfigurationRequest(v.Configuration, ok); err != nil { - return err - } - } - - if len(v.DeletePropagationPolicy) > 0 { - ok := object.Key("deletePropagationPolicy") - ok.String(string(v.DeletePropagationPolicy)) - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) - } - - return nil -} - -type awsRestjson1_serializeOpCreateCluster struct { -} - -func (*awsRestjson1_serializeOpCreateCluster) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateClusterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateClusterInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateClusterInput(v *CreateClusterInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccessConfig != nil { - ok := object.Key("accessConfig") - if err := awsRestjson1_serializeDocumentCreateAccessConfigRequest(v.AccessConfig, ok); err != nil { - return err - } - } - - if v.BootstrapSelfManagedAddons != nil { - ok := object.Key("bootstrapSelfManagedAddons") - ok.Boolean(*v.BootstrapSelfManagedAddons) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.ComputeConfig != nil { - ok := object.Key("computeConfig") - if err := awsRestjson1_serializeDocumentComputeConfigRequest(v.ComputeConfig, ok); err != nil { - return err - } - } - - if v.ControlPlaneScalingConfig != nil { - ok := object.Key("controlPlaneScalingConfig") - if err := awsRestjson1_serializeDocumentControlPlaneScalingConfig(v.ControlPlaneScalingConfig, ok); err != nil { - return err - } - } - - if v.DeletionProtection != nil { - ok := object.Key("deletionProtection") - ok.Boolean(*v.DeletionProtection) - } - - if v.EncryptionConfig != nil { - ok := object.Key("encryptionConfig") - if err := awsRestjson1_serializeDocumentEncryptionConfigList(v.EncryptionConfig, ok); err != nil { - return err - } - } - - if v.KubernetesNetworkConfig != nil { - ok := object.Key("kubernetesNetworkConfig") - if err := awsRestjson1_serializeDocumentKubernetesNetworkConfigRequest(v.KubernetesNetworkConfig, ok); err != nil { - return err - } - } - - if v.Logging != nil { - ok := object.Key("logging") - if err := awsRestjson1_serializeDocumentLogging(v.Logging, ok); err != nil { - return err - } - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.OutpostConfig != nil { - ok := object.Key("outpostConfig") - if err := awsRestjson1_serializeDocumentOutpostConfigRequest(v.OutpostConfig, ok); err != nil { - return err - } - } - - if v.RemoteNetworkConfig != nil { - ok := object.Key("remoteNetworkConfig") - if err := awsRestjson1_serializeDocumentRemoteNetworkConfigRequest(v.RemoteNetworkConfig, ok); err != nil { - return err - } - } - - if v.ResourcesVpcConfig != nil { - ok := object.Key("resourcesVpcConfig") - if err := awsRestjson1_serializeDocumentVpcConfigRequest(v.ResourcesVpcConfig, ok); err != nil { - return err - } - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - if v.StorageConfig != nil { - ok := object.Key("storageConfig") - if err := awsRestjson1_serializeDocumentStorageConfigRequest(v.StorageConfig, ok); err != nil { - return err - } - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if v.UpgradePolicy != nil { - ok := object.Key("upgradePolicy") - if err := awsRestjson1_serializeDocumentUpgradePolicyRequest(v.UpgradePolicy, ok); err != nil { - return err - } - } - - if v.Version != nil { - ok := object.Key("version") - ok.String(*v.Version) - } - - if v.ZonalShiftConfig != nil { - ok := object.Key("zonalShiftConfig") - if err := awsRestjson1_serializeDocumentZonalShiftConfigRequest(v.ZonalShiftConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateEksAnywhereSubscription struct { -} - -func (*awsRestjson1_serializeOpCreateEksAnywhereSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateEksAnywhereSubscriptionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AutoRenew { - ok := object.Key("autoRenew") - ok.Boolean(v.AutoRenew) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.LicenseQuantity != 0 { - ok := object.Key("licenseQuantity") - ok.Integer(v.LicenseQuantity) - } - - if len(v.LicenseType) > 0 { - ok := object.Key("licenseType") - ok.String(string(v.LicenseType)) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if v.Term != nil { - ok := object.Key("term") - if err := awsRestjson1_serializeDocumentEksAnywhereSubscriptionTerm(v.Term, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateFargateProfile struct { -} - -func (*awsRestjson1_serializeOpCreateFargateProfile) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateFargateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateFargateProfileInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/fargate-profiles") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreateFargateProfileInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateFargateProfileInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateFargateProfileInput(v *CreateFargateProfileInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateFargateProfileInput(v *CreateFargateProfileInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.FargateProfileName != nil { - ok := object.Key("fargateProfileName") - ok.String(*v.FargateProfileName) - } - - if v.PodExecutionRoleArn != nil { - ok := object.Key("podExecutionRoleArn") - ok.String(*v.PodExecutionRoleArn) - } - - if v.Selectors != nil { - ok := object.Key("selectors") - if err := awsRestjson1_serializeDocumentFargateProfileSelectors(v.Selectors, ok); err != nil { - return err - } - } - - if v.Subnets != nil { - ok := object.Key("subnets") - if err := awsRestjson1_serializeDocumentStringList(v.Subnets, ok); err != nil { - return err - } - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateNodegroup struct { -} - -func (*awsRestjson1_serializeOpCreateNodegroup) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateNodegroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateNodegroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreateNodegroupInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateNodegroupInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateNodegroupInput(v *CreateNodegroupInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateNodegroupInput(v *CreateNodegroupInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.AmiType) > 0 { - ok := object.Key("amiType") - ok.String(string(v.AmiType)) - } - - if len(v.CapacityType) > 0 { - ok := object.Key("capacityType") - ok.String(string(v.CapacityType)) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.DiskSize != nil { - ok := object.Key("diskSize") - ok.Integer(*v.DiskSize) - } - - if v.InstanceTypes != nil { - ok := object.Key("instanceTypes") - if err := awsRestjson1_serializeDocumentStringList(v.InstanceTypes, ok); err != nil { - return err - } - } - - if v.Labels != nil { - ok := object.Key("labels") - if err := awsRestjson1_serializeDocumentLabelsMap(v.Labels, ok); err != nil { - return err - } - } - - if v.LaunchTemplate != nil { - ok := object.Key("launchTemplate") - if err := awsRestjson1_serializeDocumentLaunchTemplateSpecification(v.LaunchTemplate, ok); err != nil { - return err - } - } - - if v.NodegroupName != nil { - ok := object.Key("nodegroupName") - ok.String(*v.NodegroupName) - } - - if v.NodeRepairConfig != nil { - ok := object.Key("nodeRepairConfig") - if err := awsRestjson1_serializeDocumentNodeRepairConfig(v.NodeRepairConfig, ok); err != nil { - return err - } - } - - if v.NodeRole != nil { - ok := object.Key("nodeRole") - ok.String(*v.NodeRole) - } - - if v.ReleaseVersion != nil { - ok := object.Key("releaseVersion") - ok.String(*v.ReleaseVersion) - } - - if v.RemoteAccess != nil { - ok := object.Key("remoteAccess") - if err := awsRestjson1_serializeDocumentRemoteAccessConfig(v.RemoteAccess, ok); err != nil { - return err - } - } - - if v.ScalingConfig != nil { - ok := object.Key("scalingConfig") - if err := awsRestjson1_serializeDocumentNodegroupScalingConfig(v.ScalingConfig, ok); err != nil { - return err - } - } - - if v.Subnets != nil { - ok := object.Key("subnets") - if err := awsRestjson1_serializeDocumentStringList(v.Subnets, ok); err != nil { - return err - } - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if v.Taints != nil { - ok := object.Key("taints") - if err := awsRestjson1_serializeDocumentTaintsList(v.Taints, ok); err != nil { - return err - } - } - - if v.UpdateConfig != nil { - ok := object.Key("updateConfig") - if err := awsRestjson1_serializeDocumentNodegroupUpdateConfig(v.UpdateConfig, ok); err != nil { - return err - } - } - - if v.Version != nil { - ok := object.Key("version") - ok.String(*v.Version) - } - - return nil -} - -type awsRestjson1_serializeOpCreatePodIdentityAssociation struct { -} - -func (*awsRestjson1_serializeOpCreatePodIdentityAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreatePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreatePodIdentityAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreatePodIdentityAssociationInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreatePodIdentityAssociationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.DisableSessionTags != nil { - ok := object.Key("disableSessionTags") - ok.Boolean(*v.DisableSessionTags) - } - - if v.Namespace != nil { - ok := object.Key("namespace") - ok.String(*v.Namespace) - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - if v.ServiceAccount != nil { - ok := object.Key("serviceAccount") - ok.String(*v.ServiceAccount) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - if v.TargetRoleArn != nil { - ok := object.Key("targetRoleArn") - ok.String(*v.TargetRoleArn) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteAccessEntry struct { -} - -func (*awsRestjson1_serializeOpDeleteAccessEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteAccessEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteAccessEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteAccessEntryInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteAccessEntryInput(v *DeleteAccessEntryInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteAddon struct { -} - -func (*awsRestjson1_serializeOpDeleteAddon) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteAddon) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteAddonInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/addons/{addonName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteAddonInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteAddonInput(v *DeleteAddonInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName == nil || len(*v.AddonName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member addonName must not be empty")} - } - if v.AddonName != nil { - if err := encoder.SetURI("addonName").String(*v.AddonName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.Preserve { - encoder.SetQuery("preserve").Boolean(v.Preserve) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteCapability struct { -} - -func (*awsRestjson1_serializeOpDeleteCapability) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteCapability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteCapabilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/capabilities/{capabilityName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteCapabilityInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteCapabilityInput(v *DeleteCapabilityInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.CapabilityName == nil || len(*v.CapabilityName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityName must not be empty")} - } - if v.CapabilityName != nil { - if err := encoder.SetURI("capabilityName").String(*v.CapabilityName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteCluster struct { -} - -func (*awsRestjson1_serializeOpDeleteCluster) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteClusterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteClusterInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteClusterInput(v *DeleteClusterInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteEksAnywhereSubscription struct { -} - -func (*awsRestjson1_serializeOpDeleteEksAnywhereSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteEksAnywhereSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteEksAnywhereSubscriptionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteEksAnywhereSubscriptionInput(v *DeleteEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id == nil || len(*v.Id) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} - } - if v.Id != nil { - if err := encoder.SetURI("id").String(*v.Id); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteFargateProfile struct { -} - -func (*awsRestjson1_serializeOpDeleteFargateProfile) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteFargateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteFargateProfileInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/fargate-profiles/{fargateProfileName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteFargateProfileInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteFargateProfileInput(v *DeleteFargateProfileInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.FargateProfileName == nil || len(*v.FargateProfileName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member fargateProfileName must not be empty")} - } - if v.FargateProfileName != nil { - if err := encoder.SetURI("fargateProfileName").String(*v.FargateProfileName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteNodegroup struct { -} - -func (*awsRestjson1_serializeOpDeleteNodegroup) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteNodegroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteNodegroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups/{nodegroupName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteNodegroupInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteNodegroupInput(v *DeleteNodegroupInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.NodegroupName == nil || len(*v.NodegroupName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member nodegroupName must not be empty")} - } - if v.NodegroupName != nil { - if err := encoder.SetURI("nodegroupName").String(*v.NodegroupName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeletePodIdentityAssociation struct { -} - -func (*awsRestjson1_serializeOpDeletePodIdentityAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeletePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeletePodIdentityAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeletePodIdentityAssociationInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeletePodIdentityAssociationInput(v *DeletePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AssociationId == nil || len(*v.AssociationId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} - } - if v.AssociationId != nil { - if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeregisterCluster struct { -} - -func (*awsRestjson1_serializeOpDeregisterCluster) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeregisterCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeregisterClusterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/cluster-registrations/{name}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeregisterClusterInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeregisterClusterInput(v *DeregisterClusterInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeAccessEntry struct { -} - -func (*awsRestjson1_serializeOpDescribeAccessEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeAccessEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeAccessEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeAccessEntryInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeAccessEntryInput(v *DescribeAccessEntryInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeAddon struct { -} - -func (*awsRestjson1_serializeOpDescribeAddon) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeAddon) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeAddonInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/addons/{addonName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeAddonInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeAddonInput(v *DescribeAddonInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName == nil || len(*v.AddonName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member addonName must not be empty")} - } - if v.AddonName != nil { - if err := encoder.SetURI("addonName").String(*v.AddonName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeAddonConfiguration struct { -} - -func (*awsRestjson1_serializeOpDescribeAddonConfiguration) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeAddonConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeAddonConfigurationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/addons/configuration-schemas") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeAddonConfigurationInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeAddonConfigurationInput(v *DescribeAddonConfigurationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName != nil { - encoder.SetQuery("addonName").String(*v.AddonName) - } - - if v.AddonVersion != nil { - encoder.SetQuery("addonVersion").String(*v.AddonVersion) - } - - return nil -} - -type awsRestjson1_serializeOpDescribeAddonVersions struct { -} - -func (*awsRestjson1_serializeOpDescribeAddonVersions) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeAddonVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeAddonVersionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/addons/supported-versions") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeAddonVersionsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeAddonVersionsInput(v *DescribeAddonVersionsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName != nil { - encoder.SetQuery("addonName").String(*v.AddonName) - } - - if v.KubernetesVersion != nil { - encoder.SetQuery("kubernetesVersion").String(*v.KubernetesVersion) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.Owners != nil { - for i := range v.Owners { - encoder.AddQuery("owners").String(v.Owners[i]) - } - } - - if v.Publishers != nil { - for i := range v.Publishers { - encoder.AddQuery("publishers").String(v.Publishers[i]) - } - } - - if v.Types != nil { - for i := range v.Types { - encoder.AddQuery("types").String(v.Types[i]) - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeCapability struct { -} - -func (*awsRestjson1_serializeOpDescribeCapability) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeCapability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeCapabilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/capabilities/{capabilityName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeCapabilityInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeCapabilityInput(v *DescribeCapabilityInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.CapabilityName == nil || len(*v.CapabilityName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityName must not be empty")} - } - if v.CapabilityName != nil { - if err := encoder.SetURI("capabilityName").String(*v.CapabilityName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeCluster struct { -} - -func (*awsRestjson1_serializeOpDescribeCluster) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeClusterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeClusterInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeClusterInput(v *DescribeClusterInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeClusterVersions struct { -} - -func (*awsRestjson1_serializeOpDescribeClusterVersions) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeClusterVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeClusterVersionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/cluster-versions") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeClusterVersionsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeClusterVersionsInput(v *DescribeClusterVersionsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterType != nil { - encoder.SetQuery("clusterType").String(*v.ClusterType) - } - - if v.ClusterVersions != nil { - for i := range v.ClusterVersions { - encoder.AddQuery("clusterVersions").String(v.ClusterVersions[i]) - } - } - - if v.DefaultOnly != nil { - encoder.SetQuery("defaultOnly").Boolean(*v.DefaultOnly) - } - - if v.IncludeAll != nil { - encoder.SetQuery("includeAll").Boolean(*v.IncludeAll) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if len(v.Status) > 0 { - encoder.SetQuery("status").String(string(v.Status)) - } - - if len(v.VersionStatus) > 0 { - encoder.SetQuery("versionStatus").String(string(v.VersionStatus)) - } - - return nil -} - -type awsRestjson1_serializeOpDescribeEksAnywhereSubscription struct { -} - -func (*awsRestjson1_serializeOpDescribeEksAnywhereSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeEksAnywhereSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeEksAnywhereSubscriptionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeEksAnywhereSubscriptionInput(v *DescribeEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id == nil || len(*v.Id) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} - } - if v.Id != nil { - if err := encoder.SetURI("id").String(*v.Id); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeFargateProfile struct { -} - -func (*awsRestjson1_serializeOpDescribeFargateProfile) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeFargateProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeFargateProfileInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/fargate-profiles/{fargateProfileName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeFargateProfileInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeFargateProfileInput(v *DescribeFargateProfileInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.FargateProfileName == nil || len(*v.FargateProfileName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member fargateProfileName must not be empty")} - } - if v.FargateProfileName != nil { - if err := encoder.SetURI("fargateProfileName").String(*v.FargateProfileName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeIdentityProviderConfig struct { -} - -func (*awsRestjson1_serializeOpDescribeIdentityProviderConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeIdentityProviderConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeIdentityProviderConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/identity-provider-configs/describe") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeIdentityProviderConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDescribeIdentityProviderConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeIdentityProviderConfigInput(v *DescribeIdentityProviderConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDescribeIdentityProviderConfigInput(v *DescribeIdentityProviderConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.IdentityProviderConfig != nil { - ok := object.Key("identityProviderConfig") - if err := awsRestjson1_serializeDocumentIdentityProviderConfig(v.IdentityProviderConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeInsight struct { -} - -func (*awsRestjson1_serializeOpDescribeInsight) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeInsight) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeInsightInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/insights/{id}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeInsightInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeInsightInput(v *DescribeInsightInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.Id == nil || len(*v.Id) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} - } - if v.Id != nil { - if err := encoder.SetURI("id").String(*v.Id); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeInsightsRefresh struct { -} - -func (*awsRestjson1_serializeOpDescribeInsightsRefresh) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeInsightsRefresh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeInsightsRefreshInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/insights-refresh") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeInsightsRefreshInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeInsightsRefreshInput(v *DescribeInsightsRefreshInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeNodegroup struct { -} - -func (*awsRestjson1_serializeOpDescribeNodegroup) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeNodegroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeNodegroupInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups/{nodegroupName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeNodegroupInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeNodegroupInput(v *DescribeNodegroupInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.NodegroupName == nil || len(*v.NodegroupName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member nodegroupName must not be empty")} - } - if v.NodegroupName != nil { - if err := encoder.SetURI("nodegroupName").String(*v.NodegroupName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribePodIdentityAssociation struct { -} - -func (*awsRestjson1_serializeOpDescribePodIdentityAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribePodIdentityAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribePodIdentityAssociationInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribePodIdentityAssociationInput(v *DescribePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AssociationId == nil || len(*v.AssociationId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} - } - if v.AssociationId != nil { - if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeUpdate struct { -} - -func (*awsRestjson1_serializeOpDescribeUpdate) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeUpdate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeUpdateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}/updates/{updateId}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeUpdateInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeUpdateInput(v *DescribeUpdateInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName != nil { - encoder.SetQuery("addonName").String(*v.AddonName) - } - - if v.CapabilityName != nil { - encoder.SetQuery("capabilityName").String(*v.CapabilityName) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - if v.NodegroupName != nil { - encoder.SetQuery("nodegroupName").String(*v.NodegroupName) - } - - if v.UpdateId == nil || len(*v.UpdateId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member updateId must not be empty")} - } - if v.UpdateId != nil { - if err := encoder.SetURI("updateId").String(*v.UpdateId); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDisassociateAccessPolicy struct { -} - -func (*awsRestjson1_serializeOpDisassociateAccessPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDisassociateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisassociateAccessPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}/access-policies/{policyArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDisassociateAccessPolicyInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDisassociateAccessPolicyInput(v *DisassociateAccessPolicyInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.PolicyArn == nil || len(*v.PolicyArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member policyArn must not be empty")} - } - if v.PolicyArn != nil { - if err := encoder.SetURI("policyArn").String(*v.PolicyArn); err != nil { - return err - } - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDisassociateIdentityProviderConfig struct { -} - -func (*awsRestjson1_serializeOpDisassociateIdentityProviderConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDisassociateIdentityProviderConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisassociateIdentityProviderConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/identity-provider-configs/disassociate") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDisassociateIdentityProviderConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentDisassociateIdentityProviderConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDisassociateIdentityProviderConfigInput(v *DisassociateIdentityProviderConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDisassociateIdentityProviderConfigInput(v *DisassociateIdentityProviderConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.IdentityProviderConfig != nil { - ok := object.Key("identityProviderConfig") - if err := awsRestjson1_serializeDocumentIdentityProviderConfig(v.IdentityProviderConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListAccessEntries struct { -} - -func (*awsRestjson1_serializeOpListAccessEntries) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAccessEntries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAccessEntriesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAccessEntriesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAccessEntriesInput(v *ListAccessEntriesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AssociatedPolicyArn != nil { - encoder.SetQuery("associatedPolicyArn").String(*v.AssociatedPolicyArn) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAccessPolicies struct { -} - -func (*awsRestjson1_serializeOpListAccessPolicies) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAccessPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAccessPoliciesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/access-policies") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(v *ListAccessPoliciesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAddons struct { -} - -func (*awsRestjson1_serializeOpListAddons) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAddons) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAddonsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/addons") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAddonsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAddonsInput(v *ListAddonsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListAssociatedAccessPolicies struct { -} - -func (*awsRestjson1_serializeOpListAssociatedAccessPolicies) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListAssociatedAccessPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAssociatedAccessPoliciesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}/access-policies") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListAssociatedAccessPoliciesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListAssociatedAccessPoliciesInput(v *ListAssociatedAccessPoliciesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListCapabilities struct { -} - -func (*awsRestjson1_serializeOpListCapabilities) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListCapabilities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCapabilitiesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/capabilities") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListCapabilitiesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListCapabilitiesInput(v *ListCapabilitiesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListClusters struct { -} - -func (*awsRestjson1_serializeOpListClusters) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListClustersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListClustersInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListClustersInput(v *ListClustersInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Include != nil { - for i := range v.Include { - encoder.AddQuery("include").String(v.Include[i]) - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListEksAnywhereSubscriptions struct { -} - -func (*awsRestjson1_serializeOpListEksAnywhereSubscriptions) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListEksAnywhereSubscriptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListEksAnywhereSubscriptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListEksAnywhereSubscriptionsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListEksAnywhereSubscriptionsInput(v *ListEksAnywhereSubscriptionsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.IncludeStatus != nil { - for i := range v.IncludeStatus { - encoder.AddQuery("includeStatus").String(string(v.IncludeStatus[i])) - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListFargateProfiles struct { -} - -func (*awsRestjson1_serializeOpListFargateProfiles) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListFargateProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListFargateProfilesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/fargate-profiles") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListFargateProfilesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListFargateProfilesInput(v *ListFargateProfilesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListIdentityProviderConfigs struct { -} - -func (*awsRestjson1_serializeOpListIdentityProviderConfigs) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListIdentityProviderConfigs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListIdentityProviderConfigsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/identity-provider-configs") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListIdentityProviderConfigsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListIdentityProviderConfigsInput(v *ListIdentityProviderConfigsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListInsights struct { -} - -func (*awsRestjson1_serializeOpListInsights) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListInsights) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListInsightsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/insights") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListInsightsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentListInsightsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListInsightsInput(v *ListInsightsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentListInsightsInput(v *ListInsightsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("filter") - if err := awsRestjson1_serializeDocumentInsightsFilter(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListNodegroups struct { -} - -func (*awsRestjson1_serializeOpListNodegroups) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListNodegroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListNodegroupsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListNodegroupsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListNodegroupsInput(v *ListNodegroupsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListPodIdentityAssociations struct { -} - -func (*awsRestjson1_serializeOpListPodIdentityAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListPodIdentityAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListPodIdentityAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListPodIdentityAssociationsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListPodIdentityAssociationsInput(v *ListPodIdentityAssociationsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.Namespace != nil { - encoder.SetQuery("namespace").String(*v.Namespace) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.ServiceAccount != nil { - encoder.SetQuery("serviceAccount").String(*v.ServiceAccount) - } - - return nil -} - -type awsRestjson1_serializeOpListTagsForResource struct { -} - -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTagsForResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListUpdates struct { -} - -func (*awsRestjson1_serializeOpListUpdates) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListUpdates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListUpdatesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}/updates") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListUpdatesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListUpdatesInput(v *ListUpdatesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName != nil { - encoder.SetQuery("addonName").String(*v.AddonName) - } - - if v.CapabilityName != nil { - encoder.SetQuery("capabilityName").String(*v.CapabilityName) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.NodegroupName != nil { - encoder.SetQuery("nodegroupName").String(*v.NodegroupName) - } - - return nil -} - -type awsRestjson1_serializeOpRegisterCluster struct { -} - -func (*awsRestjson1_serializeOpRegisterCluster) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpRegisterCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*RegisterClusterInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/cluster-registrations") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentRegisterClusterInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsRegisterClusterInput(v *RegisterClusterInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentRegisterClusterInput(v *RegisterClusterInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.ConnectorConfig != nil { - ok := object.Key("connectorConfig") - if err := awsRestjson1_serializeDocumentConnectorConfigRequest(v.ConnectorConfig, ok); err != nil { - return err - } - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpStartInsightsRefresh struct { -} - -func (*awsRestjson1_serializeOpStartInsightsRefresh) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpStartInsightsRefresh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*StartInsightsRefreshInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/insights-refresh") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsStartInsightsRefreshInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsStartInsightsRefreshInput(v *StartInsightsRefreshInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpTagResource struct { -} - -func (*awsRestjson1_serializeOpTagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUntagResource struct { -} - -func (*awsRestjson1_serializeOpUntagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UntagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateAccessEntry struct { -} - -func (*awsRestjson1_serializeOpUpdateAccessEntry) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateAccessEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateAccessEntryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/access-entries/{principalArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateAccessEntryInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAccessEntryInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateAccessEntryInput(v *UpdateAccessEntryInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.PrincipalArn == nil || len(*v.PrincipalArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member principalArn must not be empty")} - } - if v.PrincipalArn != nil { - if err := encoder.SetURI("principalArn").String(*v.PrincipalArn); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateAccessEntryInput(v *UpdateAccessEntryInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.KubernetesGroups != nil { - ok := object.Key("kubernetesGroups") - if err := awsRestjson1_serializeDocumentStringList(v.KubernetesGroups, ok); err != nil { - return err - } - } - - if v.Username != nil { - ok := object.Key("username") - ok.String(*v.Username) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateAddon struct { -} - -func (*awsRestjson1_serializeOpUpdateAddon) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateAddon) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateAddonInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/addons/{addonName}/update") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateAddonInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateAddonInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateAddonInput(v *UpdateAddonInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AddonName == nil || len(*v.AddonName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member addonName must not be empty")} - } - if v.AddonName != nil { - if err := encoder.SetURI("addonName").String(*v.AddonName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateAddonInput(v *UpdateAddonInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AddonVersion != nil { - ok := object.Key("addonVersion") - ok.String(*v.AddonVersion) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.ConfigurationValues != nil { - ok := object.Key("configurationValues") - ok.String(*v.ConfigurationValues) - } - - if v.PodIdentityAssociations != nil { - ok := object.Key("podIdentityAssociations") - if err := awsRestjson1_serializeDocumentAddonPodIdentityAssociationsList(v.PodIdentityAssociations, ok); err != nil { - return err - } - } - - if len(v.ResolveConflicts) > 0 { - ok := object.Key("resolveConflicts") - ok.String(string(v.ResolveConflicts)) - } - - if v.ServiceAccountRoleArn != nil { - ok := object.Key("serviceAccountRoleArn") - ok.String(*v.ServiceAccountRoleArn) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateCapability struct { -} - -func (*awsRestjson1_serializeOpUpdateCapability) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateCapability) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateCapabilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/capabilities/{capabilityName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateCapabilityInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateCapabilityInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateCapabilityInput(v *UpdateCapabilityInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.CapabilityName == nil || len(*v.CapabilityName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityName must not be empty")} - } - if v.CapabilityName != nil { - if err := encoder.SetURI("capabilityName").String(*v.CapabilityName); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateCapabilityInput(v *UpdateCapabilityInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Configuration != nil { - ok := object.Key("configuration") - if err := awsRestjson1_serializeDocumentUpdateCapabilityConfiguration(v.Configuration, ok); err != nil { - return err - } - } - - if len(v.DeletePropagationPolicy) > 0 { - ok := object.Key("deletePropagationPolicy") - ok.String(string(v.DeletePropagationPolicy)) - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateClusterConfig struct { -} - -func (*awsRestjson1_serializeOpUpdateClusterConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateClusterConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateClusterConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}/update-config") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateClusterConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateClusterConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateClusterConfigInput(v *UpdateClusterConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateClusterConfigInput(v *UpdateClusterConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccessConfig != nil { - ok := object.Key("accessConfig") - if err := awsRestjson1_serializeDocumentUpdateAccessConfigRequest(v.AccessConfig, ok); err != nil { - return err - } - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.ComputeConfig != nil { - ok := object.Key("computeConfig") - if err := awsRestjson1_serializeDocumentComputeConfigRequest(v.ComputeConfig, ok); err != nil { - return err - } - } - - if v.ControlPlaneScalingConfig != nil { - ok := object.Key("controlPlaneScalingConfig") - if err := awsRestjson1_serializeDocumentControlPlaneScalingConfig(v.ControlPlaneScalingConfig, ok); err != nil { - return err - } - } - - if v.DeletionProtection != nil { - ok := object.Key("deletionProtection") - ok.Boolean(*v.DeletionProtection) - } - - if v.KubernetesNetworkConfig != nil { - ok := object.Key("kubernetesNetworkConfig") - if err := awsRestjson1_serializeDocumentKubernetesNetworkConfigRequest(v.KubernetesNetworkConfig, ok); err != nil { - return err - } - } - - if v.Logging != nil { - ok := object.Key("logging") - if err := awsRestjson1_serializeDocumentLogging(v.Logging, ok); err != nil { - return err - } - } - - if v.RemoteNetworkConfig != nil { - ok := object.Key("remoteNetworkConfig") - if err := awsRestjson1_serializeDocumentRemoteNetworkConfigRequest(v.RemoteNetworkConfig, ok); err != nil { - return err - } - } - - if v.ResourcesVpcConfig != nil { - ok := object.Key("resourcesVpcConfig") - if err := awsRestjson1_serializeDocumentVpcConfigRequest(v.ResourcesVpcConfig, ok); err != nil { - return err - } - } - - if v.StorageConfig != nil { - ok := object.Key("storageConfig") - if err := awsRestjson1_serializeDocumentStorageConfigRequest(v.StorageConfig, ok); err != nil { - return err - } - } - - if v.UpgradePolicy != nil { - ok := object.Key("upgradePolicy") - if err := awsRestjson1_serializeDocumentUpgradePolicyRequest(v.UpgradePolicy, ok); err != nil { - return err - } - } - - if v.ZonalShiftConfig != nil { - ok := object.Key("zonalShiftConfig") - if err := awsRestjson1_serializeDocumentZonalShiftConfigRequest(v.ZonalShiftConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateClusterVersion struct { -} - -func (*awsRestjson1_serializeOpUpdateClusterVersion) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateClusterVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateClusterVersionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{name}/updates") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateClusterVersionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateClusterVersionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateClusterVersionInput(v *UpdateClusterVersionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Name == nil || len(*v.Name) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} - } - if v.Name != nil { - if err := encoder.SetURI("name").String(*v.Name); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateClusterVersionInput(v *UpdateClusterVersionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Force { - ok := object.Key("force") - ok.Boolean(v.Force) - } - - if v.Version != nil { - ok := object.Key("version") - ok.String(*v.Version) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateEksAnywhereSubscription struct { -} - -func (*awsRestjson1_serializeOpUpdateEksAnywhereSubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateEksAnywhereSubscriptionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateEksAnywhereSubscriptionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id == nil || len(*v.Id) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} - } - if v.Id != nil { - if err := encoder.SetURI("id").String(*v.Id); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - { - ok := object.Key("autoRenew") - ok.Boolean(v.AutoRenew) - } - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateNodegroupConfig struct { -} - -func (*awsRestjson1_serializeOpUpdateNodegroupConfig) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateNodegroupConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateNodegroupConfigInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups/{nodegroupName}/update-config") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateNodegroupConfigInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateNodegroupConfigInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateNodegroupConfigInput(v *UpdateNodegroupConfigInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.NodegroupName == nil || len(*v.NodegroupName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member nodegroupName must not be empty")} - } - if v.NodegroupName != nil { - if err := encoder.SetURI("nodegroupName").String(*v.NodegroupName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateNodegroupConfigInput(v *UpdateNodegroupConfigInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Labels != nil { - ok := object.Key("labels") - if err := awsRestjson1_serializeDocumentUpdateLabelsPayload(v.Labels, ok); err != nil { - return err - } - } - - if v.NodeRepairConfig != nil { - ok := object.Key("nodeRepairConfig") - if err := awsRestjson1_serializeDocumentNodeRepairConfig(v.NodeRepairConfig, ok); err != nil { - return err - } - } - - if v.ScalingConfig != nil { - ok := object.Key("scalingConfig") - if err := awsRestjson1_serializeDocumentNodegroupScalingConfig(v.ScalingConfig, ok); err != nil { - return err - } - } - - if v.Taints != nil { - ok := object.Key("taints") - if err := awsRestjson1_serializeDocumentUpdateTaintsPayload(v.Taints, ok); err != nil { - return err - } - } - - if v.UpdateConfig != nil { - ok := object.Key("updateConfig") - if err := awsRestjson1_serializeDocumentNodegroupUpdateConfig(v.UpdateConfig, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateNodegroupVersion struct { -} - -func (*awsRestjson1_serializeOpUpdateNodegroupVersion) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateNodegroupVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateNodegroupVersionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/node-groups/{nodegroupName}/update-version") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateNodegroupVersionInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateNodegroupVersionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateNodegroupVersionInput(v *UpdateNodegroupVersionInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - if v.NodegroupName == nil || len(*v.NodegroupName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member nodegroupName must not be empty")} - } - if v.NodegroupName != nil { - if err := encoder.SetURI("nodegroupName").String(*v.NodegroupName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateNodegroupVersionInput(v *UpdateNodegroupVersionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.Force { - ok := object.Key("force") - ok.Boolean(v.Force) - } - - if v.LaunchTemplate != nil { - ok := object.Key("launchTemplate") - if err := awsRestjson1_serializeDocumentLaunchTemplateSpecification(v.LaunchTemplate, ok); err != nil { - return err - } - } - - if v.ReleaseVersion != nil { - ok := object.Key("releaseVersion") - ok.String(*v.ReleaseVersion) - } - - if v.Version != nil { - ok := object.Key("version") - ok.String(*v.Version) - } - - return nil -} - -type awsRestjson1_serializeOpUpdatePodIdentityAssociation struct { -} - -func (*awsRestjson1_serializeOpUpdatePodIdentityAssociation) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdatePodIdentityAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdatePodIdentityAssociationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/clusters/{clusterName}/pod-identity-associations/{associationId}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdatePodIdentityAssociationInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdatePodIdentityAssociationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.AssociationId == nil || len(*v.AssociationId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member associationId must not be empty")} - } - if v.AssociationId != nil { - if err := encoder.SetURI("associationId").String(*v.AssociationId); err != nil { - return err - } - } - - if v.ClusterName == nil || len(*v.ClusterName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member clusterName must not be empty")} - } - if v.ClusterName != nil { - if err := encoder.SetURI("clusterName").String(*v.ClusterName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientRequestToken != nil { - ok := object.Key("clientRequestToken") - ok.String(*v.ClientRequestToken) - } - - if v.DisableSessionTags != nil { - ok := object.Key("disableSessionTags") - ok.Boolean(*v.DisableSessionTags) - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - if v.TargetRoleArn != nil { - ok := object.Key("targetRoleArn") - ok.String(*v.TargetRoleArn) - } - - return nil -} - -func awsRestjson1_serializeDocumentAccessScope(v *types.AccessScope, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Namespaces != nil { - ok := object.Key("namespaces") - if err := awsRestjson1_serializeDocumentStringList(v.Namespaces, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsRestjson1_serializeDocumentAddonNamespaceConfigRequest(v *types.AddonNamespaceConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Namespace != nil { - ok := object.Key("namespace") - ok.String(*v.Namespace) - } - - return nil -} - -func awsRestjson1_serializeDocumentAddonPodIdentityAssociations(v *types.AddonPodIdentityAssociations, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - if v.ServiceAccount != nil { - ok := object.Key("serviceAccount") - ok.String(*v.ServiceAccount) - } - - return nil -} - -func awsRestjson1_serializeDocumentAddonPodIdentityAssociationsList(v []types.AddonPodIdentityAssociations, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentAddonPodIdentityAssociations(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentArgoCdAwsIdcConfigRequest(v *types.ArgoCdAwsIdcConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.IdcInstanceArn != nil { - ok := object.Key("idcInstanceArn") - ok.String(*v.IdcInstanceArn) - } - - if v.IdcRegion != nil { - ok := object.Key("idcRegion") - ok.String(*v.IdcRegion) - } - - return nil -} - -func awsRestjson1_serializeDocumentArgoCdConfigRequest(v *types.ArgoCdConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AwsIdc != nil { - ok := object.Key("awsIdc") - if err := awsRestjson1_serializeDocumentArgoCdAwsIdcConfigRequest(v.AwsIdc, ok); err != nil { - return err - } - } - - if v.Namespace != nil { - ok := object.Key("namespace") - ok.String(*v.Namespace) - } - - if v.NetworkAccess != nil { - ok := object.Key("networkAccess") - if err := awsRestjson1_serializeDocumentArgoCdNetworkAccessConfigRequest(v.NetworkAccess, ok); err != nil { - return err - } - } - - if v.RbacRoleMappings != nil { - ok := object.Key("rbacRoleMappings") - if err := awsRestjson1_serializeDocumentArgoCdRoleMappingList(v.RbacRoleMappings, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentArgoCdNetworkAccessConfigRequest(v *types.ArgoCdNetworkAccessConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.VpceIds != nil { - ok := object.Key("vpceIds") - if err := awsRestjson1_serializeDocumentStringList(v.VpceIds, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentArgoCdRoleMapping(v *types.ArgoCdRoleMapping, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Identities != nil { - ok := object.Key("identities") - if err := awsRestjson1_serializeDocumentSsoIdentityList(v.Identities, ok); err != nil { - return err - } - } - - if len(v.Role) > 0 { - ok := object.Key("role") - ok.String(string(v.Role)) - } - - return nil -} - -func awsRestjson1_serializeDocumentArgoCdRoleMappingList(v []types.ArgoCdRoleMapping, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentArgoCdRoleMapping(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentBlockStorage(v *types.BlockStorage, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - return nil -} - -func awsRestjson1_serializeDocumentCapabilityConfigurationRequest(v *types.CapabilityConfigurationRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ArgoCd != nil { - ok := object.Key("argoCd") - if err := awsRestjson1_serializeDocumentArgoCdConfigRequest(v.ArgoCd, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentCategoryList(v []types.Category, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsRestjson1_serializeDocumentComputeConfigRequest(v *types.ComputeConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - if v.NodePools != nil { - ok := object.Key("nodePools") - if err := awsRestjson1_serializeDocumentStringList(v.NodePools, ok); err != nil { - return err - } - } - - if v.NodeRoleArn != nil { - ok := object.Key("nodeRoleArn") - ok.String(*v.NodeRoleArn) - } - - return nil -} - -func awsRestjson1_serializeDocumentConnectorConfigRequest(v *types.ConnectorConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Provider) > 0 { - ok := object.Key("provider") - ok.String(string(v.Provider)) - } - - if v.RoleArn != nil { - ok := object.Key("roleArn") - ok.String(*v.RoleArn) - } - - return nil -} - -func awsRestjson1_serializeDocumentControlPlanePlacementRequest(v *types.ControlPlanePlacementRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.GroupName != nil { - ok := object.Key("groupName") - ok.String(*v.GroupName) - } - - return nil -} - -func awsRestjson1_serializeDocumentControlPlaneScalingConfig(v *types.ControlPlaneScalingConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Tier) > 0 { - ok := object.Key("tier") - ok.String(string(v.Tier)) - } - - return nil -} - -func awsRestjson1_serializeDocumentCreateAccessConfigRequest(v *types.CreateAccessConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.AuthenticationMode) > 0 { - ok := object.Key("authenticationMode") - ok.String(string(v.AuthenticationMode)) - } - - if v.BootstrapClusterCreatorAdminPermissions != nil { - ok := object.Key("bootstrapClusterCreatorAdminPermissions") - ok.Boolean(*v.BootstrapClusterCreatorAdminPermissions) - } - - return nil -} - -func awsRestjson1_serializeDocumentEksAnywhereSubscriptionTerm(v *types.EksAnywhereSubscriptionTerm, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Duration != 0 { - ok := object.Key("duration") - ok.Integer(v.Duration) - } - - if len(v.Unit) > 0 { - ok := object.Key("unit") - ok.String(string(v.Unit)) - } - - return nil -} - -func awsRestjson1_serializeDocumentElasticLoadBalancing(v *types.ElasticLoadBalancing, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - return nil -} - -func awsRestjson1_serializeDocumentEncryptionConfig(v *types.EncryptionConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Provider != nil { - ok := object.Key("provider") - if err := awsRestjson1_serializeDocumentProvider(v.Provider, ok); err != nil { - return err - } - } - - if v.Resources != nil { - ok := object.Key("resources") - if err := awsRestjson1_serializeDocumentStringList(v.Resources, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentEncryptionConfigList(v []types.EncryptionConfig, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentEncryptionConfig(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentFargateProfileLabel(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentFargateProfileSelector(v *types.FargateProfileSelector, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Labels != nil { - ok := object.Key("labels") - if err := awsRestjson1_serializeDocumentFargateProfileLabel(v.Labels, ok); err != nil { - return err - } - } - - if v.Namespace != nil { - ok := object.Key("namespace") - ok.String(*v.Namespace) - } - - return nil -} - -func awsRestjson1_serializeDocumentFargateProfileSelectors(v []types.FargateProfileSelector, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentFargateProfileSelector(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentIdentityProviderConfig(v *types.IdentityProviderConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Type != nil { - ok := object.Key("type") - ok.String(*v.Type) - } - - return nil -} - -func awsRestjson1_serializeDocumentInsightsFilter(v *types.InsightsFilter, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Categories != nil { - ok := object.Key("categories") - if err := awsRestjson1_serializeDocumentCategoryList(v.Categories, ok); err != nil { - return err - } - } - - if v.KubernetesVersions != nil { - ok := object.Key("kubernetesVersions") - if err := awsRestjson1_serializeDocumentStringList(v.KubernetesVersions, ok); err != nil { - return err - } - } - - if v.Statuses != nil { - ok := object.Key("statuses") - if err := awsRestjson1_serializeDocumentInsightStatusValueList(v.Statuses, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentInsightStatusValueList(v []types.InsightStatusValue, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsRestjson1_serializeDocumentKubernetesNetworkConfigRequest(v *types.KubernetesNetworkConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ElasticLoadBalancing != nil { - ok := object.Key("elasticLoadBalancing") - if err := awsRestjson1_serializeDocumentElasticLoadBalancing(v.ElasticLoadBalancing, ok); err != nil { - return err - } - } - - if len(v.IpFamily) > 0 { - ok := object.Key("ipFamily") - ok.String(string(v.IpFamily)) - } - - if v.ServiceIpv4Cidr != nil { - ok := object.Key("serviceIpv4Cidr") - ok.String(*v.ServiceIpv4Cidr) - } - - return nil -} - -func awsRestjson1_serializeDocumentLabelsKeyList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsRestjson1_serializeDocumentLabelsMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentLaunchTemplateSpecification(v *types.LaunchTemplateSpecification, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Version != nil { - ok := object.Key("version") - ok.String(*v.Version) - } - - return nil -} - -func awsRestjson1_serializeDocumentLogging(v *types.Logging, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClusterLogging != nil { - ok := object.Key("clusterLogging") - if err := awsRestjson1_serializeDocumentLogSetups(v.ClusterLogging, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentLogSetup(v *types.LogSetup, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - if v.Types != nil { - ok := object.Key("types") - if err := awsRestjson1_serializeDocumentLogTypes(v.Types, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentLogSetups(v []types.LogSetup, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentLogSetup(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentLogTypes(v []types.LogType, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsRestjson1_serializeDocumentNodegroupScalingConfig(v *types.NodegroupScalingConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DesiredSize != nil { - ok := object.Key("desiredSize") - ok.Integer(*v.DesiredSize) - } - - if v.MaxSize != nil { - ok := object.Key("maxSize") - ok.Integer(*v.MaxSize) - } - - if v.MinSize != nil { - ok := object.Key("minSize") - ok.Integer(*v.MinSize) - } - - return nil -} - -func awsRestjson1_serializeDocumentNodegroupUpdateConfig(v *types.NodegroupUpdateConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxUnavailable != nil { - ok := object.Key("maxUnavailable") - ok.Integer(*v.MaxUnavailable) - } - - if v.MaxUnavailablePercentage != nil { - ok := object.Key("maxUnavailablePercentage") - ok.Integer(*v.MaxUnavailablePercentage) - } - - if len(v.UpdateStrategy) > 0 { - ok := object.Key("updateStrategy") - ok.String(string(v.UpdateStrategy)) - } - - return nil -} - -func awsRestjson1_serializeDocumentNodeRepairConfig(v *types.NodeRepairConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - if v.MaxParallelNodesRepairedCount != nil { - ok := object.Key("maxParallelNodesRepairedCount") - ok.Integer(*v.MaxParallelNodesRepairedCount) - } - - if v.MaxParallelNodesRepairedPercentage != nil { - ok := object.Key("maxParallelNodesRepairedPercentage") - ok.Integer(*v.MaxParallelNodesRepairedPercentage) - } - - if v.MaxUnhealthyNodeThresholdCount != nil { - ok := object.Key("maxUnhealthyNodeThresholdCount") - ok.Integer(*v.MaxUnhealthyNodeThresholdCount) - } - - if v.MaxUnhealthyNodeThresholdPercentage != nil { - ok := object.Key("maxUnhealthyNodeThresholdPercentage") - ok.Integer(*v.MaxUnhealthyNodeThresholdPercentage) - } - - if v.NodeRepairConfigOverrides != nil { - ok := object.Key("nodeRepairConfigOverrides") - if err := awsRestjson1_serializeDocumentNodeRepairConfigOverridesList(v.NodeRepairConfigOverrides, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentNodeRepairConfigOverrides(v *types.NodeRepairConfigOverrides, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MinRepairWaitTimeMins != nil { - ok := object.Key("minRepairWaitTimeMins") - ok.Integer(*v.MinRepairWaitTimeMins) - } - - if v.NodeMonitoringCondition != nil { - ok := object.Key("nodeMonitoringCondition") - ok.String(*v.NodeMonitoringCondition) - } - - if v.NodeUnhealthyReason != nil { - ok := object.Key("nodeUnhealthyReason") - ok.String(*v.NodeUnhealthyReason) - } - - if len(v.RepairAction) > 0 { - ok := object.Key("repairAction") - ok.String(string(v.RepairAction)) - } - - return nil -} - -func awsRestjson1_serializeDocumentNodeRepairConfigOverridesList(v []types.NodeRepairConfigOverrides, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentNodeRepairConfigOverrides(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentOidcIdentityProviderConfigRequest(v *types.OidcIdentityProviderConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientId != nil { - ok := object.Key("clientId") - ok.String(*v.ClientId) - } - - if v.GroupsClaim != nil { - ok := object.Key("groupsClaim") - ok.String(*v.GroupsClaim) - } - - if v.GroupsPrefix != nil { - ok := object.Key("groupsPrefix") - ok.String(*v.GroupsPrefix) - } - - if v.IdentityProviderConfigName != nil { - ok := object.Key("identityProviderConfigName") - ok.String(*v.IdentityProviderConfigName) - } - - if v.IssuerUrl != nil { - ok := object.Key("issuerUrl") - ok.String(*v.IssuerUrl) - } - - if v.RequiredClaims != nil { - ok := object.Key("requiredClaims") - if err := awsRestjson1_serializeDocumentRequiredClaimsMap(v.RequiredClaims, ok); err != nil { - return err - } - } - - if v.UsernameClaim != nil { - ok := object.Key("usernameClaim") - ok.String(*v.UsernameClaim) - } - - if v.UsernamePrefix != nil { - ok := object.Key("usernamePrefix") - ok.String(*v.UsernamePrefix) - } - - return nil -} - -func awsRestjson1_serializeDocumentOutpostConfigRequest(v *types.OutpostConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ControlPlaneInstanceType != nil { - ok := object.Key("controlPlaneInstanceType") - ok.String(*v.ControlPlaneInstanceType) - } - - if v.ControlPlanePlacement != nil { - ok := object.Key("controlPlanePlacement") - if err := awsRestjson1_serializeDocumentControlPlanePlacementRequest(v.ControlPlanePlacement, ok); err != nil { - return err - } - } - - if v.OutpostArns != nil { - ok := object.Key("outpostArns") - if err := awsRestjson1_serializeDocumentStringList(v.OutpostArns, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentProvider(v *types.Provider, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.KeyArn != nil { - ok := object.Key("keyArn") - ok.String(*v.KeyArn) - } - - return nil -} - -func awsRestjson1_serializeDocumentRemoteAccessConfig(v *types.RemoteAccessConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Ec2SshKey != nil { - ok := object.Key("ec2SshKey") - ok.String(*v.Ec2SshKey) - } - - if v.SourceSecurityGroups != nil { - ok := object.Key("sourceSecurityGroups") - if err := awsRestjson1_serializeDocumentStringList(v.SourceSecurityGroups, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentRemoteNetworkConfigRequest(v *types.RemoteNetworkConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.RemoteNodeNetworks != nil { - ok := object.Key("remoteNodeNetworks") - if err := awsRestjson1_serializeDocumentRemoteNodeNetworkList(v.RemoteNodeNetworks, ok); err != nil { - return err - } - } - - if v.RemotePodNetworks != nil { - ok := object.Key("remotePodNetworks") - if err := awsRestjson1_serializeDocumentRemotePodNetworkList(v.RemotePodNetworks, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentRemoteNodeNetwork(v *types.RemoteNodeNetwork, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Cidrs != nil { - ok := object.Key("cidrs") - if err := awsRestjson1_serializeDocumentStringList(v.Cidrs, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentRemoteNodeNetworkList(v []types.RemoteNodeNetwork, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentRemoteNodeNetwork(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentRemotePodNetwork(v *types.RemotePodNetwork, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Cidrs != nil { - ok := object.Key("cidrs") - if err := awsRestjson1_serializeDocumentStringList(v.Cidrs, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentRemotePodNetworkList(v []types.RemotePodNetwork, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentRemotePodNetwork(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentRequiredClaimsMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentSsoIdentity(v *types.SsoIdentity, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsRestjson1_serializeDocumentSsoIdentityList(v []types.SsoIdentity, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentSsoIdentity(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentStorageConfigRequest(v *types.StorageConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BlockStorage != nil { - ok := object.Key("blockStorage") - if err := awsRestjson1_serializeDocumentBlockStorage(v.BlockStorage, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentStringList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentTaint(v *types.Taint, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Effect) > 0 { - ok := object.Key("effect") - ok.String(string(v.Effect)) - } - - if v.Key != nil { - ok := object.Key("key") - ok.String(*v.Key) - } - - if v.Value != nil { - ok := object.Key("value") - ok.String(*v.Value) - } - - return nil -} - -func awsRestjson1_serializeDocumentTaintsList(v []types.Taint, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentTaint(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentUpdateAccessConfigRequest(v *types.UpdateAccessConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.AuthenticationMode) > 0 { - ok := object.Key("authenticationMode") - ok.String(string(v.AuthenticationMode)) - } - - return nil -} - -func awsRestjson1_serializeDocumentUpdateArgoCdConfig(v *types.UpdateArgoCdConfig, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.NetworkAccess != nil { - ok := object.Key("networkAccess") - if err := awsRestjson1_serializeDocumentArgoCdNetworkAccessConfigRequest(v.NetworkAccess, ok); err != nil { - return err - } - } - - if v.RbacRoleMappings != nil { - ok := object.Key("rbacRoleMappings") - if err := awsRestjson1_serializeDocumentUpdateRoleMappings(v.RbacRoleMappings, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentUpdateCapabilityConfiguration(v *types.UpdateCapabilityConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ArgoCd != nil { - ok := object.Key("argoCd") - if err := awsRestjson1_serializeDocumentUpdateArgoCdConfig(v.ArgoCd, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentUpdateLabelsPayload(v *types.UpdateLabelsPayload, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AddOrUpdateLabels != nil { - ok := object.Key("addOrUpdateLabels") - if err := awsRestjson1_serializeDocumentLabelsMap(v.AddOrUpdateLabels, ok); err != nil { - return err - } - } - - if v.RemoveLabels != nil { - ok := object.Key("removeLabels") - if err := awsRestjson1_serializeDocumentLabelsKeyList(v.RemoveLabels, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentUpdateRoleMappings(v *types.UpdateRoleMappings, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AddOrUpdateRoleMappings != nil { - ok := object.Key("addOrUpdateRoleMappings") - if err := awsRestjson1_serializeDocumentArgoCdRoleMappingList(v.AddOrUpdateRoleMappings, ok); err != nil { - return err - } - } - - if v.RemoveRoleMappings != nil { - ok := object.Key("removeRoleMappings") - if err := awsRestjson1_serializeDocumentArgoCdRoleMappingList(v.RemoveRoleMappings, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentUpdateTaintsPayload(v *types.UpdateTaintsPayload, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AddOrUpdateTaints != nil { - ok := object.Key("addOrUpdateTaints") - if err := awsRestjson1_serializeDocumentTaintsList(v.AddOrUpdateTaints, ok); err != nil { - return err - } - } - - if v.RemoveTaints != nil { - ok := object.Key("removeTaints") - if err := awsRestjson1_serializeDocumentTaintsList(v.RemoveTaints, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentUpgradePolicyRequest(v *types.UpgradePolicyRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.SupportType) > 0 { - ok := object.Key("supportType") - ok.String(string(v.SupportType)) - } - - return nil -} - -func awsRestjson1_serializeDocumentVpcConfigRequest(v *types.VpcConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EndpointPrivateAccess != nil { - ok := object.Key("endpointPrivateAccess") - ok.Boolean(*v.EndpointPrivateAccess) - } - - if v.EndpointPublicAccess != nil { - ok := object.Key("endpointPublicAccess") - ok.Boolean(*v.EndpointPublicAccess) - } - - if v.PublicAccessCidrs != nil { - ok := object.Key("publicAccessCidrs") - if err := awsRestjson1_serializeDocumentStringList(v.PublicAccessCidrs, ok); err != nil { - return err - } - } - - if v.SecurityGroupIds != nil { - ok := object.Key("securityGroupIds") - if err := awsRestjson1_serializeDocumentStringList(v.SecurityGroupIds, ok); err != nil { - return err - } - } - - if v.SubnetIds != nil { - ok := object.Key("subnetIds") - if err := awsRestjson1_serializeDocumentStringList(v.SubnetIds, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentZonalShiftConfigRequest(v *types.ZonalShiftConfigRequest, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/enums.go deleted file mode 100644 index ad0b1fe4893c..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/enums.go +++ /dev/null @@ -1,1163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type AccessScopeType string - -// Enum values for AccessScopeType -const ( - AccessScopeTypeCluster AccessScopeType = "cluster" - AccessScopeTypeNamespace AccessScopeType = "namespace" -) - -// Values returns all known values for AccessScopeType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccessScopeType) Values() []AccessScopeType { - return []AccessScopeType{ - "cluster", - "namespace", - } -} - -type AddonIssueCode string - -// Enum values for AddonIssueCode -const ( - AddonIssueCodeAccessDenied AddonIssueCode = "AccessDenied" - AddonIssueCodeInternalFailure AddonIssueCode = "InternalFailure" - AddonIssueCodeClusterUnreachable AddonIssueCode = "ClusterUnreachable" - AddonIssueCodeInsufficientNumberOfReplicas AddonIssueCode = "InsufficientNumberOfReplicas" - AddonIssueCodeConfigurationConflict AddonIssueCode = "ConfigurationConflict" - AddonIssueCodeAdmissionRequestDenied AddonIssueCode = "AdmissionRequestDenied" - AddonIssueCodeUnsupportedAddonModification AddonIssueCode = "UnsupportedAddonModification" - AddonIssueCodeK8sResourceNotFound AddonIssueCode = "K8sResourceNotFound" - AddonIssueCodeAddonSubscriptionNeeded AddonIssueCode = "AddonSubscriptionNeeded" - AddonIssueCodeAddonPermissionFailure AddonIssueCode = "AddonPermissionFailure" -) - -// Values returns all known values for AddonIssueCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AddonIssueCode) Values() []AddonIssueCode { - return []AddonIssueCode{ - "AccessDenied", - "InternalFailure", - "ClusterUnreachable", - "InsufficientNumberOfReplicas", - "ConfigurationConflict", - "AdmissionRequestDenied", - "UnsupportedAddonModification", - "K8sResourceNotFound", - "AddonSubscriptionNeeded", - "AddonPermissionFailure", - } -} - -type AddonStatus string - -// Enum values for AddonStatus -const ( - AddonStatusCreating AddonStatus = "CREATING" - AddonStatusActive AddonStatus = "ACTIVE" - AddonStatusCreateFailed AddonStatus = "CREATE_FAILED" - AddonStatusUpdating AddonStatus = "UPDATING" - AddonStatusDeleting AddonStatus = "DELETING" - AddonStatusDeleteFailed AddonStatus = "DELETE_FAILED" - AddonStatusDegraded AddonStatus = "DEGRADED" - AddonStatusUpdateFailed AddonStatus = "UPDATE_FAILED" -) - -// Values returns all known values for AddonStatus. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AddonStatus) Values() []AddonStatus { - return []AddonStatus{ - "CREATING", - "ACTIVE", - "CREATE_FAILED", - "UPDATING", - "DELETING", - "DELETE_FAILED", - "DEGRADED", - "UPDATE_FAILED", - } -} - -type AMITypes string - -// Enum values for AMITypes -const ( - AMITypesAl2X8664 AMITypes = "AL2_x86_64" - AMITypesAl2X8664Gpu AMITypes = "AL2_x86_64_GPU" - AMITypesAl2Arm64 AMITypes = "AL2_ARM_64" - AMITypesCustom AMITypes = "CUSTOM" - AMITypesBottlerocketArm64 AMITypes = "BOTTLEROCKET_ARM_64" - AMITypesBottlerocketX8664 AMITypes = "BOTTLEROCKET_x86_64" - AMITypesBottlerocketArm64Fips AMITypes = "BOTTLEROCKET_ARM_64_FIPS" - AMITypesBottlerocketX8664Fips AMITypes = "BOTTLEROCKET_x86_64_FIPS" - AMITypesBottlerocketArm64Nvidia AMITypes = "BOTTLEROCKET_ARM_64_NVIDIA" - AMITypesBottlerocketX8664Nvidia AMITypes = "BOTTLEROCKET_x86_64_NVIDIA" - AMITypesBottlerocketArm64NvidiaFips AMITypes = "BOTTLEROCKET_ARM_64_NVIDIA_FIPS" - AMITypesBottlerocketX8664NvidiaFips AMITypes = "BOTTLEROCKET_x86_64_NVIDIA_FIPS" - AMITypesWindowsCore2019X8664 AMITypes = "WINDOWS_CORE_2019_x86_64" - AMITypesWindowsFull2019X8664 AMITypes = "WINDOWS_FULL_2019_x86_64" - AMITypesWindowsCore2022X8664 AMITypes = "WINDOWS_CORE_2022_x86_64" - AMITypesWindowsFull2022X8664 AMITypes = "WINDOWS_FULL_2022_x86_64" - AMITypesAl2023X8664Standard AMITypes = "AL2023_x86_64_STANDARD" - AMITypesAl2023Arm64Standard AMITypes = "AL2023_ARM_64_STANDARD" - AMITypesAl2023X8664Neuron AMITypes = "AL2023_x86_64_NEURON" - AMITypesAl2023X8664Nvidia AMITypes = "AL2023_x86_64_NVIDIA" - AMITypesAl2023Arm64Nvidia AMITypes = "AL2023_ARM_64_NVIDIA" -) - -// Values returns all known values for AMITypes. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AMITypes) Values() []AMITypes { - return []AMITypes{ - "AL2_x86_64", - "AL2_x86_64_GPU", - "AL2_ARM_64", - "CUSTOM", - "BOTTLEROCKET_ARM_64", - "BOTTLEROCKET_x86_64", - "BOTTLEROCKET_ARM_64_FIPS", - "BOTTLEROCKET_x86_64_FIPS", - "BOTTLEROCKET_ARM_64_NVIDIA", - "BOTTLEROCKET_x86_64_NVIDIA", - "BOTTLEROCKET_ARM_64_NVIDIA_FIPS", - "BOTTLEROCKET_x86_64_NVIDIA_FIPS", - "WINDOWS_CORE_2019_x86_64", - "WINDOWS_FULL_2019_x86_64", - "WINDOWS_CORE_2022_x86_64", - "WINDOWS_FULL_2022_x86_64", - "AL2023_x86_64_STANDARD", - "AL2023_ARM_64_STANDARD", - "AL2023_x86_64_NEURON", - "AL2023_x86_64_NVIDIA", - "AL2023_ARM_64_NVIDIA", - } -} - -type ArgoCdRole string - -// Enum values for ArgoCdRole -const ( - ArgoCdRoleAdmin ArgoCdRole = "ADMIN" - ArgoCdRoleEditor ArgoCdRole = "EDITOR" - ArgoCdRoleViewer ArgoCdRole = "VIEWER" -) - -// Values returns all known values for ArgoCdRole. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ArgoCdRole) Values() []ArgoCdRole { - return []ArgoCdRole{ - "ADMIN", - "EDITOR", - "VIEWER", - } -} - -type AuthenticationMode string - -// Enum values for AuthenticationMode -const ( - AuthenticationModeApi AuthenticationMode = "API" - AuthenticationModeApiAndConfigMap AuthenticationMode = "API_AND_CONFIG_MAP" - AuthenticationModeConfigMap AuthenticationMode = "CONFIG_MAP" -) - -// Values returns all known values for AuthenticationMode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AuthenticationMode) Values() []AuthenticationMode { - return []AuthenticationMode{ - "API", - "API_AND_CONFIG_MAP", - "CONFIG_MAP", - } -} - -type CapabilityDeletePropagationPolicy string - -// Enum values for CapabilityDeletePropagationPolicy -const ( - CapabilityDeletePropagationPolicyRetain CapabilityDeletePropagationPolicy = "RETAIN" -) - -// Values returns all known values for CapabilityDeletePropagationPolicy. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapabilityDeletePropagationPolicy) Values() []CapabilityDeletePropagationPolicy { - return []CapabilityDeletePropagationPolicy{ - "RETAIN", - } -} - -type CapabilityIssueCode string - -// Enum values for CapabilityIssueCode -const ( - CapabilityIssueCodeAccessDenied CapabilityIssueCode = "AccessDenied" - CapabilityIssueCodeClusterUnreachable CapabilityIssueCode = "ClusterUnreachable" -) - -// Values returns all known values for CapabilityIssueCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapabilityIssueCode) Values() []CapabilityIssueCode { - return []CapabilityIssueCode{ - "AccessDenied", - "ClusterUnreachable", - } -} - -type CapabilityStatus string - -// Enum values for CapabilityStatus -const ( - CapabilityStatusCreating CapabilityStatus = "CREATING" - CapabilityStatusCreateFailed CapabilityStatus = "CREATE_FAILED" - CapabilityStatusUpdating CapabilityStatus = "UPDATING" - CapabilityStatusDeleting CapabilityStatus = "DELETING" - CapabilityStatusDeleteFailed CapabilityStatus = "DELETE_FAILED" - CapabilityStatusActive CapabilityStatus = "ACTIVE" - CapabilityStatusDegraded CapabilityStatus = "DEGRADED" -) - -// Values returns all known values for CapabilityStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapabilityStatus) Values() []CapabilityStatus { - return []CapabilityStatus{ - "CREATING", - "CREATE_FAILED", - "UPDATING", - "DELETING", - "DELETE_FAILED", - "ACTIVE", - "DEGRADED", - } -} - -type CapabilityType string - -// Enum values for CapabilityType -const ( - CapabilityTypeAck CapabilityType = "ACK" - CapabilityTypeKro CapabilityType = "KRO" - CapabilityTypeArgocd CapabilityType = "ARGOCD" -) - -// Values returns all known values for CapabilityType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapabilityType) Values() []CapabilityType { - return []CapabilityType{ - "ACK", - "KRO", - "ARGOCD", - } -} - -type CapacityTypes string - -// Enum values for CapacityTypes -const ( - CapacityTypesOnDemand CapacityTypes = "ON_DEMAND" - CapacityTypesSpot CapacityTypes = "SPOT" - CapacityTypesCapacityBlock CapacityTypes = "CAPACITY_BLOCK" -) - -// Values returns all known values for CapacityTypes. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CapacityTypes) Values() []CapacityTypes { - return []CapacityTypes{ - "ON_DEMAND", - "SPOT", - "CAPACITY_BLOCK", - } -} - -type Category string - -// Enum values for Category -const ( - CategoryUpgradeReadiness Category = "UPGRADE_READINESS" - CategoryMisconfiguration Category = "MISCONFIGURATION" -) - -// Values returns all known values for Category. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Category) Values() []Category { - return []Category{ - "UPGRADE_READINESS", - "MISCONFIGURATION", - } -} - -type ClusterIssueCode string - -// Enum values for ClusterIssueCode -const ( - ClusterIssueCodeAccessDenied ClusterIssueCode = "AccessDenied" - ClusterIssueCodeClusterUnreachable ClusterIssueCode = "ClusterUnreachable" - ClusterIssueCodeConfigurationConflict ClusterIssueCode = "ConfigurationConflict" - ClusterIssueCodeInternalFailure ClusterIssueCode = "InternalFailure" - ClusterIssueCodeResourceLimitExceeded ClusterIssueCode = "ResourceLimitExceeded" - ClusterIssueCodeResourceNotFound ClusterIssueCode = "ResourceNotFound" - ClusterIssueCodeIamRoleNotFound ClusterIssueCode = "IamRoleNotFound" - ClusterIssueCodeVpcNotFound ClusterIssueCode = "VpcNotFound" - ClusterIssueCodeInsufficientFreeAddresses ClusterIssueCode = "InsufficientFreeAddresses" - ClusterIssueCodeEc2ServiceNotSubscribed ClusterIssueCode = "Ec2ServiceNotSubscribed" - ClusterIssueCodeEc2SubnetNotFound ClusterIssueCode = "Ec2SubnetNotFound" - ClusterIssueCodeEc2SecurityGroupNotFound ClusterIssueCode = "Ec2SecurityGroupNotFound" - ClusterIssueCodeKmsGrantRevoked ClusterIssueCode = "KmsGrantRevoked" - ClusterIssueCodeKmsKeyNotFound ClusterIssueCode = "KmsKeyNotFound" - ClusterIssueCodeKmsKeyMarkedForDeletion ClusterIssueCode = "KmsKeyMarkedForDeletion" - ClusterIssueCodeKmsKeyDisabled ClusterIssueCode = "KmsKeyDisabled" - ClusterIssueCodeStsRegionalEndpointDisabled ClusterIssueCode = "StsRegionalEndpointDisabled" - ClusterIssueCodeUnsupportedVersion ClusterIssueCode = "UnsupportedVersion" - ClusterIssueCodeOther ClusterIssueCode = "Other" -) - -// Values returns all known values for ClusterIssueCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClusterIssueCode) Values() []ClusterIssueCode { - return []ClusterIssueCode{ - "AccessDenied", - "ClusterUnreachable", - "ConfigurationConflict", - "InternalFailure", - "ResourceLimitExceeded", - "ResourceNotFound", - "IamRoleNotFound", - "VpcNotFound", - "InsufficientFreeAddresses", - "Ec2ServiceNotSubscribed", - "Ec2SubnetNotFound", - "Ec2SecurityGroupNotFound", - "KmsGrantRevoked", - "KmsKeyNotFound", - "KmsKeyMarkedForDeletion", - "KmsKeyDisabled", - "StsRegionalEndpointDisabled", - "UnsupportedVersion", - "Other", - } -} - -type ClusterStatus string - -// Enum values for ClusterStatus -const ( - ClusterStatusCreating ClusterStatus = "CREATING" - ClusterStatusActive ClusterStatus = "ACTIVE" - ClusterStatusDeleting ClusterStatus = "DELETING" - ClusterStatusFailed ClusterStatus = "FAILED" - ClusterStatusUpdating ClusterStatus = "UPDATING" - ClusterStatusPending ClusterStatus = "PENDING" -) - -// Values returns all known values for ClusterStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClusterStatus) Values() []ClusterStatus { - return []ClusterStatus{ - "CREATING", - "ACTIVE", - "DELETING", - "FAILED", - "UPDATING", - "PENDING", - } -} - -type ClusterVersionStatus string - -// Enum values for ClusterVersionStatus -const ( - ClusterVersionStatusUnsupported ClusterVersionStatus = "unsupported" - ClusterVersionStatusStandardSupport ClusterVersionStatus = "standard-support" - ClusterVersionStatusExtendedSupport ClusterVersionStatus = "extended-support" -) - -// Values returns all known values for ClusterVersionStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ClusterVersionStatus) Values() []ClusterVersionStatus { - return []ClusterVersionStatus{ - "unsupported", - "standard-support", - "extended-support", - } -} - -type ConfigStatus string - -// Enum values for ConfigStatus -const ( - ConfigStatusCreating ConfigStatus = "CREATING" - ConfigStatusDeleting ConfigStatus = "DELETING" - ConfigStatusActive ConfigStatus = "ACTIVE" -) - -// Values returns all known values for ConfigStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConfigStatus) Values() []ConfigStatus { - return []ConfigStatus{ - "CREATING", - "DELETING", - "ACTIVE", - } -} - -type ConnectorConfigProvider string - -// Enum values for ConnectorConfigProvider -const ( - ConnectorConfigProviderEksAnywhere ConnectorConfigProvider = "EKS_ANYWHERE" - ConnectorConfigProviderAnthos ConnectorConfigProvider = "ANTHOS" - ConnectorConfigProviderGke ConnectorConfigProvider = "GKE" - ConnectorConfigProviderAks ConnectorConfigProvider = "AKS" - ConnectorConfigProviderOpenshift ConnectorConfigProvider = "OPENSHIFT" - ConnectorConfigProviderTanzu ConnectorConfigProvider = "TANZU" - ConnectorConfigProviderRancher ConnectorConfigProvider = "RANCHER" - ConnectorConfigProviderEc2 ConnectorConfigProvider = "EC2" - ConnectorConfigProviderOther ConnectorConfigProvider = "OTHER" -) - -// Values returns all known values for ConnectorConfigProvider. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConnectorConfigProvider) Values() []ConnectorConfigProvider { - return []ConnectorConfigProvider{ - "EKS_ANYWHERE", - "ANTHOS", - "GKE", - "AKS", - "OPENSHIFT", - "TANZU", - "RANCHER", - "EC2", - "OTHER", - } -} - -type EksAnywhereSubscriptionLicenseType string - -// Enum values for EksAnywhereSubscriptionLicenseType -const ( - EksAnywhereSubscriptionLicenseTypeCluster EksAnywhereSubscriptionLicenseType = "Cluster" -) - -// Values returns all known values for EksAnywhereSubscriptionLicenseType. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EksAnywhereSubscriptionLicenseType) Values() []EksAnywhereSubscriptionLicenseType { - return []EksAnywhereSubscriptionLicenseType{ - "Cluster", - } -} - -type EksAnywhereSubscriptionStatus string - -// Enum values for EksAnywhereSubscriptionStatus -const ( - EksAnywhereSubscriptionStatusCreating EksAnywhereSubscriptionStatus = "CREATING" - EksAnywhereSubscriptionStatusActive EksAnywhereSubscriptionStatus = "ACTIVE" - EksAnywhereSubscriptionStatusUpdating EksAnywhereSubscriptionStatus = "UPDATING" - EksAnywhereSubscriptionStatusExpiring EksAnywhereSubscriptionStatus = "EXPIRING" - EksAnywhereSubscriptionStatusExpired EksAnywhereSubscriptionStatus = "EXPIRED" - EksAnywhereSubscriptionStatusDeleting EksAnywhereSubscriptionStatus = "DELETING" -) - -// Values returns all known values for EksAnywhereSubscriptionStatus. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EksAnywhereSubscriptionStatus) Values() []EksAnywhereSubscriptionStatus { - return []EksAnywhereSubscriptionStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "EXPIRING", - "EXPIRED", - "DELETING", - } -} - -type EksAnywhereSubscriptionTermUnit string - -// Enum values for EksAnywhereSubscriptionTermUnit -const ( - EksAnywhereSubscriptionTermUnitMonths EksAnywhereSubscriptionTermUnit = "MONTHS" -) - -// Values returns all known values for EksAnywhereSubscriptionTermUnit. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EksAnywhereSubscriptionTermUnit) Values() []EksAnywhereSubscriptionTermUnit { - return []EksAnywhereSubscriptionTermUnit{ - "MONTHS", - } -} - -type ErrorCode string - -// Enum values for ErrorCode -const ( - ErrorCodeSubnetNotFound ErrorCode = "SubnetNotFound" - ErrorCodeSecurityGroupNotFound ErrorCode = "SecurityGroupNotFound" - ErrorCodeEniLimitReached ErrorCode = "EniLimitReached" - ErrorCodeIpNotAvailable ErrorCode = "IpNotAvailable" - ErrorCodeAccessDenied ErrorCode = "AccessDenied" - ErrorCodeOperationNotPermitted ErrorCode = "OperationNotPermitted" - ErrorCodeVpcIdNotFound ErrorCode = "VpcIdNotFound" - ErrorCodeUnknown ErrorCode = "Unknown" - ErrorCodeNodeCreationFailure ErrorCode = "NodeCreationFailure" - ErrorCodePodEvictionFailure ErrorCode = "PodEvictionFailure" - ErrorCodeInsufficientFreeAddresses ErrorCode = "InsufficientFreeAddresses" - ErrorCodeClusterUnreachable ErrorCode = "ClusterUnreachable" - ErrorCodeInsufficientNumberOfReplicas ErrorCode = "InsufficientNumberOfReplicas" - ErrorCodeConfigurationConflict ErrorCode = "ConfigurationConflict" - ErrorCodeAdmissionRequestDenied ErrorCode = "AdmissionRequestDenied" - ErrorCodeUnsupportedAddonModification ErrorCode = "UnsupportedAddonModification" - ErrorCodeK8sResourceNotFound ErrorCode = "K8sResourceNotFound" -) - -// Values returns all known values for ErrorCode. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ErrorCode) Values() []ErrorCode { - return []ErrorCode{ - "SubnetNotFound", - "SecurityGroupNotFound", - "EniLimitReached", - "IpNotAvailable", - "AccessDenied", - "OperationNotPermitted", - "VpcIdNotFound", - "Unknown", - "NodeCreationFailure", - "PodEvictionFailure", - "InsufficientFreeAddresses", - "ClusterUnreachable", - "InsufficientNumberOfReplicas", - "ConfigurationConflict", - "AdmissionRequestDenied", - "UnsupportedAddonModification", - "K8sResourceNotFound", - } -} - -type FargateProfileIssueCode string - -// Enum values for FargateProfileIssueCode -const ( - FargateProfileIssueCodePodExecutionRoleAlreadyInUse FargateProfileIssueCode = "PodExecutionRoleAlreadyInUse" - FargateProfileIssueCodeAccessDenied FargateProfileIssueCode = "AccessDenied" - FargateProfileIssueCodeClusterUnreachable FargateProfileIssueCode = "ClusterUnreachable" - FargateProfileIssueCodeInternalFailure FargateProfileIssueCode = "InternalFailure" -) - -// Values returns all known values for FargateProfileIssueCode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FargateProfileIssueCode) Values() []FargateProfileIssueCode { - return []FargateProfileIssueCode{ - "PodExecutionRoleAlreadyInUse", - "AccessDenied", - "ClusterUnreachable", - "InternalFailure", - } -} - -type FargateProfileStatus string - -// Enum values for FargateProfileStatus -const ( - FargateProfileStatusCreating FargateProfileStatus = "CREATING" - FargateProfileStatusActive FargateProfileStatus = "ACTIVE" - FargateProfileStatusDeleting FargateProfileStatus = "DELETING" - FargateProfileStatusCreateFailed FargateProfileStatus = "CREATE_FAILED" - FargateProfileStatusDeleteFailed FargateProfileStatus = "DELETE_FAILED" -) - -// Values returns all known values for FargateProfileStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FargateProfileStatus) Values() []FargateProfileStatus { - return []FargateProfileStatus{ - "CREATING", - "ACTIVE", - "DELETING", - "CREATE_FAILED", - "DELETE_FAILED", - } -} - -type InsightsRefreshStatus string - -// Enum values for InsightsRefreshStatus -const ( - InsightsRefreshStatusInProgress InsightsRefreshStatus = "IN_PROGRESS" - InsightsRefreshStatusFailed InsightsRefreshStatus = "FAILED" - InsightsRefreshStatusCompleted InsightsRefreshStatus = "COMPLETED" -) - -// Values returns all known values for InsightsRefreshStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InsightsRefreshStatus) Values() []InsightsRefreshStatus { - return []InsightsRefreshStatus{ - "IN_PROGRESS", - "FAILED", - "COMPLETED", - } -} - -type InsightStatusValue string - -// Enum values for InsightStatusValue -const ( - InsightStatusValuePassing InsightStatusValue = "PASSING" - InsightStatusValueWarning InsightStatusValue = "WARNING" - InsightStatusValueError InsightStatusValue = "ERROR" - InsightStatusValueUnknown InsightStatusValue = "UNKNOWN" -) - -// Values returns all known values for InsightStatusValue. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InsightStatusValue) Values() []InsightStatusValue { - return []InsightStatusValue{ - "PASSING", - "WARNING", - "ERROR", - "UNKNOWN", - } -} - -type IpFamily string - -// Enum values for IpFamily -const ( - IpFamilyIpv4 IpFamily = "ipv4" - IpFamilyIpv6 IpFamily = "ipv6" -) - -// Values returns all known values for IpFamily. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IpFamily) Values() []IpFamily { - return []IpFamily{ - "ipv4", - "ipv6", - } -} - -type LogType string - -// Enum values for LogType -const ( - LogTypeApi LogType = "api" - LogTypeAudit LogType = "audit" - LogTypeAuthenticator LogType = "authenticator" - LogTypeControllerManager LogType = "controllerManager" - LogTypeScheduler LogType = "scheduler" -) - -// Values returns all known values for LogType. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LogType) Values() []LogType { - return []LogType{ - "api", - "audit", - "authenticator", - "controllerManager", - "scheduler", - } -} - -type NodegroupIssueCode string - -// Enum values for NodegroupIssueCode -const ( - NodegroupIssueCodeAutoScalingGroupNotFound NodegroupIssueCode = "AutoScalingGroupNotFound" - NodegroupIssueCodeAutoScalingGroupInvalidConfiguration NodegroupIssueCode = "AutoScalingGroupInvalidConfiguration" - NodegroupIssueCodeEc2SecurityGroupNotFound NodegroupIssueCode = "Ec2SecurityGroupNotFound" - NodegroupIssueCodeEc2SecurityGroupDeletionFailure NodegroupIssueCode = "Ec2SecurityGroupDeletionFailure" - NodegroupIssueCodeEc2LaunchTemplateNotFound NodegroupIssueCode = "Ec2LaunchTemplateNotFound" - NodegroupIssueCodeEc2LaunchTemplateVersionMismatch NodegroupIssueCode = "Ec2LaunchTemplateVersionMismatch" - NodegroupIssueCodeEc2SubnetNotFound NodegroupIssueCode = "Ec2SubnetNotFound" - NodegroupIssueCodeEc2SubnetInvalidConfiguration NodegroupIssueCode = "Ec2SubnetInvalidConfiguration" - NodegroupIssueCodeIamInstanceProfileNotFound NodegroupIssueCode = "IamInstanceProfileNotFound" - NodegroupIssueCodeEc2SubnetMissingIpv6Assignment NodegroupIssueCode = "Ec2SubnetMissingIpv6Assignment" - NodegroupIssueCodeIamLimitExceeded NodegroupIssueCode = "IamLimitExceeded" - NodegroupIssueCodeIamNodeRoleNotFound NodegroupIssueCode = "IamNodeRoleNotFound" - NodegroupIssueCodeNodeCreationFailure NodegroupIssueCode = "NodeCreationFailure" - NodegroupIssueCodeAsgInstanceLaunchFailures NodegroupIssueCode = "AsgInstanceLaunchFailures" - NodegroupIssueCodeInstanceLimitExceeded NodegroupIssueCode = "InstanceLimitExceeded" - NodegroupIssueCodeInsufficientFreeAddresses NodegroupIssueCode = "InsufficientFreeAddresses" - NodegroupIssueCodeAccessDenied NodegroupIssueCode = "AccessDenied" - NodegroupIssueCodeInternalFailure NodegroupIssueCode = "InternalFailure" - NodegroupIssueCodeClusterUnreachable NodegroupIssueCode = "ClusterUnreachable" - NodegroupIssueCodeAmiIdNotFound NodegroupIssueCode = "AmiIdNotFound" - NodegroupIssueCodeAutoScalingGroupOptInRequired NodegroupIssueCode = "AutoScalingGroupOptInRequired" - NodegroupIssueCodeAutoScalingGroupRateLimitExceeded NodegroupIssueCode = "AutoScalingGroupRateLimitExceeded" - NodegroupIssueCodeEc2LaunchTemplateDeletionFailure NodegroupIssueCode = "Ec2LaunchTemplateDeletionFailure" - NodegroupIssueCodeEc2LaunchTemplateInvalidConfiguration NodegroupIssueCode = "Ec2LaunchTemplateInvalidConfiguration" - NodegroupIssueCodeEc2LaunchTemplateMaxLimitExceeded NodegroupIssueCode = "Ec2LaunchTemplateMaxLimitExceeded" - NodegroupIssueCodeEc2SubnetListTooLong NodegroupIssueCode = "Ec2SubnetListTooLong" - NodegroupIssueCodeIamThrottling NodegroupIssueCode = "IamThrottling" - NodegroupIssueCodeNodeTerminationFailure NodegroupIssueCode = "NodeTerminationFailure" - NodegroupIssueCodePodEvictionFailure NodegroupIssueCode = "PodEvictionFailure" - NodegroupIssueCodeSourceEc2LaunchTemplateNotFound NodegroupIssueCode = "SourceEc2LaunchTemplateNotFound" - NodegroupIssueCodeLimitExceeded NodegroupIssueCode = "LimitExceeded" - NodegroupIssueCodeUnknown NodegroupIssueCode = "Unknown" - NodegroupIssueCodeAutoScalingGroupInstanceRefreshActive NodegroupIssueCode = "AutoScalingGroupInstanceRefreshActive" - NodegroupIssueCodeKubernetesLabelInvalid NodegroupIssueCode = "KubernetesLabelInvalid" - NodegroupIssueCodeEc2LaunchTemplateVersionMaxLimitExceeded NodegroupIssueCode = "Ec2LaunchTemplateVersionMaxLimitExceeded" - NodegroupIssueCodeEc2InstanceTypeDoesNotExist NodegroupIssueCode = "Ec2InstanceTypeDoesNotExist" -) - -// Values returns all known values for NodegroupIssueCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NodegroupIssueCode) Values() []NodegroupIssueCode { - return []NodegroupIssueCode{ - "AutoScalingGroupNotFound", - "AutoScalingGroupInvalidConfiguration", - "Ec2SecurityGroupNotFound", - "Ec2SecurityGroupDeletionFailure", - "Ec2LaunchTemplateNotFound", - "Ec2LaunchTemplateVersionMismatch", - "Ec2SubnetNotFound", - "Ec2SubnetInvalidConfiguration", - "IamInstanceProfileNotFound", - "Ec2SubnetMissingIpv6Assignment", - "IamLimitExceeded", - "IamNodeRoleNotFound", - "NodeCreationFailure", - "AsgInstanceLaunchFailures", - "InstanceLimitExceeded", - "InsufficientFreeAddresses", - "AccessDenied", - "InternalFailure", - "ClusterUnreachable", - "AmiIdNotFound", - "AutoScalingGroupOptInRequired", - "AutoScalingGroupRateLimitExceeded", - "Ec2LaunchTemplateDeletionFailure", - "Ec2LaunchTemplateInvalidConfiguration", - "Ec2LaunchTemplateMaxLimitExceeded", - "Ec2SubnetListTooLong", - "IamThrottling", - "NodeTerminationFailure", - "PodEvictionFailure", - "SourceEc2LaunchTemplateNotFound", - "LimitExceeded", - "Unknown", - "AutoScalingGroupInstanceRefreshActive", - "KubernetesLabelInvalid", - "Ec2LaunchTemplateVersionMaxLimitExceeded", - "Ec2InstanceTypeDoesNotExist", - } -} - -type NodegroupStatus string - -// Enum values for NodegroupStatus -const ( - NodegroupStatusCreating NodegroupStatus = "CREATING" - NodegroupStatusActive NodegroupStatus = "ACTIVE" - NodegroupStatusUpdating NodegroupStatus = "UPDATING" - NodegroupStatusDeleting NodegroupStatus = "DELETING" - NodegroupStatusCreateFailed NodegroupStatus = "CREATE_FAILED" - NodegroupStatusDeleteFailed NodegroupStatus = "DELETE_FAILED" - NodegroupStatusDegraded NodegroupStatus = "DEGRADED" -) - -// Values returns all known values for NodegroupStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NodegroupStatus) Values() []NodegroupStatus { - return []NodegroupStatus{ - "CREATING", - "ACTIVE", - "UPDATING", - "DELETING", - "CREATE_FAILED", - "DELETE_FAILED", - "DEGRADED", - } -} - -type NodegroupUpdateStrategies string - -// Enum values for NodegroupUpdateStrategies -const ( - NodegroupUpdateStrategiesDefault NodegroupUpdateStrategies = "DEFAULT" - NodegroupUpdateStrategiesMinimal NodegroupUpdateStrategies = "MINIMAL" -) - -// Values returns all known values for NodegroupUpdateStrategies. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NodegroupUpdateStrategies) Values() []NodegroupUpdateStrategies { - return []NodegroupUpdateStrategies{ - "DEFAULT", - "MINIMAL", - } -} - -type ProvisionedControlPlaneTier string - -// Enum values for ProvisionedControlPlaneTier -const ( - ProvisionedControlPlaneTierStandard ProvisionedControlPlaneTier = "standard" - ProvisionedControlPlaneTierTierXl ProvisionedControlPlaneTier = "tier-xl" - ProvisionedControlPlaneTierTier2xl ProvisionedControlPlaneTier = "tier-2xl" - ProvisionedControlPlaneTierTier4xl ProvisionedControlPlaneTier = "tier-4xl" -) - -// Values returns all known values for ProvisionedControlPlaneTier. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ProvisionedControlPlaneTier) Values() []ProvisionedControlPlaneTier { - return []ProvisionedControlPlaneTier{ - "standard", - "tier-xl", - "tier-2xl", - "tier-4xl", - } -} - -type RepairAction string - -// Enum values for RepairAction -const ( - RepairActionReplace RepairAction = "Replace" - RepairActionReboot RepairAction = "Reboot" - RepairActionNoAction RepairAction = "NoAction" -) - -// Values returns all known values for RepairAction. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RepairAction) Values() []RepairAction { - return []RepairAction{ - "Replace", - "Reboot", - "NoAction", - } -} - -type ResolveConflicts string - -// Enum values for ResolveConflicts -const ( - ResolveConflictsOverwrite ResolveConflicts = "OVERWRITE" - ResolveConflictsNone ResolveConflicts = "NONE" - ResolveConflictsPreserve ResolveConflicts = "PRESERVE" -) - -// Values returns all known values for ResolveConflicts. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResolveConflicts) Values() []ResolveConflicts { - return []ResolveConflicts{ - "OVERWRITE", - "NONE", - "PRESERVE", - } -} - -type SsoIdentityType string - -// Enum values for SsoIdentityType -const ( - SsoIdentityTypeSsoUser SsoIdentityType = "SSO_USER" - SsoIdentityTypeSsoGroup SsoIdentityType = "SSO_GROUP" -) - -// Values returns all known values for SsoIdentityType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SsoIdentityType) Values() []SsoIdentityType { - return []SsoIdentityType{ - "SSO_USER", - "SSO_GROUP", - } -} - -type SupportType string - -// Enum values for SupportType -const ( - SupportTypeStandard SupportType = "STANDARD" - SupportTypeExtended SupportType = "EXTENDED" -) - -// Values returns all known values for SupportType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SupportType) Values() []SupportType { - return []SupportType{ - "STANDARD", - "EXTENDED", - } -} - -type TaintEffect string - -// Enum values for TaintEffect -const ( - TaintEffectNoSchedule TaintEffect = "NO_SCHEDULE" - TaintEffectNoExecute TaintEffect = "NO_EXECUTE" - TaintEffectPreferNoSchedule TaintEffect = "PREFER_NO_SCHEDULE" -) - -// Values returns all known values for TaintEffect. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TaintEffect) Values() []TaintEffect { - return []TaintEffect{ - "NO_SCHEDULE", - "NO_EXECUTE", - "PREFER_NO_SCHEDULE", - } -} - -type UpdateParamType string - -// Enum values for UpdateParamType -const ( - UpdateParamTypeVersion UpdateParamType = "Version" - UpdateParamTypePlatformVersion UpdateParamType = "PlatformVersion" - UpdateParamTypeEndpointPrivateAccess UpdateParamType = "EndpointPrivateAccess" - UpdateParamTypeEndpointPublicAccess UpdateParamType = "EndpointPublicAccess" - UpdateParamTypeClusterLogging UpdateParamType = "ClusterLogging" - UpdateParamTypeDesiredSize UpdateParamType = "DesiredSize" - UpdateParamTypeLabelsToAdd UpdateParamType = "LabelsToAdd" - UpdateParamTypeLabelsToRemove UpdateParamType = "LabelsToRemove" - UpdateParamTypeTaintsToAdd UpdateParamType = "TaintsToAdd" - UpdateParamTypeTaintsToRemove UpdateParamType = "TaintsToRemove" - UpdateParamTypeMaxSize UpdateParamType = "MaxSize" - UpdateParamTypeMinSize UpdateParamType = "MinSize" - UpdateParamTypeReleaseVersion UpdateParamType = "ReleaseVersion" - UpdateParamTypePublicAccessCidrs UpdateParamType = "PublicAccessCidrs" - UpdateParamTypeLaunchTemplateName UpdateParamType = "LaunchTemplateName" - UpdateParamTypeLaunchTemplateVersion UpdateParamType = "LaunchTemplateVersion" - UpdateParamTypeIdentityProviderConfig UpdateParamType = "IdentityProviderConfig" - UpdateParamTypeEncryptionConfig UpdateParamType = "EncryptionConfig" - UpdateParamTypeAddonVersion UpdateParamType = "AddonVersion" - UpdateParamTypeServiceAccountRoleArn UpdateParamType = "ServiceAccountRoleArn" - UpdateParamTypeResolveConflicts UpdateParamType = "ResolveConflicts" - UpdateParamTypeMaxUnavailable UpdateParamType = "MaxUnavailable" - UpdateParamTypeMaxUnavailablePercentage UpdateParamType = "MaxUnavailablePercentage" - UpdateParamTypeNodeRepairEnabled UpdateParamType = "NodeRepairEnabled" - UpdateParamTypeUpdateStrategy UpdateParamType = "UpdateStrategy" - UpdateParamTypeConfigurationValues UpdateParamType = "ConfigurationValues" - UpdateParamTypeSecurityGroups UpdateParamType = "SecurityGroups" - UpdateParamTypeSubnets UpdateParamType = "Subnets" - UpdateParamTypeAuthenticationMode UpdateParamType = "AuthenticationMode" - UpdateParamTypePodIdentityAssociations UpdateParamType = "PodIdentityAssociations" - UpdateParamTypeUpgradePolicy UpdateParamType = "UpgradePolicy" - UpdateParamTypeZonalShiftConfig UpdateParamType = "ZonalShiftConfig" - UpdateParamTypeComputeConfig UpdateParamType = "ComputeConfig" - UpdateParamTypeStorageConfig UpdateParamType = "StorageConfig" - UpdateParamTypeKubernetesNetworkConfig UpdateParamType = "KubernetesNetworkConfig" - UpdateParamTypeRemoteNetworkConfig UpdateParamType = "RemoteNetworkConfig" - UpdateParamTypeDeletionProtection UpdateParamType = "DeletionProtection" - UpdateParamTypeNodeRepairConfig UpdateParamType = "NodeRepairConfig" - UpdateParamTypeUpdatedTier UpdateParamType = "UpdatedTier" - UpdateParamTypePreviousTier UpdateParamType = "PreviousTier" -) - -// Values returns all known values for UpdateParamType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UpdateParamType) Values() []UpdateParamType { - return []UpdateParamType{ - "Version", - "PlatformVersion", - "EndpointPrivateAccess", - "EndpointPublicAccess", - "ClusterLogging", - "DesiredSize", - "LabelsToAdd", - "LabelsToRemove", - "TaintsToAdd", - "TaintsToRemove", - "MaxSize", - "MinSize", - "ReleaseVersion", - "PublicAccessCidrs", - "LaunchTemplateName", - "LaunchTemplateVersion", - "IdentityProviderConfig", - "EncryptionConfig", - "AddonVersion", - "ServiceAccountRoleArn", - "ResolveConflicts", - "MaxUnavailable", - "MaxUnavailablePercentage", - "NodeRepairEnabled", - "UpdateStrategy", - "ConfigurationValues", - "SecurityGroups", - "Subnets", - "AuthenticationMode", - "PodIdentityAssociations", - "UpgradePolicy", - "ZonalShiftConfig", - "ComputeConfig", - "StorageConfig", - "KubernetesNetworkConfig", - "RemoteNetworkConfig", - "DeletionProtection", - "NodeRepairConfig", - "UpdatedTier", - "PreviousTier", - } -} - -type UpdateStatus string - -// Enum values for UpdateStatus -const ( - UpdateStatusInProgress UpdateStatus = "InProgress" - UpdateStatusFailed UpdateStatus = "Failed" - UpdateStatusCancelled UpdateStatus = "Cancelled" - UpdateStatusSuccessful UpdateStatus = "Successful" -) - -// Values returns all known values for UpdateStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UpdateStatus) Values() []UpdateStatus { - return []UpdateStatus{ - "InProgress", - "Failed", - "Cancelled", - "Successful", - } -} - -type UpdateType string - -// Enum values for UpdateType -const ( - UpdateTypeVersionUpdate UpdateType = "VersionUpdate" - UpdateTypeEndpointAccessUpdate UpdateType = "EndpointAccessUpdate" - UpdateTypeLoggingUpdate UpdateType = "LoggingUpdate" - UpdateTypeConfigUpdate UpdateType = "ConfigUpdate" - UpdateTypeAssociateIdentityProviderConfig UpdateType = "AssociateIdentityProviderConfig" - UpdateTypeDisassociateIdentityProviderConfig UpdateType = "DisassociateIdentityProviderConfig" - UpdateTypeAssociateEncryptionConfig UpdateType = "AssociateEncryptionConfig" - UpdateTypeAddonUpdate UpdateType = "AddonUpdate" - UpdateTypeVpcConfigUpdate UpdateType = "VpcConfigUpdate" - UpdateTypeAccessConfigUpdate UpdateType = "AccessConfigUpdate" - UpdateTypeUpgradePolicyUpdate UpdateType = "UpgradePolicyUpdate" - UpdateTypeZonalShiftConfigUpdate UpdateType = "ZonalShiftConfigUpdate" - UpdateTypeAutoModeUpdate UpdateType = "AutoModeUpdate" - UpdateTypeRemoteNetworkConfigUpdate UpdateType = "RemoteNetworkConfigUpdate" - UpdateTypeDeletionProtectionUpdate UpdateType = "DeletionProtectionUpdate" - UpdateTypeControlPlaneScalingConfigUpdate UpdateType = "ControlPlaneScalingConfigUpdate" -) - -// Values returns all known values for UpdateType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (UpdateType) Values() []UpdateType { - return []UpdateType{ - "VersionUpdate", - "EndpointAccessUpdate", - "LoggingUpdate", - "ConfigUpdate", - "AssociateIdentityProviderConfig", - "DisassociateIdentityProviderConfig", - "AssociateEncryptionConfig", - "AddonUpdate", - "VpcConfigUpdate", - "AccessConfigUpdate", - "UpgradePolicyUpdate", - "ZonalShiftConfigUpdate", - "AutoModeUpdate", - "RemoteNetworkConfigUpdate", - "DeletionProtectionUpdate", - "ControlPlaneScalingConfigUpdate", - } -} - -type VersionStatus string - -// Enum values for VersionStatus -const ( - VersionStatusUnsupported VersionStatus = "UNSUPPORTED" - VersionStatusStandardSupport VersionStatus = "STANDARD_SUPPORT" - VersionStatusExtendedSupport VersionStatus = "EXTENDED_SUPPORT" -) - -// Values returns all known values for VersionStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (VersionStatus) Values() []VersionStatus { - return []VersionStatus{ - "UNSUPPORTED", - "STANDARD_SUPPORT", - "EXTENDED_SUPPORT", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/errors.go deleted file mode 100644 index fa4899b26458..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/errors.go +++ /dev/null @@ -1,469 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// You don't have permissions to perform the requested operation. The [IAM principal] making the -// request must have at least one IAM permissions policy attached that grants the -// required permissions. For more information, see [Access management]in the IAM User Guide. -// -// [Access management]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html -// [IAM principal]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html -type AccessDeniedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. -type BadRequestException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *BadRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *BadRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *BadRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "BadRequestException" - } - return *e.ErrorCodeOverride -} -func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// These errors are usually caused by a client action. Actions can include using -// an action or resource on behalf of an [IAM principal]that doesn't have permissions to use the -// action or resource or specifying an identifier that is not valid. -// -// [IAM principal]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html -type ClientException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - AddonName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *ClientException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ClientException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ClientException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ClientException" - } - return *e.ErrorCodeOverride -} -func (e *ClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified parameter is invalid. Review the available parameters for the API -// request. -type InvalidParameterException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - FargateProfileName *string - AddonName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidParameterException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidParameterException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidParameterException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The request is invalid given the state of the cluster. Check the state of the -// cluster and the associated operations. -type InvalidRequestException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - AddonName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Amazon EKS detected upgrade readiness issues. Call the [ListInsights]ListInsights API to view -// detected upgrade blocking issues. Pass the [force]force flag when updating to override -// upgrade readiness errors. -// -// [ListInsights]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListInsights.html -// [force]: https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateClusterVersion.html#API_UpdateClusterVersion_RequestBody -type InvalidStateException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - - noSmithyDocumentSerde -} - -func (e *InvalidStateException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidStateException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidStateException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidStateException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// A service resource associated with the request could not be found. Clients -// should not retry such requests. -type NotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *NotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *NotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *NotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "NotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified resource is in use. -type ResourceInUseException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - AddonName *string - - noSmithyDocumentSerde -} - -func (e *ResourceInUseException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceInUseException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceInUseException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceInUseException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You have encountered a service limit on the specified resource. -type ResourceLimitExceededException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *ResourceLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceLimitExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceLimitExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceLimitExceededException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified resource could not be found. You can view your available clusters -// with ListClusters . You can view your available managed node groups with -// ListNodegroups . Amazon EKS clusters and node groups are Amazon Web Services -// Region specific. -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - FargateProfileName *string - AddonName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Required resources (such as service-linked roles) were created and are still -// propagating. Retry later. -type ResourcePropagationDelayException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ResourcePropagationDelayException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourcePropagationDelayException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourcePropagationDelayException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourcePropagationDelayException" - } - return *e.ErrorCodeOverride -} -func (e *ResourcePropagationDelayException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// These errors are usually caused by a server-side issue. -type ServerException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - AddonName *string - SubscriptionId *string - - noSmithyDocumentSerde -} - -func (e *ServerException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ServerException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ServerException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ServerException" - } - return *e.ErrorCodeOverride -} -func (e *ServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// The service is unavailable. Back off and retry the operation. -type ServiceUnavailableException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ServiceUnavailableException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ServiceUnavailableException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ServiceUnavailableException" - } - return *e.ErrorCodeOverride -} -func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// The request or operation couldn't be performed because a service is throttling -// requests. -type ThrottlingException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - - noSmithyDocumentSerde -} - -func (e *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ThrottlingException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ThrottlingException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ThrottlingException" - } - return *e.ErrorCodeOverride -} -func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// At least one of your specified cluster subnets is in an Availability Zone that -// does not support Amazon EKS. The exception output specifies the supported -// Availability Zones for your account, from which you can choose subnets for your -// cluster. -type UnsupportedAvailabilityZoneException struct { - Message *string - - ErrorCodeOverride *string - - ClusterName *string - NodegroupName *string - ValidZones []string - - noSmithyDocumentSerde -} - -func (e *UnsupportedAvailabilityZoneException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnsupportedAvailabilityZoneException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnsupportedAvailabilityZoneException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnsupportedAvailabilityZoneException" - } - return *e.ErrorCodeOverride -} -func (e *UnsupportedAvailabilityZoneException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/types.go deleted file mode 100644 index 0bf296c6a923..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/types.go +++ /dev/null @@ -1,2880 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// The access configuration for the cluster. -type AccessConfigResponse struct { - - // The current authentication mode of the cluster. - AuthenticationMode AuthenticationMode - - // Specifies whether or not the cluster creator IAM principal was set as a cluster - // admin access entry during cluster creation time. - BootstrapClusterCreatorAdminPermissions *bool - - noSmithyDocumentSerde -} - -// An access entry allows an IAM principal (user or role) to access your cluster. -// Access entries can replace the need to maintain the aws-auth ConfigMap for -// authentication. For more information about access entries, see [Access entries]in the Amazon -// EKS User Guide. -// -// [Access entries]: https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html -type AccessEntry struct { - - // The ARN of the access entry. - AccessEntryArn *string - - // The name of your cluster. - ClusterName *string - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // A name that you've specified in a Kubernetes RoleBinding or ClusterRoleBinding - // object so that Kubernetes authorizes the principalARN access to cluster objects. - KubernetesGroups []string - - // The Unix epoch timestamp for the last modification to the object. - ModifiedAt *time.Time - - // The ARN of the IAM principal for the access entry. If you ever delete the IAM - // principal with this ARN, the access entry isn't automatically deleted. We - // recommend that you delete the access entry with an ARN for an IAM principal that - // you delete. If you don't delete the access entry and ever recreate the IAM - // principal, even if it has the same ARN, the access entry won't work. This is - // because even though the ARN is the same for the recreated IAM principal, the - // roleID or userID (you can see this with the Security Token Service - // GetCallerIdentity API) is different for the recreated IAM principal than it was - // for the original IAM principal. Even though you don't see the IAM principal's - // roleID or userID for an access entry, Amazon EKS stores it with the access - // entry. - PrincipalArn *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // The type of the access entry. - Type *string - - // The name of a user that can authenticate to your cluster. - Username *string - - noSmithyDocumentSerde -} - -// An access policy includes permissions that allow Amazon EKS to authorize an IAM -// principal to work with Kubernetes objects on your cluster. The policies are -// managed by Amazon EKS, but they're not IAM policies. You can't view the -// permissions in the policies using the API. The permissions for many of the -// policies are similar to the Kubernetes cluster-admin , admin , edit , and view -// cluster roles. For more information about these cluster roles, see [User-facing roles]in the -// Kubernetes documentation. To view the contents of the policies, see [Access policy permissions]in the -// Amazon EKS User Guide. -// -// [User-facing roles]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles -// [Access policy permissions]: https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html#access-policy-permissions -type AccessPolicy struct { - - // The ARN of the access policy. - Arn *string - - // The name of the access policy. - Name *string - - noSmithyDocumentSerde -} - -// The scope of an AccessPolicy that's associated to an AccessEntry . -type AccessScope struct { - - // A Kubernetes namespace that an access policy is scoped to. A value is required - // if you specified namespace for Type . - Namespaces []string - - // The scope type of an access policy. - Type AccessScopeType - - noSmithyDocumentSerde -} - -// An Amazon EKS add-on. For more information, see [Amazon EKS add-ons] in the Amazon EKS User Guide. -// -// [Amazon EKS add-ons]: https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html -type Addon struct { - - // The Amazon Resource Name (ARN) of the add-on. - AddonArn *string - - // The name of the add-on. - AddonName *string - - // The version of the add-on. - AddonVersion *string - - // The name of your cluster. - ClusterName *string - - // The configuration values that you provided. - ConfigurationValues *string - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // An object that represents the health of the add-on. - Health *AddonHealth - - // Information about an Amazon EKS add-on from the Amazon Web Services Marketplace. - MarketplaceInformation *MarketplaceInformation - - // The Unix epoch timestamp for the last modification to the object. - ModifiedAt *time.Time - - // The namespace configuration for the addon. This specifies the Kubernetes - // namespace where the addon is installed. - NamespaceConfig *AddonNamespaceConfigResponse - - // The owner of the add-on. - Owner *string - - // An array of EKS Pod Identity associations owned by the add-on. Each association - // maps a role to a service account in a namespace in the cluster. - // - // For more information, see [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity] in the Amazon EKS User Guide. - // - // [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html - PodIdentityAssociations []string - - // The publisher of the add-on. - Publisher *string - - // The Amazon Resource Name (ARN) of the IAM role that's bound to the Kubernetes - // ServiceAccount object that the add-on uses. - ServiceAccountRoleArn *string - - // The status of the add-on. - Status AddonStatus - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -// The summary information about the Amazon EKS add-on compatibility for the next -// Kubernetes version for an insight check in the UPGRADE_READINESS category. -type AddonCompatibilityDetail struct { - - // The list of compatible Amazon EKS add-on versions for the next Kubernetes - // version. - CompatibleVersions []string - - // The name of the Amazon EKS add-on. - Name *string - - noSmithyDocumentSerde -} - -// The health of the add-on. -type AddonHealth struct { - - // An object representing the health issues for an add-on. - Issues []AddonIssue - - noSmithyDocumentSerde -} - -// Information about an add-on. -type AddonInfo struct { - - // The name of the add-on. - AddonName *string - - // An object representing information about available add-on versions and - // compatible Kubernetes versions. - AddonVersions []AddonVersionInfo - - // The default Kubernetes namespace where this addon is typically installed if no - // custom namespace is specified. - DefaultNamespace *string - - // Information about the add-on from the Amazon Web Services Marketplace. - MarketplaceInformation *MarketplaceInformation - - // The owner of the add-on. - Owner *string - - // The publisher of the add-on. - Publisher *string - - // The type of the add-on. - Type *string - - noSmithyDocumentSerde -} - -// An issue related to an add-on. -type AddonIssue struct { - - // A code that describes the type of issue. - Code AddonIssueCode - - // A message that provides details about the issue and what might cause it. - Message *string - - // The resource IDs of the issue. - ResourceIds []string - - noSmithyDocumentSerde -} - -// The namespace configuration request object for specifying a custom namespace -// when creating an addon. -type AddonNamespaceConfigRequest struct { - - // The name of the Kubernetes namespace to install the addon in. Must be a valid - // RFC 1123 DNS label. - Namespace *string - - noSmithyDocumentSerde -} - -// The namespace configuration response object containing information about the -// namespace where an addon is installed. -type AddonNamespaceConfigResponse struct { - - // The name of the Kubernetes namespace where the addon is installed. - Namespace *string - - noSmithyDocumentSerde -} - -// A type of EKS Pod Identity association owned by an Amazon EKS add-on. -// -// Each association maps a role to a service account in a namespace in the cluster. -// -// For more information, see [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity] in the Amazon EKS User Guide. -// -// [Attach an IAM Role to an Amazon EKS add-on using EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/add-ons-iam.html -type AddonPodIdentityAssociations struct { - - // The ARN of an IAM Role. - // - // This member is required. - RoleArn *string - - // The name of a Kubernetes Service Account. - // - // This member is required. - ServiceAccount *string - - noSmithyDocumentSerde -} - -// Information about how to configure IAM for an add-on. -type AddonPodIdentityConfiguration struct { - - // A suggested IAM Policy for the add-on. - RecommendedManagedPolicies []string - - // The Kubernetes Service Account name used by the add-on. - ServiceAccount *string - - noSmithyDocumentSerde -} - -// Information about an add-on version. -type AddonVersionInfo struct { - - // The version of the add-on. - AddonVersion *string - - // The architectures that the version supports. - Architecture []string - - // An object representing the compatibilities of a version. - Compatibilities []Compatibility - - // Indicates the compute type of the add-on version. - ComputeTypes []string - - // Whether the add-on requires configuration. - RequiresConfiguration bool - - // Indicates if the add-on requires IAM Permissions to operate, such as networking - // permissions. - RequiresIamPermissions bool - - noSmithyDocumentSerde -} - -// Configuration for integrating Argo CD with IAM Identity CenterIAM; Identity -// Center. This allows you to use your organization's identity provider for -// authentication to Argo CD. -type ArgoCdAwsIdcConfigRequest struct { - - // The Amazon Resource Name (ARN) of the IAM Identity CenterIAM; Identity Center - // instance to use for authentication. - // - // This member is required. - IdcInstanceArn *string - - // The Region where your IAM Identity CenterIAM; Identity Center instance is - // located. - IdcRegion *string - - noSmithyDocumentSerde -} - -// The response object containing IAM Identity CenterIAM; Identity Center -// configuration details for an Argo CD capability. -type ArgoCdAwsIdcConfigResponse struct { - - // The Amazon Resource Name (ARN) of the IAM Identity CenterIAM; Identity Center - // instance used for authentication. - IdcInstanceArn *string - - // The Amazon Resource Name (ARN) of the managed application created in IAM - // Identity CenterIAM; Identity Center for this Argo CD capability. This - // application is automatically created and managed by Amazon EKS. - IdcManagedApplicationArn *string - - // The Region where the IAM Identity CenterIAM; Identity Center instance is - // located. - IdcRegion *string - - noSmithyDocumentSerde -} - -// Configuration settings for an Argo CD capability. This includes the Kubernetes -// namespace, IAM Identity CenterIAM; Identity Center integration, RBAC role -// mappings, and network access configuration. -type ArgoCdConfigRequest struct { - - // Configuration for IAM Identity CenterIAM; Identity Center integration. When - // configured, users can authenticate to Argo CD using their IAM Identity - // CenterIAM; Identity Center credentials. - // - // This member is required. - AwsIdc *ArgoCdAwsIdcConfigRequest - - // The Kubernetes namespace where Argo CD resources will be created. If not - // specified, the default namespace is used. - Namespace *string - - // Configuration for network access to the Argo CD capability's managed API server - // endpoint. By default, the Argo CD server is accessible via a public endpoint. - // You can optionally specify one or more VPC endpoint IDs to enable private - // connectivity from your VPCs. When VPC endpoints are configured, public access is - // blocked and the Argo CD server is only accessible through the specified VPC - // endpoints. - NetworkAccess *ArgoCdNetworkAccessConfigRequest - - // A list of role mappings that define which IAM Identity CenterIAM; Identity - // Center users or groups have which Argo CD roles. Each mapping associates an Argo - // CD role ( ADMIN , EDITOR , or VIEWER ) with one or more IAM Identity CenterIAM; - // Identity Center identities. - RbacRoleMappings []ArgoCdRoleMapping - - noSmithyDocumentSerde -} - -// The response object containing Argo CD configuration details, including the -// server URL that you use to access the Argo CD web interface and API. -type ArgoCdConfigResponse struct { - - // The IAM Identity CenterIAM; Identity Center integration configuration. - AwsIdc *ArgoCdAwsIdcConfigResponse - - // The Kubernetes namespace where Argo CD resources are monitored by your Argo CD - // Capability. - Namespace *string - - // The network access configuration for the Argo CD capability's managed API - // server endpoint. If VPC endpoint IDs are specified, public access is blocked and - // the Argo CD server is only accessible through the specified VPC endpoints. - NetworkAccess *ArgoCdNetworkAccessConfigResponse - - // The list of role mappings that define which IAM Identity CenterIAM; Identity - // Center users or groups have which Argo CD roles. - RbacRoleMappings []ArgoCdRoleMapping - - // The URL of the Argo CD server. Use this URL to access the Argo CD web interface - // and API. - ServerUrl *string - - noSmithyDocumentSerde -} - -// Configuration for network access to the Argo CD capability's managed API server -// endpoint. When VPC endpoint IDs are specified, public access is blocked and the -// Argo CD server is only accessible through the specified VPC endpoints. -type ArgoCdNetworkAccessConfigRequest struct { - - // A list of VPC endpoint IDs to associate with the managed Argo CD API server - // endpoint. Each VPC endpoint provides private connectivity from a specific VPC to - // the Argo CD server. You can specify multiple VPC endpoint IDs to enable access - // from multiple VPCs. - VpceIds []string - - noSmithyDocumentSerde -} - -// The response object containing network access configuration for the Argo CD -// capability's managed API server endpoint. If VPC endpoint IDs are present, -// public access is blocked and the Argo CD server is only accessible through the -// specified VPC endpoints. -type ArgoCdNetworkAccessConfigResponse struct { - - // The list of VPC endpoint IDs associated with the managed Argo CD API server - // endpoint. Each VPC endpoint provides private connectivity from a specific VPC to - // the Argo CD server. - VpceIds []string - - noSmithyDocumentSerde -} - -// A mapping between an Argo CD role and IAM Identity CenterIAM; Identity Center -// identities. This defines which users or groups have specific permissions in Argo -// CD. -type ArgoCdRoleMapping struct { - - // A list of IAM Identity CenterIAM; Identity Center identities (users or groups) - // that should be assigned this Argo CD role. - // - // This member is required. - Identities []SsoIdentity - - // The Argo CD role to assign. Valid values are: - // - // - ADMIN – Full administrative access to Argo CD. - // - // - EDITOR – Edit access to Argo CD resources. - // - // - VIEWER – Read-only access to Argo CD resources. - // - // This member is required. - Role ArgoCdRole - - noSmithyDocumentSerde -} - -// An access policy association. -type AssociatedAccessPolicy struct { - - // The scope of the access policy. - AccessScope *AccessScope - - // The date and time the AccessPolicy was associated with an AccessEntry . - AssociatedAt *time.Time - - // The Unix epoch timestamp for the last modification to the object. - ModifiedAt *time.Time - - // The ARN of the AccessPolicy . - PolicyArn *string - - noSmithyDocumentSerde -} - -// An Auto Scaling group that is associated with an Amazon EKS managed node group. -type AutoScalingGroup struct { - - // The name of the Auto Scaling group associated with an Amazon EKS managed node - // group. - Name *string - - noSmithyDocumentSerde -} - -// Indicates the current configuration of the block storage capability on your EKS -// Auto Mode cluster. For example, if the capability is enabled or disabled. If the -// block storage capability is enabled, EKS Auto Mode will create and delete EBS -// volumes in your Amazon Web Services account. For more information, see EKS Auto -// Mode block storage capability in the Amazon EKS User Guide. -type BlockStorage struct { - - // Indicates if the block storage capability is enabled on your EKS Auto Mode - // cluster. If the block storage capability is enabled, EKS Auto Mode will create - // and delete EBS volumes in your Amazon Web Services account. - Enabled *bool - - noSmithyDocumentSerde -} - -// An object representing a managed capability in an Amazon EKS cluster. This -// includes all configuration, status, and health information for the capability. -type Capability struct { - - // The Amazon Resource Name (ARN) of the capability. - Arn *string - - // The unique name of the capability within the cluster. - CapabilityName *string - - // The name of the Amazon EKS cluster that contains this capability. - ClusterName *string - - // The configuration settings for the capability. The structure varies depending - // on the capability type. - Configuration *CapabilityConfigurationResponse - - // The Unix epoch timestamp in seconds for when the capability was created. - CreatedAt *time.Time - - // The delete propagation policy for the capability. Currently, the only supported - // value is RETAIN , which keeps all resources managed by the capability when the - // capability is deleted. - DeletePropagationPolicy CapabilityDeletePropagationPolicy - - // Health information for the capability, including any issues that may be - // affecting its operation. - Health *CapabilityHealth - - // The Unix epoch timestamp in seconds for when the capability was last modified. - ModifiedAt *time.Time - - // The Amazon Resource Name (ARN) of the IAM role that the capability uses to - // interact with Amazon Web Services services. - RoleArn *string - - // The current status of the capability. Valid values include: - // - // - CREATING – The capability is being created. - // - // - ACTIVE – The capability is running and available. - // - // - UPDATING – The capability is being updated. - // - // - DELETING – The capability is being deleted. - // - // - CREATE_FAILED – The capability creation failed. - // - // - UPDATE_FAILED – The capability update failed. - // - // - DELETE_FAILED – The capability deletion failed. - Status CapabilityStatus - - // The metadata that you apply to a resource to help you categorize and organize - // them. Each tag consists of a key and an optional value. You define them. - // - // The following basic restrictions apply to tags: - // - // - Maximum number of tags per resource – 50 - // - // - For each resource, each tag key must be unique, and each tag key can have - // only one value. - // - // - Maximum key length – 128 Unicode characters in UTF-8 - // - // - Maximum value length – 256 Unicode characters in UTF-8 - // - // - If your tagging schema is used across multiple services and resources, - // remember that other services may have restrictions on allowed characters. - // Generally allowed characters are: letters, numbers, and spaces representable in - // UTF-8, and the following characters: + - = . _ : / @. - // - // - Tag keys and values are case-sensitive. - // - // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a - // prefix for either keys or values as it is reserved for Amazon Web Services use. - // You cannot edit or delete tag keys or values with this prefix. Tags with this - // prefix do not count against your tags per resource limit. - Tags map[string]string - - // The type of capability. Valid values are ACK , ARGOCD , or KRO . - Type CapabilityType - - // The version of the capability software that is currently running. - Version *string - - noSmithyDocumentSerde -} - -// Configuration settings for a capability. The structure of this object varies -// depending on the capability type. -type CapabilityConfigurationRequest struct { - - // Configuration settings specific to Argo CD capabilities. This field is only - // used when creating or updating an Argo CD capability. - ArgoCd *ArgoCdConfigRequest - - noSmithyDocumentSerde -} - -// The response object containing capability configuration details. -type CapabilityConfigurationResponse struct { - - // Configuration settings for an Argo CD capability, including the server URL and - // other Argo CD-specific settings. - ArgoCd *ArgoCdConfigResponse - - noSmithyDocumentSerde -} - -// Health information for a capability, including any issues that may be affecting -// its operation. -type CapabilityHealth struct { - - // A list of issues affecting the capability. If this list is empty, the - // capability is healthy. - Issues []CapabilityIssue - - noSmithyDocumentSerde -} - -// An issue affecting a capability's health or operation. -type CapabilityIssue struct { - - // A code identifying the type of issue. This can be used to programmatically - // handle specific issue types. - Code CapabilityIssueCode - - // A human-readable message describing the issue and potential remediation steps. - Message *string - - noSmithyDocumentSerde -} - -// A summary of a capability, containing basic information without the full -// configuration details. This is returned by the ListCapabilities operation. -type CapabilitySummary struct { - - // The Amazon Resource Name (ARN) of the capability. - Arn *string - - // The unique name of the capability within the cluster. - CapabilityName *string - - // The Unix epoch timestamp in seconds for when the capability was created. - CreatedAt *time.Time - - // The Unix epoch timestamp in seconds for when the capability was last modified. - ModifiedAt *time.Time - - // The current status of the capability. - Status CapabilityStatus - - // The type of capability. Valid values are ACK , ARGOCD , or KRO . - Type CapabilityType - - // The version of the capability software that is currently running. - Version *string - - noSmithyDocumentSerde -} - -// An object representing the certificate-authority-data for your cluster. -type Certificate struct { - - // The Base64-encoded certificate data required to communicate with your cluster. - // Add this to the certificate-authority-data section of the kubeconfig file for - // your cluster. - Data *string - - noSmithyDocumentSerde -} - -// Details about clients using the deprecated resources. -type ClientStat struct { - - // The timestamp of the last request seen from the Kubernetes client. - LastRequestTime *time.Time - - // The number of requests from the Kubernetes client seen over the last 30 days. - NumberOfRequestsLast30Days int32 - - // The user agent of the Kubernetes client using the deprecated resource. - UserAgent *string - - noSmithyDocumentSerde -} - -// An object representing an Amazon EKS cluster. -type Cluster struct { - - // The access configuration for the cluster. - AccessConfig *AccessConfigResponse - - // The Amazon Resource Name (ARN) of the cluster. - Arn *string - - // The certificate-authority-data for your cluster. - CertificateAuthority *Certificate - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string - - // Indicates the current configuration of the compute capability on your EKS Auto - // Mode cluster. For example, if the capability is enabled or disabled. If the - // compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed - // Instances in your Amazon Web Services account. For more information, see EKS - // Auto Mode compute capability in the Amazon EKS User Guide. - ComputeConfig *ComputeConfigResponse - - // The configuration used to connect to a cluster for registration. - ConnectorConfig *ConnectorConfigResponse - - // The control plane scaling tier configuration. For more information, see EKS - // Provisioned Control Plane in the Amazon EKS User Guide. - ControlPlaneScalingConfig *ControlPlaneScalingConfig - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // The current deletion protection setting for the cluster. When true , deletion - // protection is enabled and the cluster cannot be deleted until protection is - // disabled. When false , the cluster can be deleted normally. This setting only - // applies to clusters in an active state. - DeletionProtection *bool - - // The encryption configuration for the cluster. - EncryptionConfig []EncryptionConfig - - // The endpoint for your Kubernetes API server. - Endpoint *string - - // An object representing the health of your Amazon EKS cluster. - Health *ClusterHealth - - // The ID of your local Amazon EKS cluster on an Amazon Web Services Outpost. This - // property isn't available for an Amazon EKS cluster on the Amazon Web Services - // cloud. - Id *string - - // The identity provider information for the cluster. - Identity *Identity - - // The Kubernetes network configuration for the cluster. - KubernetesNetworkConfig *KubernetesNetworkConfigResponse - - // The logging configuration for your cluster. - Logging *Logging - - // The name of your cluster. - Name *string - - // An object representing the configuration of your local Amazon EKS cluster on an - // Amazon Web Services Outpost. This object isn't available for clusters on the - // Amazon Web Services cloud. - OutpostConfig *OutpostConfigResponse - - // The platform version of your Amazon EKS cluster. For more information about - // clusters deployed on the Amazon Web Services Cloud, see [Platform versions]in the Amazon EKS User - // Guide . For more information about local clusters deployed on an Outpost, see [Amazon EKS local cluster platform versions] - // in the Amazon EKS User Guide . - // - // [Platform versions]: https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html - // [Amazon EKS local cluster platform versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-platform-versions.html - PlatformVersion *string - - // The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or - // remove this configuration after the cluster is created. - RemoteNetworkConfig *RemoteNetworkConfigResponse - - // The VPC configuration used by the cluster control plane. Amazon EKS VPC - // resources have specific requirements to work properly with Kubernetes. For more - // information, see [Cluster VPC considerations]and [Cluster security group considerations] in the Amazon EKS User Guide. - // - // [Cluster security group considerations]: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html - // [Cluster VPC considerations]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html - ResourcesVpcConfig *VpcConfigResponse - - // The Amazon Resource Name (ARN) of the IAM role that provides permissions for - // the Kubernetes control plane to make calls to Amazon Web Services API operations - // on your behalf. - RoleArn *string - - // The current status of the cluster. - Status ClusterStatus - - // Indicates the current configuration of the block storage capability on your EKS - // Auto Mode cluster. For example, if the capability is enabled or disabled. If the - // block storage capability is enabled, EKS Auto Mode will create and delete EBS - // volumes in your Amazon Web Services account. For more information, see EKS Auto - // Mode block storage capability in the Amazon EKS User Guide. - StorageConfig *StorageConfigResponse - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // This value indicates if extended support is enabled or disabled for the cluster. - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.] - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html - UpgradePolicy *UpgradePolicyResponse - - // The Kubernetes server version for the cluster. - Version *string - - // The configuration for zonal shift for the cluster. - ZonalShiftConfig *ZonalShiftConfigResponse - - noSmithyDocumentSerde -} - -// An object representing the health of your Amazon EKS cluster. -type ClusterHealth struct { - - // An object representing the health issues of your Amazon EKS cluster. - Issues []ClusterIssue - - noSmithyDocumentSerde -} - -// An issue with your Amazon EKS cluster. -type ClusterIssue struct { - - // The error code of the issue. - Code ClusterIssueCode - - // A description of the issue. - Message *string - - // The resource IDs that the issue relates to. - ResourceIds []string - - noSmithyDocumentSerde -} - -// Contains details about a specific EKS cluster version. -type ClusterVersionInformation struct { - - // The type of cluster this version is for. - ClusterType *string - - // The Kubernetes version for the cluster. - ClusterVersion *string - - // Default platform version for this Kubernetes version. - DefaultPlatformVersion *string - - // Indicates if this is a default version. - DefaultVersion bool - - // Date when extended support ends for this version. - EndOfExtendedSupportDate *time.Time - - // Date when standard support ends for this version. - EndOfStandardSupportDate *time.Time - - // The patch version of Kubernetes for this cluster version. - KubernetesPatchVersion *string - - // The release date of this cluster version. - ReleaseDate *time.Time - - // This field is deprecated. Use versionStatus instead, as that field matches for - // input and output of this action. - // - // Current status of this cluster version. - Status ClusterVersionStatus - - // Current status of this cluster version. - VersionStatus VersionStatus - - noSmithyDocumentSerde -} - -// Compatibility information. -type Compatibility struct { - - // The supported Kubernetes version of the cluster. - ClusterVersion *string - - // The supported default version. - DefaultVersion bool - - // The supported compute platform. - PlatformVersions []string - - noSmithyDocumentSerde -} - -// Request to update the configuration of the compute capability of your EKS Auto -// Mode cluster. For example, enable the capability. For more information, see EKS -// Auto Mode compute capability in the Amazon EKS User Guide. -type ComputeConfigRequest struct { - - // Request to enable or disable the compute capability on your EKS Auto Mode - // cluster. If the compute capability is enabled, EKS Auto Mode will create and - // delete EC2 Managed Instances in your Amazon Web Services account. - Enabled *bool - - // Configuration for node pools that defines the compute resources for your EKS - // Auto Mode cluster. For more information, see EKS Auto Mode Node Pools in the - // Amazon EKS User Guide. - NodePools []string - - // The ARN of the IAM Role EKS will assign to EC2 Managed Instances in your EKS - // Auto Mode cluster. This value cannot be changed after the compute capability of - // EKS Auto Mode is enabled. For more information, see the IAM Reference in the - // Amazon EKS User Guide. - NodeRoleArn *string - - noSmithyDocumentSerde -} - -// Indicates the status of the request to update the compute capability of your -// EKS Auto Mode cluster. -type ComputeConfigResponse struct { - - // Indicates if the compute capability is enabled on your EKS Auto Mode cluster. - // If the compute capability is enabled, EKS Auto Mode will create and delete EC2 - // Managed Instances in your Amazon Web Services account. - Enabled *bool - - // Indicates the current configuration of node pools in your EKS Auto Mode - // cluster. For more information, see EKS Auto Mode Node Pools in the Amazon EKS - // User Guide. - NodePools []string - - // The ARN of the IAM Role EKS will assign to EC2 Managed Instances in your EKS - // Auto Mode cluster. - NodeRoleArn *string - - noSmithyDocumentSerde -} - -// The configuration sent to a cluster for configuration. -type ConnectorConfigRequest struct { - - // The cloud provider for the target cluster to connect. - // - // This member is required. - Provider ConnectorConfigProvider - - // The Amazon Resource Name (ARN) of the role that is authorized to request the - // connector configuration. - // - // This member is required. - RoleArn *string - - noSmithyDocumentSerde -} - -// The full description of your connected cluster. -type ConnectorConfigResponse struct { - - // A unique code associated with the cluster for registration purposes. - ActivationCode *string - - // The expiration time of the connected cluster. The cluster's YAML file must be - // applied through the native provider. - ActivationExpiry *time.Time - - // A unique ID associated with the cluster for registration purposes. - ActivationId *string - - // The cluster's cloud service provider. - Provider *string - - // The Amazon Resource Name (ARN) of the role to communicate with services from - // the connected Kubernetes cluster. - RoleArn *string - - noSmithyDocumentSerde -} - -// The placement configuration for all the control plane instances of your local -// Amazon EKS cluster on an Amazon Web Services Outpost. For more information, see [Capacity considerations] -// in the Amazon EKS User Guide. -// -// [Capacity considerations]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html -type ControlPlanePlacementRequest struct { - - // The name of the placement group for the Kubernetes control plane instances. - // This setting can't be changed after cluster creation. - GroupName *string - - noSmithyDocumentSerde -} - -// The placement configuration for all the control plane instances of your local -// Amazon EKS cluster on an Amazon Web Services Outpost. For more information, see [Capacity considerations] -// in the Amazon EKS User Guide. -// -// [Capacity considerations]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html -type ControlPlanePlacementResponse struct { - - // The name of the placement group for the Kubernetes control plane instances. - GroupName *string - - noSmithyDocumentSerde -} - -// The control plane scaling tier configuration. For more information, see EKS -// Provisioned Control Plane in the Amazon EKS User Guide. -type ControlPlaneScalingConfig struct { - - // The control plane scaling tier configuration. Available options are standard , - // tier-xl , tier-2xl , or tier-4xl . For more information, see EKS Provisioned - // Control Plane in the Amazon EKS User Guide. - Tier ProvisionedControlPlaneTier - - noSmithyDocumentSerde -} - -// The access configuration information for the cluster. -type CreateAccessConfigRequest struct { - - // The desired authentication mode for the cluster. If you create a cluster by - // using the EKS API, Amazon Web Services SDKs, or CloudFormation, the default is - // CONFIG_MAP . If you create the cluster by using the Amazon Web Services - // Management Console, the default value is API_AND_CONFIG_MAP . - AuthenticationMode AuthenticationMode - - // Specifies whether or not the cluster creator IAM principal was set as a cluster - // admin access entry during cluster creation time. The default value is true . - BootstrapClusterCreatorAdminPermissions *bool - - noSmithyDocumentSerde -} - -// The summary information about deprecated resource usage for an insight check in -// the UPGRADE_READINESS category. -type DeprecationDetail struct { - - // Details about Kubernetes clients using the deprecated resources. - ClientStats []ClientStat - - // The newer version of the resource to migrate to if applicable. - ReplacedWith *string - - // The version of the software where the newer resource version became available - // to migrate to if applicable. - StartServingReplacementVersion *string - - // The version of the software where the deprecated resource version will stop - // being served. - StopServingVersion *string - - // The deprecated version of the resource. - Usage *string - - noSmithyDocumentSerde -} - -// An EKS Anywhere subscription authorizing the customer to support for licensed -// clusters and access to EKS Anywhere Curated Packages. -type EksAnywhereSubscription struct { - - // The Amazon Resource Name (ARN) for the subscription. - Arn *string - - // A boolean indicating whether or not a subscription will auto renew when it - // expires. - AutoRenew bool - - // The Unix timestamp in seconds for when the subscription was created. - CreatedAt *time.Time - - // The Unix timestamp in seconds for when the subscription is effective. - EffectiveDate *time.Time - - // The Unix timestamp in seconds for when the subscription will expire or auto - // renew, depending on the auto renew configuration of the subscription object. - ExpirationDate *time.Time - - // UUID identifying a subscription. - Id *string - - // Amazon Web Services License Manager ARN associated with the subscription. - LicenseArns []string - - // The number of licenses included in a subscription. Valid values are between 1 - // and 100. - LicenseQuantity int32 - - // The type of licenses included in the subscription. Valid value is CLUSTER. With - // the CLUSTER license type, each license covers support for a single EKS Anywhere - // cluster. - LicenseType EksAnywhereSubscriptionLicenseType - - // Includes all of the claims in the license token necessary to validate the - // license for extended support. - Licenses []License - - // The status of a subscription. - Status *string - - // The metadata for a subscription to assist with categorization and organization. - // Each tag consists of a key and an optional value. Subscription tags do not - // propagate to any other resources associated with the subscription. - Tags map[string]string - - // An EksAnywhereSubscriptionTerm object. - Term *EksAnywhereSubscriptionTerm - - noSmithyDocumentSerde -} - -// An object representing the term duration and term unit type of your -// subscription. This determines the term length of your subscription. Valid values -// are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month -// or 36 month subscription. -type EksAnywhereSubscriptionTerm struct { - - // The duration of the subscription term. Valid values are 12 and 36, indicating a - // 12 month or 36 month subscription. - Duration int32 - - // The term unit of the subscription. Valid value is MONTHS . - Unit EksAnywhereSubscriptionTermUnit - - noSmithyDocumentSerde -} - -// Indicates the current configuration of the load balancing capability on your -// EKS Auto Mode cluster. For example, if the capability is enabled or disabled. -// For more information, see EKS Auto Mode load balancing capability in the Amazon -// EKS User Guide. -type ElasticLoadBalancing struct { - - // Indicates if the load balancing capability is enabled on your EKS Auto Mode - // cluster. If the load balancing capability is enabled, EKS Auto Mode will create - // and delete load balancers in your Amazon Web Services account. - Enabled *bool - - noSmithyDocumentSerde -} - -// The encryption configuration for the cluster. -type EncryptionConfig struct { - - // Key Management Service (KMS) key. Either the ARN or the alias can be used. - Provider *Provider - - // Specifies the resources to be encrypted. The only supported value is secrets . - Resources []string - - noSmithyDocumentSerde -} - -// An object representing an error when an asynchronous operation fails. -type ErrorDetail struct { - - // A brief description of the error. - // - // - SubnetNotFound: We couldn't find one of the subnets associated with the - // cluster. - // - // - SecurityGroupNotFound: We couldn't find one of the security groups - // associated with the cluster. - // - // - EniLimitReached: You have reached the elastic network interface limit for - // your account. - // - // - IpNotAvailable: A subnet associated with the cluster doesn't have any - // available IP addresses. - // - // - AccessDenied: You don't have permissions to perform the specified operation. - // - // - OperationNotPermitted: The service role associated with the cluster doesn't - // have the required access permissions for Amazon EKS. - // - // - VpcIdNotFound: We couldn't find the VPC associated with the cluster. - ErrorCode ErrorCode - - // A more complete description of the error. - ErrorMessage *string - - // An optional field that contains the resource IDs associated with the error. - ResourceIds []string - - noSmithyDocumentSerde -} - -// An object representing an Fargate profile. -type FargateProfile struct { - - // The name of your cluster. - ClusterName *string - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // The full Amazon Resource Name (ARN) of the Fargate profile. - FargateProfileArn *string - - // The name of the Fargate profile. - FargateProfileName *string - - // The health status of the Fargate profile. If there are issues with your Fargate - // profile's health, they are listed here. - Health *FargateProfileHealth - - // The Amazon Resource Name (ARN) of the Pod execution role to use for any Pod - // that matches the selectors in the Fargate profile. For more information, see [Pod execution role]Pod - // in the Amazon EKS User Guide. - // - // [Pod execution role]: https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html - PodExecutionRoleArn *string - - // The selectors to match for a Pod to use this Fargate profile. - Selectors []FargateProfileSelector - - // The current status of the Fargate profile. - Status FargateProfileStatus - - // The IDs of subnets to launch a Pod into. - Subnets []string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - noSmithyDocumentSerde -} - -// The health status of the Fargate profile. If there are issues with your Fargate -// profile's health, they are listed here. -type FargateProfileHealth struct { - - // Any issues that are associated with the Fargate profile. - Issues []FargateProfileIssue - - noSmithyDocumentSerde -} - -// An issue that is associated with the Fargate profile. -type FargateProfileIssue struct { - - // A brief description of the error. - Code FargateProfileIssueCode - - // The error message associated with the issue. - Message *string - - // The Amazon Web Services resources that are affected by this issue. - ResourceIds []string - - noSmithyDocumentSerde -} - -// An object representing an Fargate profile selector. -type FargateProfileSelector struct { - - // The Kubernetes labels that the selector should match. A pod must contain all of - // the labels that are specified in the selector for it to be considered a match. - Labels map[string]string - - // The Kubernetes namespace that the selector should match. - Namespace *string - - noSmithyDocumentSerde -} - -// An object representing an identity provider. -type Identity struct { - - // An object representing the [OpenID Connect] identity provider information. - // - // [OpenID Connect]: https://openid.net/connect/ - Oidc *OIDC - - noSmithyDocumentSerde -} - -// An object representing an identity provider configuration. -type IdentityProviderConfig struct { - - // The name of the identity provider configuration. - // - // This member is required. - Name *string - - // The type of the identity provider configuration. The only type available is oidc - // . - // - // This member is required. - Type *string - - noSmithyDocumentSerde -} - -// The full description of your identity configuration. -type IdentityProviderConfigResponse struct { - - // An object representing an OpenID Connect (OIDC) identity provider configuration. - Oidc *OidcIdentityProviderConfig - - noSmithyDocumentSerde -} - -// A check that provides recommendations to remedy potential upgrade-impacting -// issues. -type Insight struct { - - // Links to sources that provide additional context on the insight. - AdditionalInfo map[string]string - - // The category of the insight. - Category Category - - // Summary information that relates to the category of the insight. Currently only - // returned with certain insights having category UPGRADE_READINESS . - CategorySpecificSummary *InsightCategorySpecificSummary - - // The description of the insight which includes alert criteria, remediation - // recommendation, and additional resources (contains Markdown). - Description *string - - // The ID of the insight. - Id *string - - // An object containing more detail on the status of the insight resource. - InsightStatus *InsightStatus - - // The Kubernetes minor version associated with an insight if applicable. - KubernetesVersion *string - - // The time Amazon EKS last successfully completed a refresh of this insight check - // on the cluster. - LastRefreshTime *time.Time - - // The time the status of the insight last changed. - LastTransitionTime *time.Time - - // The name of the insight. - Name *string - - // A summary of how to remediate the finding of this insight if applicable. - Recommendation *string - - // The details about each resource listed in the insight check result. - Resources []InsightResourceDetail - - noSmithyDocumentSerde -} - -// Summary information that relates to the category of the insight. Currently only -// returned with certain insights having category UPGRADE_READINESS . -type InsightCategorySpecificSummary struct { - - // A list of AddonCompatibilityDetail objects for Amazon EKS add-ons. - AddonCompatibilityDetails []AddonCompatibilityDetail - - // The summary information about deprecated resource usage for an insight check in - // the UPGRADE_READINESS category. - DeprecationDetails []DeprecationDetail - - noSmithyDocumentSerde -} - -// Returns information about the resource being evaluated. -type InsightResourceDetail struct { - - // The Amazon Resource Name (ARN) if applicable. - Arn *string - - // An object containing more detail on the status of the insight resource. - InsightStatus *InsightStatus - - // The Kubernetes resource URI if applicable. - KubernetesResourceUri *string - - noSmithyDocumentSerde -} - -// The criteria to use for the insights. -type InsightsFilter struct { - - // The categories to use to filter insights. The following lists the available - // categories: - // - // - UPGRADE_READINESS : Amazon EKS identifies issues that could impact your - // ability to upgrade to new versions of Kubernetes. These are called upgrade - // insights. - // - // - MISCONFIGURATION : Amazon EKS identifies misconfiguration in your EKS Hybrid - // Nodes setup that could impair functionality of your cluster or workloads. These - // are called configuration insights. - Categories []Category - - // The Kubernetes versions to use to filter the insights. - KubernetesVersions []string - - // The statuses to use to filter the insights. - Statuses []InsightStatusValue - - noSmithyDocumentSerde -} - -// The status of the insight. -type InsightStatus struct { - - // Explanation on the reasoning for the status of the resource. - Reason *string - - // The status of the resource. - Status InsightStatusValue - - noSmithyDocumentSerde -} - -// The summarized description of the insight. -type InsightSummary struct { - - // The category of the insight. - Category Category - - // The description of the insight which includes alert criteria, remediation - // recommendation, and additional resources (contains Markdown). - Description *string - - // The ID of the insight. - Id *string - - // An object containing more detail on the status of the insight. - InsightStatus *InsightStatus - - // The Kubernetes minor version associated with an insight if applicable. - KubernetesVersion *string - - // The time Amazon EKS last successfully completed a refresh of this insight check - // on the cluster. - LastRefreshTime *time.Time - - // The time the status of the insight last changed. - LastTransitionTime *time.Time - - // The name of the insight. - Name *string - - noSmithyDocumentSerde -} - -// An object representing an issue with an Amazon EKS resource. -type Issue struct { - - // A brief description of the error. - // - // - AccessDenied: Amazon EKS or one or more of your managed nodes is failing to - // authenticate or authorize with your Kubernetes cluster API server. - // - // - AsgInstanceLaunchFailures: Your Auto Scaling group is experiencing failures - // while attempting to launch instances. - // - // - AutoScalingGroupNotFound: We couldn't find the Auto Scaling group - // associated with the managed node group. You may be able to recreate an Auto - // Scaling group with the same settings to recover. - // - // - ClusterUnreachable: Amazon EKS or one or more of your managed nodes is - // unable to to communicate with your Kubernetes cluster API server. This can - // happen if there are network disruptions or if API servers are timing out - // processing requests. - // - // - Ec2InstanceTypeDoesNotExist: One or more of the supplied Amazon EC2 - // instance types do not exist. Amazon EKS checked for the instance types that you - // provided in this Amazon Web Services Region, and one or more aren't available. - // - // - Ec2LaunchTemplateNotFound: We couldn't find the Amazon EC2 launch template - // for your managed node group. You may be able to recreate a launch template with - // the same settings to recover. - // - // - Ec2LaunchTemplateVersionMismatch: The Amazon EC2 launch template version - // for your managed node group does not match the version that Amazon EKS created. - // You may be able to revert to the version that Amazon EKS created to recover. - // - // - Ec2SecurityGroupDeletionFailure: We could not delete the remote access - // security group for your managed node group. Remove any dependencies from the - // security group. - // - // - Ec2SecurityGroupNotFound: We couldn't find the cluster security group for - // the cluster. You must recreate your cluster. - // - // - Ec2SubnetInvalidConfiguration: One or more Amazon EC2 subnets specified for - // a node group do not automatically assign public IP addresses to instances - // launched into it. If you want your instances to be assigned a public IP address, - // then you need to enable the auto-assign public IP address setting for the - // subnet. See [Modifying the public IPv4 addressing attribute for your subnet]IPv4 in the Amazon VPC User Guide. - // - // - IamInstanceProfileNotFound: We couldn't find the IAM instance profile for - // your managed node group. You may be able to recreate an instance profile with - // the same settings to recover. - // - // - IamNodeRoleNotFound: We couldn't find the IAM role for your managed node - // group. You may be able to recreate an IAM role with the same settings to - // recover. - // - // - InstanceLimitExceeded: Your Amazon Web Services account is unable to launch - // any more instances of the specified instance type. You may be able to request an - // Amazon EC2 instance limit increase to recover. - // - // - InsufficientFreeAddresses: One or more of the subnets associated with your - // managed node group does not have enough available IP addresses for new nodes. - // - // - InternalFailure: These errors are usually caused by an Amazon EKS - // server-side issue. - // - // - NodeCreationFailure: Your launched instances are unable to register with - // your Amazon EKS cluster. Common causes of this failure are insufficient [node IAM role] - // permissions or lack of outbound internet access for the nodes. - // - // [Modifying the public IPv4 addressing attribute for your subnet]: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip - // [node IAM role]: https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html - Code NodegroupIssueCode - - // The error message associated with the issue. - Message *string - - // The Amazon Web Services resources that are afflicted by this issue. - ResourceIds []string - - noSmithyDocumentSerde -} - -// The Kubernetes network configuration for the cluster. -type KubernetesNetworkConfigRequest struct { - - // Request to enable or disable the load balancing capability on your EKS Auto - // Mode cluster. For more information, see EKS Auto Mode load balancing capability - // in the Amazon EKS User Guide. - ElasticLoadBalancing *ElasticLoadBalancing - - // Specify which IP family is used to assign Kubernetes pod and service IP - // addresses. If you don't specify a value, ipv4 is used by default. You can only - // specify an IP family when you create a cluster and can't change this value once - // the cluster is created. If you specify ipv6 , the VPC and subnets that you - // specify for cluster creation must have both IPv4 and IPv6 CIDR blocks assigned - // to them. You can't specify ipv6 for clusters in China Regions. - // - // You can only specify ipv6 for 1.21 and later clusters that use version 1.10.1 - // or later of the Amazon VPC CNI add-on. If you specify ipv6 , then ensure that - // your VPC meets the requirements listed in the considerations listed in [Assigning IPv6 addresses to pods and services]in the - // Amazon EKS User Guide. Kubernetes assigns services IPv6 addresses from the - // unique local address range (fc00::/7) . You can't specify a custom IPv6 CIDR - // block. Pod addresses are assigned from the subnet's IPv6 CIDR. - // - // [Assigning IPv6 addresses to pods and services]: https://docs.aws.amazon.com/eks/latest/userguide/cni-ipv6.html - IpFamily IpFamily - - // Don't specify a value if you select ipv6 for ipFamily. The CIDR block to assign - // Kubernetes service IP addresses from. If you don't specify a block, Kubernetes - // assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks. - // We recommend that you specify a block that does not overlap with resources in - // other networks that are peered or connected to your VPC. The block must meet the - // following requirements: - // - // - Within one of the following private IP address blocks: 10.0.0.0/8 , - // 172.16.0.0/12 , or 192.168.0.0/16 . - // - // - Doesn't overlap with any CIDR block assigned to the VPC that you selected - // for VPC. - // - // - Between /24 and /12 . - // - // You can only specify a custom CIDR block when you create a cluster. You can't - // change this value after the cluster is created. - ServiceIpv4Cidr *string - - noSmithyDocumentSerde -} - -// The Kubernetes network configuration for the cluster. The response contains a -// value for serviceIpv6Cidr or serviceIpv4Cidr, but not both. -type KubernetesNetworkConfigResponse struct { - - // Indicates the current configuration of the load balancing capability on your - // EKS Auto Mode cluster. For example, if the capability is enabled or disabled. - ElasticLoadBalancing *ElasticLoadBalancing - - // The IP family used to assign Kubernetes Pod and Service objects IP addresses. - // The IP family is always ipv4 , unless you have a 1.21 or later cluster running - // version 1.10.1 or later of the Amazon VPC CNI plugin for Kubernetes and - // specified ipv6 when you created the cluster. - IpFamily IpFamily - - // The CIDR block that Kubernetes Pod and Service object IP addresses are assigned - // from. Kubernetes assigns addresses from an IPv4 CIDR block assigned to a subnet - // that the node is in. If you didn't specify a CIDR block when you created the - // cluster, then Kubernetes assigns addresses from either the 10.100.0.0/16 or - // 172.20.0.0/16 CIDR blocks. If this was specified, then it was specified when the - // cluster was created and it can't be changed. - ServiceIpv4Cidr *string - - // The CIDR block that Kubernetes pod and service IP addresses are assigned from - // if you created a 1.21 or later cluster with version 1.10.1 or later of the - // Amazon VPC CNI add-on and specified ipv6 for ipFamily when you created the - // cluster. Kubernetes assigns service addresses from the unique local address - // range ( fc00::/7 ) because you can't specify a custom IPv6 CIDR block when you - // create the cluster. - ServiceIpv6Cidr *string - - noSmithyDocumentSerde -} - -// An object representing a node group launch template specification. The launch -// template can't include [SubnetId]SubnetId , [IamInstanceProfile]IamInstanceProfile , [RequestSpotInstances]RequestSpotInstances , [HibernationOptions] -// HibernationOptions , or [TerminateInstances]TerminateInstances , or the node group deployment or -// update will fail. For more information about launch templates, see [CreateLaunchTemplate] -// CreateLaunchTemplate in the Amazon EC2 API Reference. For more information about -// using launch templates with Amazon EKS, see [Customizing managed nodes with launch templates]in the Amazon EKS User Guide. -// -// You must specify either the launch template ID or the launch template name in -// the request, but not both. -// -// [HibernationOptions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html -// [Customizing managed nodes with launch templates]: https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html -// [CreateLaunchTemplate]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html -// [RequestSpotInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html -// [IamInstanceProfile]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html -// [SubnetId]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html -// [TerminateInstances]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TerminateInstances.html -type LaunchTemplateSpecification struct { - - // The ID of the launch template. - // - // You must specify either the launch template ID or the launch template name in - // the request, but not both. After node group creation, you cannot use a different - // ID. - Id *string - - // The name of the launch template. - // - // You must specify either the launch template name or the launch template ID in - // the request, but not both. After node group creation, you cannot use a different - // name. - Name *string - - // The version number of the launch template to use. If no version is specified, - // then the template's default version is used. You can use a different version for - // node group updates. - Version *string - - noSmithyDocumentSerde -} - -// An EKS Anywhere license associated with a subscription. -type License struct { - - // An id associated with an EKS Anywhere subscription license. - Id *string - - // An optional license token that can be used for extended support verification. - Token *string - - noSmithyDocumentSerde -} - -// An object representing the logging configuration for resources in your cluster. -type Logging struct { - - // The cluster control plane logging configuration for your cluster. - ClusterLogging []LogSetup - - noSmithyDocumentSerde -} - -// An object representing the enabled or disabled Kubernetes control plane logs -// for your cluster. -type LogSetup struct { - - // If a log type is enabled, that log type exports its control plane logs to - // CloudWatch Logs . If a log type isn't enabled, that log type doesn't export its - // control plane logs. Each individual log type can be enabled or disabled - // independently. - Enabled *bool - - // The available cluster control plane log types. - Types []LogType - - noSmithyDocumentSerde -} - -// Information about an Amazon EKS add-on from the Amazon Web Services Marketplace. -type MarketplaceInformation struct { - - // The product ID from the Amazon Web Services Marketplace. - ProductId *string - - // The product URL from the Amazon Web Services Marketplace. - ProductUrl *string - - noSmithyDocumentSerde -} - -// An object representing an Amazon EKS managed node group. -type Nodegroup struct { - - // If the node group was deployed using a launch template with a custom AMI, then - // this is CUSTOM . For node groups that weren't deployed using a launch template, - // this is the AMI type that was specified in the node group configuration. - AmiType AMITypes - - // The capacity type of your managed node group. - CapacityType CapacityTypes - - // The name of your cluster. - ClusterName *string - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // If the node group wasn't deployed with a launch template, then this is the disk - // size in the node group configuration. If the node group was deployed with a - // launch template, then this is null . - DiskSize *int32 - - // The health status of the node group. If there are issues with your node group's - // health, they are listed here. - Health *NodegroupHealth - - // If the node group wasn't deployed with a launch template, then this is the - // instance type that is associated with the node group. If the node group was - // deployed with a launch template, then this is null . - InstanceTypes []string - - // The Kubernetes labels applied to the nodes in the node group. - // - // Only labels that are applied with the Amazon EKS API are shown here. There may - // be other Kubernetes labels applied to the nodes in this group. - Labels map[string]string - - // If a launch template was used to create the node group, then this is the launch - // template that was used. - LaunchTemplate *LaunchTemplateSpecification - - // The Unix epoch timestamp for the last modification to the object. - ModifiedAt *time.Time - - // The node auto repair configuration for the node group. - NodeRepairConfig *NodeRepairConfig - - // The IAM role associated with your node group. The Amazon EKS node kubelet - // daemon makes calls to Amazon Web Services APIs on your behalf. Nodes receive - // permissions for these API calls through an IAM instance profile and associated - // policies. - NodeRole *string - - // The Amazon Resource Name (ARN) associated with the managed node group. - NodegroupArn *string - - // The name associated with an Amazon EKS managed node group. - NodegroupName *string - - // If the node group was deployed using a launch template with a custom AMI, then - // this is the AMI ID that was specified in the launch template. For node groups - // that weren't deployed using a launch template, this is the version of the Amazon - // EKS optimized AMI that the node group was deployed with. - ReleaseVersion *string - - // If the node group wasn't deployed with a launch template, then this is the - // remote access configuration that is associated with the node group. If the node - // group was deployed with a launch template, then this is null . - RemoteAccess *RemoteAccessConfig - - // The resources associated with the node group, such as Auto Scaling groups and - // security groups for remote access. - Resources *NodegroupResources - - // The scaling configuration details for the Auto Scaling group that is associated - // with your node group. - ScalingConfig *NodegroupScalingConfig - - // The current status of the managed node group. - Status NodegroupStatus - - // The subnets that were specified for the Auto Scaling group that is associated - // with your node group. - Subnets []string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // The Kubernetes taints to be applied to the nodes in the node group when they - // are created. Effect is one of No_Schedule , Prefer_No_Schedule , or No_Execute . - // Kubernetes taints can be used together with tolerations to control how workloads - // are scheduled to your nodes. For more information, see [Node taints on managed node groups]. - // - // [Node taints on managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/node-taints-managed-node-groups.html - Taints []Taint - - // The node group update configuration. - UpdateConfig *NodegroupUpdateConfig - - // The Kubernetes version of the managed node group. - Version *string - - noSmithyDocumentSerde -} - -// An object representing the health status of the node group. -type NodegroupHealth struct { - - // Any issues that are associated with the node group. - Issues []Issue - - noSmithyDocumentSerde -} - -// An object representing the resources associated with the node group, such as -// Auto Scaling groups and security groups for remote access. -type NodegroupResources struct { - - // The Auto Scaling groups associated with the node group. - AutoScalingGroups []AutoScalingGroup - - // The remote access security group associated with the node group. This security - // group controls SSH access to the nodes. - RemoteAccessSecurityGroup *string - - noSmithyDocumentSerde -} - -// An object representing the scaling configuration details for the Auto Scaling -// group that is associated with your node group. When creating a node group, you -// must specify all or none of the properties. When updating a node group, you can -// specify any or none of the properties. -type NodegroupScalingConfig struct { - - // The current number of nodes that the managed node group should maintain. - // - // If you use the Kubernetes [Cluster Autoscaler], you shouldn't change the desiredSize value - // directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale - // down. - // - // Whenever this parameter changes, the number of worker nodes in the node group - // is updated to the specified size. If this parameter is given a value that is - // smaller than the current number of running worker nodes, the necessary number of - // worker nodes are terminated to match the given value. - // - // When using CloudFormation, no action occurs if you remove this parameter from - // your CFN template. - // - // This parameter can be different from minSize in some cases, such as when - // starting with extra hosts for testing. This parameter can also be different when - // you want to start with an estimated number of needed hosts, but let the Cluster - // Autoscaler reduce the number if there are too many. When the Cluster Autoscaler - // is used, the desiredSize parameter is altered by the Cluster Autoscaler (but - // can be out-of-date for short periods of time). the Cluster Autoscaler doesn't - // scale a managed node group lower than minSize or higher than maxSize . - // - // [Cluster Autoscaler]: https://github.com/kubernetes/autoscaler#kubernetes-autoscaler - DesiredSize *int32 - - // The maximum number of nodes that the managed node group can scale out to. For - // information about the maximum number that you can specify, see [Amazon EKS service quotas]in the Amazon - // EKS User Guide. - // - // [Amazon EKS service quotas]: https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html - MaxSize *int32 - - // The minimum number of nodes that the managed node group can scale in to. - MinSize *int32 - - noSmithyDocumentSerde -} - -// The node group update configuration. An Amazon EKS managed node group updates -// by replacing nodes with new nodes of newer AMI versions in parallel. You choose -// the maximum unavailable and the update strategy. -type NodegroupUpdateConfig struct { - - // The maximum number of nodes unavailable at once during a version update. Nodes - // are updated in parallel. This value or maxUnavailablePercentage is required to - // have a value.The maximum number is 100. - MaxUnavailable *int32 - - // The maximum percentage of nodes unavailable during a version update. This - // percentage of nodes are updated in parallel, up to 100 nodes at once. This value - // or maxUnavailable is required to have a value. - MaxUnavailablePercentage *int32 - - // The configuration for the behavior to follow during a node group version update - // of this managed node group. You choose between two possible strategies for - // replacing nodes during an [UpdateNodegroupVersion]UpdateNodegroupVersion action. - // - // An Amazon EKS managed node group updates by replacing nodes with new nodes of - // newer AMI versions in parallel. The update strategy changes the managed node - // update behavior of the managed node group for each quantity. The default - // strategy has guardrails to protect you from misconfiguration and launches the - // new instances first, before terminating the old instances. The minimal strategy - // removes the guardrails and terminates the old instances before launching the new - // instances. This minimal strategy is useful in scenarios where you are - // constrained to resources or costs (for example, with hardware accelerators such - // as GPUs). - // - // [UpdateNodegroupVersion]: https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateNodegroupVersion.html - UpdateStrategy NodegroupUpdateStrategies - - noSmithyDocumentSerde -} - -// The node auto repair configuration for the node group. -type NodeRepairConfig struct { - - // Specifies whether to enable node auto repair for the node group. Node auto - // repair is disabled by default. - Enabled *bool - - // Specify the maximum number of nodes that can be repaired concurrently or in - // parallel, expressed as a count of unhealthy nodes. This gives you finer-grained - // control over the pace of node replacements. When using this, you cannot also set - // maxParallelNodesRepairedPercentage at the same time. - MaxParallelNodesRepairedCount *int32 - - // Specify the maximum number of nodes that can be repaired concurrently or in - // parallel, expressed as a percentage of unhealthy nodes. This gives you - // finer-grained control over the pace of node replacements. When using this, you - // cannot also set maxParallelNodesRepairedCount at the same time. - MaxParallelNodesRepairedPercentage *int32 - - // Specify a count threshold of unhealthy nodes, above which node auto repair - // actions will stop. When using this, you cannot also set - // maxUnhealthyNodeThresholdPercentage at the same time. - MaxUnhealthyNodeThresholdCount *int32 - - // Specify a percentage threshold of unhealthy nodes, above which node auto repair - // actions will stop. When using this, you cannot also set - // maxUnhealthyNodeThresholdCount at the same time. - MaxUnhealthyNodeThresholdPercentage *int32 - - // Specify granular overrides for specific repair actions. These overrides control - // the repair action and the repair delay time before a node is considered eligible - // for repair. If you use this, you must specify all the values. - NodeRepairConfigOverrides []NodeRepairConfigOverrides - - noSmithyDocumentSerde -} - -// Specify granular overrides for specific repair actions. These overrides control -// the repair action and the repair delay time before a node is considered eligible -// for repair. If you use this, you must specify all the values. -type NodeRepairConfigOverrides struct { - - // Specify the minimum time in minutes to wait before attempting to repair a node - // with this specific nodeMonitoringCondition and nodeUnhealthyReason . - MinRepairWaitTimeMins *int32 - - // Specify an unhealthy condition reported by the node monitoring agent that this - // override would apply to. - NodeMonitoringCondition *string - - // Specify a reason reported by the node monitoring agent that this override would - // apply to. - NodeUnhealthyReason *string - - // Specify the repair action to take for nodes when all of the specified - // conditions are met. - RepairAction RepairAction - - noSmithyDocumentSerde -} - -// An object representing the [OpenID Connect] (OIDC) identity provider information for the -// cluster. -// -// [OpenID Connect]: https://openid.net/connect/ -type OIDC struct { - - // The issuer URL for the OIDC identity provider. - Issuer *string - - noSmithyDocumentSerde -} - -// An object representing the configuration for an OpenID Connect (OIDC) identity -// provider. -type OidcIdentityProviderConfig struct { - - // This is also known as audience. The ID of the client application that makes - // authentication requests to the OIDC identity provider. - ClientId *string - - // The name of your cluster. - ClusterName *string - - // The JSON web token (JWT) claim that the provider uses to return your groups. - GroupsClaim *string - - // The prefix that is prepended to group claims to prevent clashes with existing - // names (such as system: groups). For example, the value oidc: creates group - // names like oidc:engineering and oidc:infra . The prefix can't contain system: - GroupsPrefix *string - - // The ARN of the configuration. - IdentityProviderConfigArn *string - - // The name of the configuration. - IdentityProviderConfigName *string - - // The URL of the OIDC identity provider that allows the API server to discover - // public signing keys for verifying tokens. - IssuerUrl *string - - // The key-value pairs that describe required claims in the identity token. If - // set, each claim is verified to be present in the token with a matching value. - RequiredClaims map[string]string - - // The status of the OIDC identity provider. - Status ConfigStatus - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - Tags map[string]string - - // The JSON Web token (JWT) claim that is used as the username. - UsernameClaim *string - - // The prefix that is prepended to username claims to prevent clashes with - // existing names. The prefix can't contain system: - UsernamePrefix *string - - noSmithyDocumentSerde -} - -// An object representing an OpenID Connect (OIDC) configuration. Before -// associating an OIDC identity provider to your cluster, review the considerations -// in [Authenticating users for your cluster from an OIDC identity provider]in the Amazon EKS User Guide. -// -// [Authenticating users for your cluster from an OIDC identity provider]: https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html -type OidcIdentityProviderConfigRequest struct { - - // This is also known as audience. The ID for the client application that makes - // authentication requests to the OIDC identity provider. - // - // This member is required. - ClientId *string - - // The name of the OIDC provider configuration. - // - // This member is required. - IdentityProviderConfigName *string - - // The URL of the OIDC identity provider that allows the API server to discover - // public signing keys for verifying tokens. The URL must begin with https:// and - // should correspond to the iss claim in the provider's OIDC ID tokens. Based on - // the OIDC standard, path components are allowed but query parameters are not. - // Typically the URL consists of only a hostname, like https://server.example.org - // or https://example.com . This URL should point to the level below - // .well-known/openid-configuration and must be publicly accessible over the - // internet. - // - // This member is required. - IssuerUrl *string - - // The JWT claim that the provider uses to return your groups. - GroupsClaim *string - - // The prefix that is prepended to group claims to prevent clashes with existing - // names (such as system: groups). For example, the value oidc: will create group - // names like oidc:engineering and oidc:infra . - GroupsPrefix *string - - // The key value pairs that describe required claims in the identity token. If - // set, each claim is verified to be present in the token with a matching value. - // For the maximum number of claims that you can require, see [Amazon EKS service quotas]in the Amazon EKS - // User Guide. - // - // [Amazon EKS service quotas]: https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html - RequiredClaims map[string]string - - // The JSON Web Token (JWT) claim to use as the username. The default is sub , - // which is expected to be a unique identifier of the end user. You can choose - // other claims, such as email or name , depending on the OIDC identity provider. - // Claims other than email are prefixed with the issuer URL to prevent naming - // clashes with other plug-ins. - UsernameClaim *string - - // The prefix that is prepended to username claims to prevent clashes with - // existing names. If you do not provide this field, and username is a value other - // than email , the prefix defaults to issuerurl# . You can use the value - to - // disable all prefixing. - UsernamePrefix *string - - noSmithyDocumentSerde -} - -// The configuration of your local Amazon EKS cluster on an Amazon Web Services -// Outpost. Before creating a cluster on an Outpost, review [Creating a local cluster on an Outpost]in the Amazon EKS User -// Guide. This API isn't available for Amazon EKS clusters on the Amazon Web -// Services cloud. -// -// [Creating a local cluster on an Outpost]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-local-cluster-create.html -type OutpostConfigRequest struct { - - // The Amazon EC2 instance type that you want to use for your local Amazon EKS - // cluster on Outposts. Choose an instance type based on the number of nodes that - // your cluster will have. For more information, see [Capacity considerations]in the Amazon EKS User Guide. - // - // The instance type that you specify is used for all Kubernetes control plane - // instances. The instance type can't be changed after cluster creation. The - // control plane is not automatically scaled by Amazon EKS. - // - // [Capacity considerations]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html - // - // This member is required. - ControlPlaneInstanceType *string - - // The ARN of the Outpost that you want to use for your local Amazon EKS cluster - // on Outposts. Only a single Outpost ARN is supported. - // - // This member is required. - OutpostArns []string - - // An object representing the placement configuration for all the control plane - // instances of your local Amazon EKS cluster on an Amazon Web Services Outpost. - // For more information, see [Capacity considerations]in the Amazon EKS User Guide. - // - // [Capacity considerations]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html - ControlPlanePlacement *ControlPlanePlacementRequest - - noSmithyDocumentSerde -} - -// An object representing the configuration of your local Amazon EKS cluster on an -// Amazon Web Services Outpost. This API isn't available for Amazon EKS clusters on -// the Amazon Web Services cloud. -type OutpostConfigResponse struct { - - // The Amazon EC2 instance type used for the control plane. The instance type is - // the same for all control plane instances. - // - // This member is required. - ControlPlaneInstanceType *string - - // The ARN of the Outpost that you specified for use with your local Amazon EKS - // cluster on Outposts. - // - // This member is required. - OutpostArns []string - - // An object representing the placement configuration for all the control plane - // instances of your local Amazon EKS cluster on an Amazon Web Services Outpost. - // For more information, see [Capacity considerations]in the Amazon EKS User Guide. - // - // [Capacity considerations]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html - ControlPlanePlacement *ControlPlanePlacementResponse - - noSmithyDocumentSerde -} - -// Amazon EKS Pod Identity associations provide the ability to manage credentials -// for your applications, similar to the way that Amazon EC2 instance profiles -// provide credentials to Amazon EC2 instances. -type PodIdentityAssociation struct { - - // The Amazon Resource Name (ARN) of the association. - AssociationArn *string - - // The ID of the association. - AssociationId *string - - // The name of the cluster that the association is in. - ClusterName *string - - // The timestamp that the association was created at. - CreatedAt *time.Time - - // The state of the automatic sessions tags. The value of true disables these tags. - // - // EKS Pod Identity adds a pre-defined set of session tags when it assumes the - // role. You can use these tags to author a single role that can work across - // resources by allowing access to Amazon Web Services resources based on matching - // tags. By default, EKS Pod Identity attaches six tags, including tags for cluster - // name, namespace, and service account name. For the list of tags added by EKS Pod - // Identity, see [List of session tags added by EKS Pod Identity]in the Amazon EKS User Guide. - // - // [List of session tags added by EKS Pod Identity]: https://docs.aws.amazon.com/eks/latest/userguide/pod-id-abac.html#pod-id-abac-tags - DisableSessionTags *bool - - // The unique identifier for this EKS Pod Identity association for a target IAM - // role. You put this value in the trust policy of the target role, in a Condition - // to match the sts.ExternalId . This ensures that the target role can only be - // assumed by this association. This prevents the confused deputy problem. For more - // information about the confused deputy problem, see [The confused deputy problem]in the IAM User Guide. - // - // If you want to use the same target role with multiple associations or other - // roles, use independent statements in the trust policy to allow sts:AssumeRole - // access from each role. - // - // [The confused deputy problem]: https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html - ExternalId *string - - // The most recent timestamp that the association was modified at. - ModifiedAt *time.Time - - // The name of the Kubernetes namespace inside the cluster to create the - // association in. The service account and the Pods that use the service account - // must be in this namespace. - Namespace *string - - // If defined, the EKS Pod Identity association is owned by an Amazon EKS add-on. - OwnerArn *string - - // The Amazon Resource Name (ARN) of the IAM role to associate with the service - // account. The EKS Pod Identity agent manages credentials to assume this role for - // applications in the containers in the Pods that use this service account. - RoleArn *string - - // The name of the Kubernetes service account inside the cluster to associate the - // IAM credentials with. - ServiceAccount *string - - // Metadata that assists with categorization and organization. Each tag consists - // of a key and an optional value. You define both. Tags don't propagate to any - // other cluster or Amazon Web Services resources. - // - // The following basic restrictions apply to tags: - // - // - Maximum number of tags per resource – 50 - // - // - For each resource, each tag key must be unique, and each tag key can have - // only one value. - // - // - Maximum key length – 128 Unicode characters in UTF-8 - // - // - Maximum value length – 256 Unicode characters in UTF-8 - // - // - If your tagging schema is used across multiple services and resources, - // remember that other services may have restrictions on allowed characters. - // Generally allowed characters are: letters, numbers, and spaces representable in - // UTF-8, and the following characters: + - = . _ : / @. - // - // - Tag keys and values are case-sensitive. - // - // - Do not use aws: , AWS: , or any upper or lowercase combination of such as a - // prefix for either keys or values as it is reserved for Amazon Web Services use. - // You cannot edit or delete tag keys or values with this prefix. Tags with this - // prefix do not count against your tags per resource limit. - Tags map[string]string - - // The Amazon Resource Name (ARN) of the target IAM role to associate with the - // service account. This role is assumed by using the EKS Pod Identity association - // role, then the credentials for this role are injected into the Pod. - TargetRoleArn *string - - noSmithyDocumentSerde -} - -// The summarized description of the association. -// -// Each summary is simplified by removing these fields compared to the full [PodIdentityAssociation] -// PodIdentityAssociation : -// -// - The IAM role: roleArn -// -// - The timestamp that the association was created at: createdAt -// -// - The most recent timestamp that the association was modified at:. modifiedAt -// -// - The tags on the association: tags -// -// [PodIdentityAssociation]: https://docs.aws.amazon.com/eks/latest/APIReference/API_PodIdentityAssociation.html -type PodIdentityAssociationSummary struct { - - // The Amazon Resource Name (ARN) of the association. - AssociationArn *string - - // The ID of the association. - AssociationId *string - - // The name of the cluster that the association is in. - ClusterName *string - - // The name of the Kubernetes namespace inside the cluster to create the - // association in. The service account and the Pods that use the service account - // must be in this namespace. - Namespace *string - - // If defined, the association is owned by an Amazon EKS add-on. - OwnerArn *string - - // The name of the Kubernetes service account inside the cluster to associate the - // IAM credentials with. - ServiceAccount *string - - noSmithyDocumentSerde -} - -// Identifies the Key Management Service (KMS) key used to encrypt the secrets. -type Provider struct { - - // Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be - // symmetric and created in the same Amazon Web Services Region as the cluster. If - // the KMS key was created in a different account, the [IAM principal]must have access to the KMS - // key. For more information, see [Allowing users in other accounts to use a KMS key]in the Key Management Service Developer Guide. - // - // [IAM principal]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html - // [Allowing users in other accounts to use a KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html - KeyArn *string - - noSmithyDocumentSerde -} - -// An object representing the remote access configuration for the managed node -// group. -type RemoteAccessConfig struct { - - // The Amazon EC2 SSH key name that provides access for SSH communication with the - // nodes in the managed node group. For more information, see [Amazon EC2 key pairs and Linux instances]in the Amazon - // Elastic Compute Cloud User Guide for Linux Instances. For Windows, an Amazon EC2 - // SSH key is used to obtain the RDP password. For more information, see [Amazon EC2 key pairs and Windows instances]in the - // Amazon Elastic Compute Cloud User Guide for Windows Instances. - // - // [Amazon EC2 key pairs and Windows instances]: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-key-pairs.html - // [Amazon EC2 key pairs and Linux instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html - Ec2SshKey *string - - // The security group IDs that are allowed SSH access (port 22) to the nodes. For - // Windows, the port is 3389. If you specify an Amazon EC2 SSH key but don't - // specify a source security group when you create a managed node group, then the - // port on the nodes is opened to the internet ( 0.0.0.0/0 ). For more information, - // see [Security Groups for Your VPC]in the Amazon Virtual Private Cloud User Guide. - // - // [Security Groups for Your VPC]: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html - SourceSecurityGroups []string - - noSmithyDocumentSerde -} - -// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or -// remove this configuration after the cluster is created. -type RemoteNetworkConfigRequest struct { - - // The list of network CIDRs that can contain hybrid nodes. - // - // These CIDR blocks define the expected IP address range of the hybrid nodes that - // join the cluster. These blocks are typically determined by your network - // administrator. - // - // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for - // example, 10.2.0.0/16 ). - // - // It must satisfy the following requirements: - // - // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed - // size is /32, maximum allowed size is /8. Publicly-routable addresses aren't - // supported. - // - // - Each block cannot overlap with the range of the VPC CIDR blocks for your - // EKS resources, or the block of the Kubernetes service IP range. - // - // - Each block must have a route to the VPC that uses the VPC CIDR blocks, not - // public IPs or Elastic IPs. There are many options including Transit Gateway, - // Site-to-Site VPN, or Direct Connect. - // - // - Each host must allow outbound connection to the EKS cluster control plane - // on TCP ports 443 and 10250 . - // - // - Each host must allow inbound connection from the EKS cluster control plane - // on TCP port 10250 for logs, exec and port-forward operations. - // - // - Each host must allow TCP and UDP network connectivity to and from other - // hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. - RemoteNodeNetworks []RemoteNodeNetwork - - // The list of network CIDRs that can contain pods that run Kubernetes webhooks on - // hybrid nodes. - // - // These CIDR blocks are determined by configuring your Container Network - // Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the - // Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge - // locations. - // - // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for - // example, 10.2.0.0/16 ). - // - // It must satisfy the following requirements: - // - // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed - // size is /32, maximum allowed size is /8. Publicly-routable addresses aren't - // supported. - // - // - Each block cannot overlap with the range of the VPC CIDR blocks for your - // EKS resources, or the block of the Kubernetes service IP range. - RemotePodNetworks []RemotePodNetwork - - noSmithyDocumentSerde -} - -// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or -// remove this configuration after the cluster is created. -type RemoteNetworkConfigResponse struct { - - // The list of network CIDRs that can contain hybrid nodes. - RemoteNodeNetworks []RemoteNodeNetwork - - // The list of network CIDRs that can contain pods that run Kubernetes webhooks on - // hybrid nodes. - RemotePodNetworks []RemotePodNetwork - - noSmithyDocumentSerde -} - -// A network CIDR that can contain hybrid nodes. -// -// These CIDR blocks define the expected IP address range of the hybrid nodes that -// join the cluster. These blocks are typically determined by your network -// administrator. -// -// Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for -// example, 10.2.0.0/16 ). -// -// It must satisfy the following requirements: -// -// - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed -// size is /32, maximum allowed size is /8. Publicly-routable addresses aren't -// supported. -// -// - Each block cannot overlap with the range of the VPC CIDR blocks for your -// EKS resources, or the block of the Kubernetes service IP range. -// -// - Each block must have a route to the VPC that uses the VPC CIDR blocks, not -// public IPs or Elastic IPs. There are many options including Transit Gateway, -// Site-to-Site VPN, or Direct Connect. -// -// - Each host must allow outbound connection to the EKS cluster control plane -// on TCP ports 443 and 10250 . -// -// - Each host must allow inbound connection from the EKS cluster control plane -// on TCP port 10250 for logs, exec and port-forward operations. -// -// - Each host must allow TCP and UDP network connectivity to and from other -// hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. -type RemoteNodeNetwork struct { - - // A network CIDR that can contain hybrid nodes. - // - // These CIDR blocks define the expected IP address range of the hybrid nodes that - // join the cluster. These blocks are typically determined by your network - // administrator. - // - // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for - // example, 10.2.0.0/16 ). - // - // It must satisfy the following requirements: - // - // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed - // size is /32, maximum allowed size is /8. Publicly-routable addresses aren't - // supported. - // - // - Each block cannot overlap with the range of the VPC CIDR blocks for your - // EKS resources, or the block of the Kubernetes service IP range. - // - // - Each block must have a route to the VPC that uses the VPC CIDR blocks, not - // public IPs or Elastic IPs. There are many options including Transit Gateway, - // Site-to-Site VPN, or Direct Connect. - // - // - Each host must allow outbound connection to the EKS cluster control plane - // on TCP ports 443 and 10250 . - // - // - Each host must allow inbound connection from the EKS cluster control plane - // on TCP port 10250 for logs, exec and port-forward operations. - // - // - Each host must allow TCP and UDP network connectivity to and from other - // hosts that are running CoreDNS on UDP port 53 for service and pod DNS names. - Cidrs []string - - noSmithyDocumentSerde -} - -// A network CIDR that can contain pods that run Kubernetes webhooks on hybrid -// nodes. -// -// These CIDR blocks are determined by configuring your Container Network -// Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the -// Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge -// locations. -// -// Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for -// example, 10.2.0.0/16 ). -// -// It must satisfy the following requirements: -// -// - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed -// size is /32, maximum allowed size is /8. Publicly-routable addresses aren't -// supported. -// -// - Each block cannot overlap with the range of the VPC CIDR blocks for your -// EKS resources, or the block of the Kubernetes service IP range. -type RemotePodNetwork struct { - - // A network CIDR that can contain pods that run Kubernetes webhooks on hybrid - // nodes. - // - // These CIDR blocks are determined by configuring your Container Network - // Interface (CNI) plugin. We recommend the Calico CNI or Cilium CNI. Note that the - // Amazon VPC CNI plugin for Kubernetes isn't available for on-premises and edge - // locations. - // - // Enter one or more IPv4 CIDR blocks in decimal dotted-quad notation (for - // example, 10.2.0.0/16 ). - // - // It must satisfy the following requirements: - // - // - Each block must be within an IPv4 RFC-1918 network range. Minimum allowed - // size is /32, maximum allowed size is /8. Publicly-routable addresses aren't - // supported. - // - // - Each block cannot overlap with the range of the VPC CIDR blocks for your - // EKS resources, or the block of the Kubernetes service IP range. - Cidrs []string - - noSmithyDocumentSerde -} - -// An IAM Identity CenterIAM; Identity Center identity (user or group) that can be -// assigned permissions in a capability. -type SsoIdentity struct { - - // The unique identifier of the IAM Identity CenterIAM; Identity Center user or - // group. - // - // This member is required. - Id *string - - // The type of identity. Valid values are SSO_USER or SSO_GROUP . - // - // This member is required. - Type SsoIdentityType - - noSmithyDocumentSerde -} - -// Request to update the configuration of the storage capability of your EKS Auto -// Mode cluster. For example, enable the capability. For more information, see EKS -// Auto Mode block storage capability in the Amazon EKS User Guide. -type StorageConfigRequest struct { - - // Request to configure EBS Block Storage settings for your EKS Auto Mode cluster. - BlockStorage *BlockStorage - - noSmithyDocumentSerde -} - -// Indicates the status of the request to update the block storage capability of -// your EKS Auto Mode cluster. -type StorageConfigResponse struct { - - // Indicates the current configuration of the block storage capability on your EKS - // Auto Mode cluster. For example, if the capability is enabled or disabled. - BlockStorage *BlockStorage - - noSmithyDocumentSerde -} - -// A property that allows a node to repel a Pod . For more information, see [Node taints on managed node groups] in -// the Amazon EKS User Guide. -// -// [Node taints on managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/node-taints-managed-node-groups.html -type Taint struct { - - // The effect of the taint. - Effect TaintEffect - - // The key of the taint. - Key *string - - // The value of the taint. - Value *string - - noSmithyDocumentSerde -} - -// An object representing an asynchronous update. -type Update struct { - - // The Unix epoch timestamp at object creation. - CreatedAt *time.Time - - // Any errors associated with a Failed update. - Errors []ErrorDetail - - // A UUID that is used to track the update. - Id *string - - // A key-value map that contains the parameters associated with the update. - Params []UpdateParam - - // The current status of the update. - Status UpdateStatus - - // The type of the update. - Type UpdateType - - noSmithyDocumentSerde -} - -// The access configuration information for the cluster. -type UpdateAccessConfigRequest struct { - - // The desired authentication mode for the cluster. - AuthenticationMode AuthenticationMode - - noSmithyDocumentSerde -} - -// Configuration updates for an Argo CD capability. You only need to specify the -// fields you want to update. -type UpdateArgoCdConfig struct { - - // Updated network access configuration for the Argo CD capability's managed API - // server endpoint. You can add or remove VPC endpoint associations to control - // which VPCs have private access to the Argo CD server. - NetworkAccess *ArgoCdNetworkAccessConfigRequest - - // Updated RBAC role mappings for the Argo CD capability. You can add, update, or - // remove role mappings. - RbacRoleMappings *UpdateRoleMappings - - noSmithyDocumentSerde -} - -// Configuration updates for a capability. The structure varies depending on the -// capability type. -type UpdateCapabilityConfiguration struct { - - // Configuration updates specific to Argo CD capabilities. - ArgoCd *UpdateArgoCdConfig - - noSmithyDocumentSerde -} - -// An object representing a Kubernetes label change for a managed node group. -type UpdateLabelsPayload struct { - - // The Kubernetes labels to add or update. - AddOrUpdateLabels map[string]string - - // The Kubernetes labels to remove. - RemoveLabels []string - - noSmithyDocumentSerde -} - -// An object representing the details of an update request. -type UpdateParam struct { - - // The keys associated with an update request. - Type UpdateParamType - - // The value of the keys submitted as part of an update request. - Value *string - - noSmithyDocumentSerde -} - -// Updates to RBAC role mappings for an Argo CD capability. You can add, update, -// or remove role mappings in a single operation. -type UpdateRoleMappings struct { - - // A list of role mappings to add or update. If a mapping for the specified role - // already exists, it will be updated with the new identities. If it doesn't exist, - // a new mapping will be created. - AddOrUpdateRoleMappings []ArgoCdRoleMapping - - // A list of role mappings to remove from the RBAC configuration. Each mapping - // specifies an Argo CD role ( ADMIN , EDITOR , or VIEWER ) and the identities to - // remove from that role. - RemoveRoleMappings []ArgoCdRoleMapping - - noSmithyDocumentSerde -} - -// An object representing the details of an update to a taints payload. For more -// information, see [Node taints on managed node groups]in the Amazon EKS User Guide. -// -// [Node taints on managed node groups]: https://docs.aws.amazon.com/eks/latest/userguide/node-taints-managed-node-groups.html -type UpdateTaintsPayload struct { - - // Kubernetes taints to be added or updated. - AddOrUpdateTaints []Taint - - // Kubernetes taints to remove. - RemoveTaints []Taint - - noSmithyDocumentSerde -} - -// The support policy to use for the cluster. Extended support allows you to -// remain on specific Kubernetes versions for longer. Clusters in extended support -// have higher costs. The default value is EXTENDED . Use STANDARD to disable -// extended support. -// -// [Learn more about EKS Extended Support in the Amazon EKS User Guide.] -// -// [Learn more about EKS Extended Support in the Amazon EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html -type UpgradePolicyRequest struct { - - // If the cluster is set to EXTENDED , it will enter extended support at the end of - // standard support. If the cluster is set to STANDARD , it will be automatically - // upgraded at the end of standard support. - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.] - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html - SupportType SupportType - - noSmithyDocumentSerde -} - -// This value indicates if extended support is enabled or disabled for the cluster. -// -// [Learn more about EKS Extended Support in the Amazon EKS User Guide.] -// -// [Learn more about EKS Extended Support in the Amazon EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html -type UpgradePolicyResponse struct { - - // If the cluster is set to EXTENDED , it will enter extended support at the end of - // standard support. If the cluster is set to STANDARD , it will be automatically - // upgraded at the end of standard support. - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.] - // - // [Learn more about EKS Extended Support in the Amazon EKS User Guide.]: https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html - SupportType SupportType - - noSmithyDocumentSerde -} - -// An object representing the VPC configuration to use for an Amazon EKS cluster. -type VpcConfigRequest struct { - - // Set this value to true to enable private access for your cluster's Kubernetes - // API server endpoint. If you enable private access, Kubernetes API requests from - // within your cluster's VPC use the private VPC endpoint. The default value for - // this parameter is false , which disables private access for your Kubernetes API - // server. If you disable private access and you have nodes or Fargate pods in the - // cluster, then ensure that publicAccessCidrs includes the necessary CIDR blocks - // for communication with the nodes or Fargate pods. For more information, see [Cluster API server endpoint]in - // the Amazon EKS User Guide . - // - // [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html - EndpointPrivateAccess *bool - - // Set this value to false to disable public access to your cluster's Kubernetes - // API server endpoint. If you disable public access, your cluster's Kubernetes API - // server can only receive requests from within the cluster VPC. The default value - // for this parameter is true , which enables public access for your Kubernetes API - // server. The endpoint domain name and IP address family depends on the value of - // the ipFamily for the cluster. For more information, see [Cluster API server endpoint] in the Amazon EKS User - // Guide . - // - // [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html - EndpointPublicAccess *bool - - // The CIDR blocks that are allowed access to your cluster's public Kubernetes API - // server endpoint. Communication to the endpoint from addresses outside of the - // CIDR blocks that you specify is denied. The default value is 0.0.0.0/0 and - // additionally ::/0 for dual-stack `IPv6` clusters. If you've disabled private - // endpoint access, make sure that you specify the necessary CIDR blocks for every - // node and Fargate Pod in the cluster. For more information, see [Cluster API server endpoint] in the Amazon - // EKS User Guide . - // - // Note that the public endpoints are dual-stack for only IPv6 clusters that are - // made after October 2024. You can't add IPv6 CIDR blocks to IPv4 clusters or IPv6 - // clusters that were made before October 2024. - // - // [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html - PublicAccessCidrs []string - - // Specify one or more security groups for the cross-account elastic network - // interfaces that Amazon EKS creates to use that allow communication between your - // nodes and the Kubernetes control plane. If you don't specify any security - // groups, then familiarize yourself with the difference between Amazon EKS - // defaults for clusters deployed with Kubernetes. For more information, see [Amazon EKS security group considerations]in - // the Amazon EKS User Guide . - // - // [Amazon EKS security group considerations]: https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html - SecurityGroupIds []string - - // Specify subnets for your Amazon EKS nodes. Amazon EKS creates cross-account - // elastic network interfaces in these subnets to allow communication between your - // nodes and the Kubernetes control plane. - SubnetIds []string - - noSmithyDocumentSerde -} - -// An object representing an Amazon EKS cluster VPC configuration response. -type VpcConfigResponse struct { - - // The cluster security group that was created by Amazon EKS for the cluster. - // Managed node groups use this security group for control-plane-to-data-plane - // communication. - ClusterSecurityGroupId *string - - // This parameter indicates whether the Amazon EKS private API server endpoint is - // enabled. If the Amazon EKS private API server endpoint is enabled, Kubernetes - // API requests that originate from within your cluster's VPC use the private VPC - // endpoint instead of traversing the internet. If this value is disabled and you - // have nodes or Fargate pods in the cluster, then ensure that publicAccessCidrs - // includes the necessary CIDR blocks for communication with the nodes or Fargate - // pods. For more information, see [Cluster API server endpoint]in the Amazon EKS User Guide . - // - // [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html - EndpointPrivateAccess bool - - // Whether the public API server endpoint is enabled. - EndpointPublicAccess bool - - // The CIDR blocks that are allowed access to your cluster's public Kubernetes API - // server endpoint. Communication to the endpoint from addresses outside of the - // CIDR blocks that you specify is denied. The default value is 0.0.0.0/0 and - // additionally ::/0 for dual-stack `IPv6` clusters. If you've disabled private - // endpoint access, make sure that you specify the necessary CIDR blocks for every - // node and Fargate Pod in the cluster. For more information, see [Cluster API server endpoint] in the Amazon - // EKS User Guide . - // - // Note that the public endpoints are dual-stack for only IPv6 clusters that are - // made after October 2024. You can't add IPv6 CIDR blocks to IPv4 clusters or IPv6 - // clusters that were made before October 2024. - // - // [Cluster API server endpoint]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html - PublicAccessCidrs []string - - // The security groups associated with the cross-account elastic network - // interfaces that are used to allow communication between your nodes and the - // Kubernetes control plane. - SecurityGroupIds []string - - // The subnets associated with your cluster. - SubnetIds []string - - // The VPC associated with your cluster. - VpcId *string - - noSmithyDocumentSerde -} - -// The configuration for zonal shift for the cluster. -type ZonalShiftConfigRequest struct { - - // If zonal shift is enabled, Amazon Web Services configures zonal autoshift for - // the cluster. - Enabled *bool - - noSmithyDocumentSerde -} - -// The status of zonal shift configuration for the cluster -type ZonalShiftConfigResponse struct { - - // Whether the zonal shift is enabled. - Enabled *bool - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/eks/validators.go deleted file mode 100644 index 697a2e326c6e..000000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/eks/validators.go +++ /dev/null @@ -1,2805 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package eks - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/eks/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAssociateAccessPolicy struct { -} - -func (*validateOpAssociateAccessPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateAccessPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateAccessPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateEncryptionConfig struct { -} - -func (*validateOpAssociateEncryptionConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateEncryptionConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateEncryptionConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateEncryptionConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateIdentityProviderConfig struct { -} - -func (*validateOpAssociateIdentityProviderConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateIdentityProviderConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateIdentityProviderConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateIdentityProviderConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateAccessEntry struct { -} - -func (*validateOpCreateAccessEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateAccessEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateAddon struct { -} - -func (*validateOpCreateAddon) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateAddonInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateAddonInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCapability struct { -} - -func (*validateOpCreateCapability) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCapabilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCluster struct { -} - -func (*validateOpCreateCluster) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateClusterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateClusterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateEksAnywhereSubscription struct { -} - -func (*validateOpCreateEksAnywhereSubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateEksAnywhereSubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateFargateProfile struct { -} - -func (*validateOpCreateFargateProfile) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateFargateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateFargateProfileInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateFargateProfileInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateNodegroup struct { -} - -func (*validateOpCreateNodegroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateNodegroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateNodegroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateNodegroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreatePodIdentityAssociation struct { -} - -func (*validateOpCreatePodIdentityAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreatePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreatePodIdentityAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteAccessEntry struct { -} - -func (*validateOpDeleteAccessEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteAccessEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteAddon struct { -} - -func (*validateOpDeleteAddon) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteAddonInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteAddonInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCapability struct { -} - -func (*validateOpDeleteCapability) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCapabilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCluster struct { -} - -func (*validateOpDeleteCluster) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteClusterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteClusterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteEksAnywhereSubscription struct { -} - -func (*validateOpDeleteEksAnywhereSubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteEksAnywhereSubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteFargateProfile struct { -} - -func (*validateOpDeleteFargateProfile) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteFargateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteFargateProfileInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteFargateProfileInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteNodegroup struct { -} - -func (*validateOpDeleteNodegroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteNodegroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteNodegroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteNodegroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeletePodIdentityAssociation struct { -} - -func (*validateOpDeletePodIdentityAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeletePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeletePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeletePodIdentityAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeregisterCluster struct { -} - -func (*validateOpDeregisterCluster) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeregisterCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeregisterClusterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeregisterClusterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeAccessEntry struct { -} - -func (*validateOpDescribeAccessEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeAccessEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeAddonConfiguration struct { -} - -func (*validateOpDescribeAddonConfiguration) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeAddonConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeAddonConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeAddonConfigurationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeAddon struct { -} - -func (*validateOpDescribeAddon) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeAddonInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeAddonInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCapability struct { -} - -func (*validateOpDescribeCapability) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCapabilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCluster struct { -} - -func (*validateOpDescribeCluster) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeClusterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeClusterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeEksAnywhereSubscription struct { -} - -func (*validateOpDescribeEksAnywhereSubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeEksAnywhereSubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeFargateProfile struct { -} - -func (*validateOpDescribeFargateProfile) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeFargateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeFargateProfileInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeFargateProfileInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeIdentityProviderConfig struct { -} - -func (*validateOpDescribeIdentityProviderConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeIdentityProviderConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeIdentityProviderConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeIdentityProviderConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeInsight struct { -} - -func (*validateOpDescribeInsight) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeInsight) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeInsightInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeInsightInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeInsightsRefresh struct { -} - -func (*validateOpDescribeInsightsRefresh) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeInsightsRefresh) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeInsightsRefreshInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeInsightsRefreshInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeNodegroup struct { -} - -func (*validateOpDescribeNodegroup) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeNodegroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeNodegroupInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeNodegroupInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribePodIdentityAssociation struct { -} - -func (*validateOpDescribePodIdentityAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribePodIdentityAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeUpdate struct { -} - -func (*validateOpDescribeUpdate) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeUpdate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeUpdateInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeUpdateInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateAccessPolicy struct { -} - -func (*validateOpDisassociateAccessPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateAccessPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateAccessPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateIdentityProviderConfig struct { -} - -func (*validateOpDisassociateIdentityProviderConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateIdentityProviderConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateIdentityProviderConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateIdentityProviderConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAccessEntries struct { -} - -func (*validateOpListAccessEntries) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAccessEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAccessEntriesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAccessEntriesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAddons struct { -} - -func (*validateOpListAddons) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAddons) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAddonsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAddonsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAssociatedAccessPolicies struct { -} - -func (*validateOpListAssociatedAccessPolicies) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAssociatedAccessPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAssociatedAccessPoliciesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAssociatedAccessPoliciesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListCapabilities struct { -} - -func (*validateOpListCapabilities) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListCapabilities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListCapabilitiesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListCapabilitiesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListFargateProfiles struct { -} - -func (*validateOpListFargateProfiles) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListFargateProfiles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListFargateProfilesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListFargateProfilesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListIdentityProviderConfigs struct { -} - -func (*validateOpListIdentityProviderConfigs) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListIdentityProviderConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListIdentityProviderConfigsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListIdentityProviderConfigsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListInsights struct { -} - -func (*validateOpListInsights) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListInsights) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListInsightsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListInsightsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListNodegroups struct { -} - -func (*validateOpListNodegroups) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListNodegroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListNodegroupsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListNodegroupsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListPodIdentityAssociations struct { -} - -func (*validateOpListPodIdentityAssociations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListPodIdentityAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListPodIdentityAssociationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListPodIdentityAssociationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTagsForResource struct { -} - -func (*validateOpListTagsForResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTagsForResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTagsForResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListUpdates struct { -} - -func (*validateOpListUpdates) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListUpdates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListUpdatesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListUpdatesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterCluster struct { -} - -func (*validateOpRegisterCluster) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterClusterInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterClusterInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartInsightsRefresh struct { -} - -func (*validateOpStartInsightsRefresh) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartInsightsRefresh) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartInsightsRefreshInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartInsightsRefreshInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTagResource struct { -} - -func (*validateOpTagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUntagResource struct { -} - -func (*validateOpUntagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UntagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUntagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateAccessEntry struct { -} - -func (*validateOpUpdateAccessEntry) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateAccessEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateAccessEntryInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateAccessEntryInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateAddon struct { -} - -func (*validateOpUpdateAddon) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateAddon) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateAddonInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateAddonInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateCapability struct { -} - -func (*validateOpUpdateCapability) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateCapability) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateCapabilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateCapabilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateClusterConfig struct { -} - -func (*validateOpUpdateClusterConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateClusterConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateClusterConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateClusterConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateClusterVersion struct { -} - -func (*validateOpUpdateClusterVersion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateClusterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateClusterVersionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateClusterVersionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateEksAnywhereSubscription struct { -} - -func (*validateOpUpdateEksAnywhereSubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateEksAnywhereSubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateNodegroupConfig struct { -} - -func (*validateOpUpdateNodegroupConfig) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateNodegroupConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateNodegroupConfigInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateNodegroupConfigInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateNodegroupVersion struct { -} - -func (*validateOpUpdateNodegroupVersion) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateNodegroupVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateNodegroupVersionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateNodegroupVersionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdatePodIdentityAssociation struct { -} - -func (*validateOpUpdatePodIdentityAssociation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdatePodIdentityAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdatePodIdentityAssociationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdatePodIdentityAssociationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAssociateAccessPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateAccessPolicy{}, middleware.After) -} - -func addOpAssociateEncryptionConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateEncryptionConfig{}, middleware.After) -} - -func addOpAssociateIdentityProviderConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateIdentityProviderConfig{}, middleware.After) -} - -func addOpCreateAccessEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAccessEntry{}, middleware.After) -} - -func addOpCreateAddonValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAddon{}, middleware.After) -} - -func addOpCreateCapabilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCapability{}, middleware.After) -} - -func addOpCreateClusterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCluster{}, middleware.After) -} - -func addOpCreateEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateEksAnywhereSubscription{}, middleware.After) -} - -func addOpCreateFargateProfileValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateFargateProfile{}, middleware.After) -} - -func addOpCreateNodegroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateNodegroup{}, middleware.After) -} - -func addOpCreatePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreatePodIdentityAssociation{}, middleware.After) -} - -func addOpDeleteAccessEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteAccessEntry{}, middleware.After) -} - -func addOpDeleteAddonValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteAddon{}, middleware.After) -} - -func addOpDeleteCapabilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCapability{}, middleware.After) -} - -func addOpDeleteClusterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCluster{}, middleware.After) -} - -func addOpDeleteEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteEksAnywhereSubscription{}, middleware.After) -} - -func addOpDeleteFargateProfileValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteFargateProfile{}, middleware.After) -} - -func addOpDeleteNodegroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteNodegroup{}, middleware.After) -} - -func addOpDeletePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeletePodIdentityAssociation{}, middleware.After) -} - -func addOpDeregisterClusterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeregisterCluster{}, middleware.After) -} - -func addOpDescribeAccessEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeAccessEntry{}, middleware.After) -} - -func addOpDescribeAddonConfigurationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeAddonConfiguration{}, middleware.After) -} - -func addOpDescribeAddonValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeAddon{}, middleware.After) -} - -func addOpDescribeCapabilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCapability{}, middleware.After) -} - -func addOpDescribeClusterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCluster{}, middleware.After) -} - -func addOpDescribeEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeEksAnywhereSubscription{}, middleware.After) -} - -func addOpDescribeFargateProfileValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeFargateProfile{}, middleware.After) -} - -func addOpDescribeIdentityProviderConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeIdentityProviderConfig{}, middleware.After) -} - -func addOpDescribeInsightValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeInsight{}, middleware.After) -} - -func addOpDescribeInsightsRefreshValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeInsightsRefresh{}, middleware.After) -} - -func addOpDescribeNodegroupValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeNodegroup{}, middleware.After) -} - -func addOpDescribePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribePodIdentityAssociation{}, middleware.After) -} - -func addOpDescribeUpdateValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeUpdate{}, middleware.After) -} - -func addOpDisassociateAccessPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateAccessPolicy{}, middleware.After) -} - -func addOpDisassociateIdentityProviderConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateIdentityProviderConfig{}, middleware.After) -} - -func addOpListAccessEntriesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAccessEntries{}, middleware.After) -} - -func addOpListAddonsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAddons{}, middleware.After) -} - -func addOpListAssociatedAccessPoliciesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAssociatedAccessPolicies{}, middleware.After) -} - -func addOpListCapabilitiesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListCapabilities{}, middleware.After) -} - -func addOpListFargateProfilesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListFargateProfiles{}, middleware.After) -} - -func addOpListIdentityProviderConfigsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListIdentityProviderConfigs{}, middleware.After) -} - -func addOpListInsightsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListInsights{}, middleware.After) -} - -func addOpListNodegroupsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListNodegroups{}, middleware.After) -} - -func addOpListPodIdentityAssociationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListPodIdentityAssociations{}, middleware.After) -} - -func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) -} - -func addOpListUpdatesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListUpdates{}, middleware.After) -} - -func addOpRegisterClusterValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterCluster{}, middleware.After) -} - -func addOpStartInsightsRefreshValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartInsightsRefresh{}, middleware.After) -} - -func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) -} - -func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) -} - -func addOpUpdateAccessEntryValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateAccessEntry{}, middleware.After) -} - -func addOpUpdateAddonValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateAddon{}, middleware.After) -} - -func addOpUpdateCapabilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateCapability{}, middleware.After) -} - -func addOpUpdateClusterConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateClusterConfig{}, middleware.After) -} - -func addOpUpdateClusterVersionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateClusterVersion{}, middleware.After) -} - -func addOpUpdateEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateEksAnywhereSubscription{}, middleware.After) -} - -func addOpUpdateNodegroupConfigValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateNodegroupConfig{}, middleware.After) -} - -func addOpUpdateNodegroupVersionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateNodegroupVersion{}, middleware.After) -} - -func addOpUpdatePodIdentityAssociationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdatePodIdentityAssociation{}, middleware.After) -} - -func validateAddonPodIdentityAssociations(v *types.AddonPodIdentityAssociations) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AddonPodIdentityAssociations"} - if v.ServiceAccount == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceAccount")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAddonPodIdentityAssociationsList(v []types.AddonPodIdentityAssociations) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AddonPodIdentityAssociationsList"} - for i := range v { - if err := validateAddonPodIdentityAssociations(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateArgoCdAwsIdcConfigRequest(v *types.ArgoCdAwsIdcConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ArgoCdAwsIdcConfigRequest"} - if v.IdcInstanceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("IdcInstanceArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateArgoCdConfigRequest(v *types.ArgoCdConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ArgoCdConfigRequest"} - if v.AwsIdc == nil { - invalidParams.Add(smithy.NewErrParamRequired("AwsIdc")) - } else if v.AwsIdc != nil { - if err := validateArgoCdAwsIdcConfigRequest(v.AwsIdc); err != nil { - invalidParams.AddNested("AwsIdc", err.(smithy.InvalidParamsError)) - } - } - if v.RbacRoleMappings != nil { - if err := validateArgoCdRoleMappingList(v.RbacRoleMappings); err != nil { - invalidParams.AddNested("RbacRoleMappings", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateArgoCdRoleMapping(v *types.ArgoCdRoleMapping) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ArgoCdRoleMapping"} - if len(v.Role) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Role")) - } - if v.Identities == nil { - invalidParams.Add(smithy.NewErrParamRequired("Identities")) - } else if v.Identities != nil { - if err := validateSsoIdentityList(v.Identities); err != nil { - invalidParams.AddNested("Identities", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateArgoCdRoleMappingList(v []types.ArgoCdRoleMapping) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ArgoCdRoleMappingList"} - for i := range v { - if err := validateArgoCdRoleMapping(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCapabilityConfigurationRequest(v *types.CapabilityConfigurationRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CapabilityConfigurationRequest"} - if v.ArgoCd != nil { - if err := validateArgoCdConfigRequest(v.ArgoCd); err != nil { - invalidParams.AddNested("ArgoCd", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateConnectorConfigRequest(v *types.ConnectorConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ConnectorConfigRequest"} - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if len(v.Provider) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Provider")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateIdentityProviderConfig(v *types.IdentityProviderConfig) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "IdentityProviderConfig"} - if v.Type == nil { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOidcIdentityProviderConfigRequest(v *types.OidcIdentityProviderConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "OidcIdentityProviderConfigRequest"} - if v.IdentityProviderConfigName == nil { - invalidParams.Add(smithy.NewErrParamRequired("IdentityProviderConfigName")) - } - if v.IssuerUrl == nil { - invalidParams.Add(smithy.NewErrParamRequired("IssuerUrl")) - } - if v.ClientId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClientId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOutpostConfigRequest(v *types.OutpostConfigRequest) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "OutpostConfigRequest"} - if v.OutpostArns == nil { - invalidParams.Add(smithy.NewErrParamRequired("OutpostArns")) - } - if v.ControlPlaneInstanceType == nil { - invalidParams.Add(smithy.NewErrParamRequired("ControlPlaneInstanceType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSsoIdentity(v *types.SsoIdentity) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SsoIdentity"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSsoIdentityList(v []types.SsoIdentity) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SsoIdentityList"} - for i := range v { - if err := validateSsoIdentity(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateUpdateArgoCdConfig(v *types.UpdateArgoCdConfig) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateArgoCdConfig"} - if v.RbacRoleMappings != nil { - if err := validateUpdateRoleMappings(v.RbacRoleMappings); err != nil { - invalidParams.AddNested("RbacRoleMappings", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateUpdateCapabilityConfiguration(v *types.UpdateCapabilityConfiguration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateCapabilityConfiguration"} - if v.ArgoCd != nil { - if err := validateUpdateArgoCdConfig(v.ArgoCd); err != nil { - invalidParams.AddNested("ArgoCd", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateUpdateRoleMappings(v *types.UpdateRoleMappings) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateRoleMappings"} - if v.AddOrUpdateRoleMappings != nil { - if err := validateArgoCdRoleMappingList(v.AddOrUpdateRoleMappings); err != nil { - invalidParams.AddNested("AddOrUpdateRoleMappings", err.(smithy.InvalidParamsError)) - } - } - if v.RemoveRoleMappings != nil { - if err := validateArgoCdRoleMappingList(v.RemoveRoleMappings); err != nil { - invalidParams.AddNested("RemoveRoleMappings", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateAccessPolicyInput(v *AssociateAccessPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateAccessPolicyInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if v.PolicyArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyArn")) - } - if v.AccessScope == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccessScope")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateEncryptionConfigInput(v *AssociateEncryptionConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateEncryptionConfigInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.EncryptionConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("EncryptionConfig")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateIdentityProviderConfigInput(v *AssociateIdentityProviderConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateIdentityProviderConfigInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.Oidc == nil { - invalidParams.Add(smithy.NewErrParamRequired("Oidc")) - } else if v.Oidc != nil { - if err := validateOidcIdentityProviderConfigRequest(v.Oidc); err != nil { - invalidParams.AddNested("Oidc", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateAccessEntryInput(v *CreateAccessEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateAccessEntryInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateAddonInput(v *CreateAddonInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateAddonInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AddonName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonName")) - } - if v.PodIdentityAssociations != nil { - if err := validateAddonPodIdentityAssociationsList(v.PodIdentityAssociations); err != nil { - invalidParams.AddNested("PodIdentityAssociations", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCapabilityInput(v *CreateCapabilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCapabilityInput"} - if v.CapabilityName == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapabilityName")) - } - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if v.Configuration != nil { - if err := validateCapabilityConfigurationRequest(v.Configuration); err != nil { - invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) - } - } - if len(v.DeletePropagationPolicy) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("DeletePropagationPolicy")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateClusterInput(v *CreateClusterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateClusterInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if v.ResourcesVpcConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourcesVpcConfig")) - } - if v.OutpostConfig != nil { - if err := validateOutpostConfigRequest(v.OutpostConfig); err != nil { - invalidParams.AddNested("OutpostConfig", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateEksAnywhereSubscriptionInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Term == nil { - invalidParams.Add(smithy.NewErrParamRequired("Term")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateFargateProfileInput(v *CreateFargateProfileInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateFargateProfileInput"} - if v.FargateProfileName == nil { - invalidParams.Add(smithy.NewErrParamRequired("FargateProfileName")) - } - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PodExecutionRoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PodExecutionRoleArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateNodegroupInput(v *CreateNodegroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateNodegroupInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.NodegroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodegroupName")) - } - if v.Subnets == nil { - invalidParams.Add(smithy.NewErrParamRequired("Subnets")) - } - if v.NodeRole == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodeRole")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreatePodIdentityAssociationInput(v *CreatePodIdentityAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreatePodIdentityAssociationInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.Namespace == nil { - invalidParams.Add(smithy.NewErrParamRequired("Namespace")) - } - if v.ServiceAccount == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServiceAccount")) - } - if v.RoleArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteAccessEntryInput(v *DeleteAccessEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessEntryInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteAddonInput(v *DeleteAddonInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteAddonInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AddonName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCapabilityInput(v *DeleteCapabilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCapabilityInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.CapabilityName == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapabilityName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteClusterInput(v *DeleteClusterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteClusterInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteEksAnywhereSubscriptionInput(v *DeleteEksAnywhereSubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteEksAnywhereSubscriptionInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteFargateProfileInput(v *DeleteFargateProfileInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteFargateProfileInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.FargateProfileName == nil { - invalidParams.Add(smithy.NewErrParamRequired("FargateProfileName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteNodegroupInput(v *DeleteNodegroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteNodegroupInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.NodegroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodegroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeletePodIdentityAssociationInput(v *DeletePodIdentityAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeletePodIdentityAssociationInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeregisterClusterInput(v *DeregisterClusterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeregisterClusterInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeAccessEntryInput(v *DescribeAccessEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeAccessEntryInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeAddonConfigurationInput(v *DescribeAddonConfigurationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeAddonConfigurationInput"} - if v.AddonName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonName")) - } - if v.AddonVersion == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonVersion")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeAddonInput(v *DescribeAddonInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeAddonInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AddonName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCapabilityInput(v *DescribeCapabilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCapabilityInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.CapabilityName == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapabilityName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeClusterInput(v *DescribeClusterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeEksAnywhereSubscriptionInput(v *DescribeEksAnywhereSubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeEksAnywhereSubscriptionInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeFargateProfileInput(v *DescribeFargateProfileInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeFargateProfileInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.FargateProfileName == nil { - invalidParams.Add(smithy.NewErrParamRequired("FargateProfileName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeIdentityProviderConfigInput(v *DescribeIdentityProviderConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeIdentityProviderConfigInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.IdentityProviderConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("IdentityProviderConfig")) - } else if v.IdentityProviderConfig != nil { - if err := validateIdentityProviderConfig(v.IdentityProviderConfig); err != nil { - invalidParams.AddNested("IdentityProviderConfig", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeInsightInput(v *DescribeInsightInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeInsightInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeInsightsRefreshInput(v *DescribeInsightsRefreshInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeInsightsRefreshInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeNodegroupInput(v *DescribeNodegroupInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeNodegroupInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.NodegroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodegroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribePodIdentityAssociationInput(v *DescribePodIdentityAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribePodIdentityAssociationInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeUpdateInput(v *DescribeUpdateInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeUpdateInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.UpdateId == nil { - invalidParams.Add(smithy.NewErrParamRequired("UpdateId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateAccessPolicyInput(v *DisassociateAccessPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateAccessPolicyInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if v.PolicyArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateIdentityProviderConfigInput(v *DisassociateIdentityProviderConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateIdentityProviderConfigInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.IdentityProviderConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("IdentityProviderConfig")) - } else if v.IdentityProviderConfig != nil { - if err := validateIdentityProviderConfig(v.IdentityProviderConfig); err != nil { - invalidParams.AddNested("IdentityProviderConfig", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAccessEntriesInput(v *ListAccessEntriesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAccessEntriesInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAddonsInput(v *ListAddonsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAddonsInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAssociatedAccessPoliciesInput(v *ListAssociatedAccessPoliciesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAssociatedAccessPoliciesInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListCapabilitiesInput(v *ListCapabilitiesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListCapabilitiesInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListFargateProfilesInput(v *ListFargateProfilesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListFargateProfilesInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListIdentityProviderConfigsInput(v *ListIdentityProviderConfigsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListIdentityProviderConfigsInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListInsightsInput(v *ListInsightsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListInsightsInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListNodegroupsInput(v *ListNodegroupsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListNodegroupsInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListPodIdentityAssociationsInput(v *ListPodIdentityAssociationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListPodIdentityAssociationsInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListUpdatesInput(v *ListUpdatesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListUpdatesInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterClusterInput(v *RegisterClusterInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterClusterInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.ConnectorConfig == nil { - invalidParams.Add(smithy.NewErrParamRequired("ConnectorConfig")) - } else if v.ConnectorConfig != nil { - if err := validateConnectorConfigRequest(v.ConnectorConfig); err != nil { - invalidParams.AddNested("ConnectorConfig", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartInsightsRefreshInput(v *StartInsightsRefreshInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartInsightsRefreshInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTagResourceInput(v *TagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.Tags == nil { - invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUntagResourceInput(v *UntagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.TagKeys == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateAccessEntryInput(v *UpdateAccessEntryInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessEntryInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.PrincipalArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateAddonInput(v *UpdateAddonInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateAddonInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AddonName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AddonName")) - } - if v.PodIdentityAssociations != nil { - if err := validateAddonPodIdentityAssociationsList(v.PodIdentityAssociations); err != nil { - invalidParams.AddNested("PodIdentityAssociations", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateCapabilityInput(v *UpdateCapabilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateCapabilityInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.CapabilityName == nil { - invalidParams.Add(smithy.NewErrParamRequired("CapabilityName")) - } - if v.Configuration != nil { - if err := validateUpdateCapabilityConfiguration(v.Configuration); err != nil { - invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateClusterConfigInput(v *UpdateClusterConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateClusterConfigInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateClusterVersionInput(v *UpdateClusterVersionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateClusterVersionInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Version == nil { - invalidParams.Add(smithy.NewErrParamRequired("Version")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateEksAnywhereSubscriptionInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateNodegroupConfigInput(v *UpdateNodegroupConfigInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateNodegroupConfigInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.NodegroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodegroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateNodegroupVersionInput(v *UpdateNodegroupVersionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateNodegroupVersionInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.NodegroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("NodegroupName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdatePodIdentityAssociationInput(v *UpdatePodIdentityAssociationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdatePodIdentityAssociationInput"} - if v.ClusterName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) - } - if v.AssociationId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/.gitignore b/vendor/github.com/gophercloud/gophercloud/v2/.gitignore deleted file mode 100644 index 8b1b79e617a4..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -**/*.swp -.idea -.vscode -testing_*.coverprofile -/cover.out diff --git a/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml b/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml deleted file mode 100644 index 828a099a40cc..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -linters: - disable-all: true - enable: - - errcheck - - gofmt - - goimports - - govet - - staticcheck - - unparam - - unused - -issues: - exclude: - - SA1006 # printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck) - exclude-rules: - - linters: - - staticcheck - text: 'SA1019: (x509.EncryptPEMBlock|strings.Title)' diff --git a/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md b/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md deleted file mode 100644 index d53f641b8ad8..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md +++ /dev/null @@ -1,1131 +0,0 @@ -## v2.10.0 (2026-01-05) - -* [GH-3569](https://github.com/gophercloud/gophercloud/pull/3569) identity/role: restore backward compatibility for description -* [GH-3570](https://github.com/gophercloud/gophercloud/pull/3570) [v2] identityv3/service: add `name` and `description` fields -* [GH-3577](https://github.com/gophercloud/gophercloud/pull/3577) [v2] add: description field to identity.v3.Endpoint -* [GH-3580](https://github.com/gophercloud/gophercloud/pull/3580) [v2] keystone: add support for per page limit -* [GH-3582](https://github.com/gophercloud/gophercloud/pull/3582) [v2] network.v2.Port: add support for update mac_address -* [GH-3585](https://github.com/gophercloud/gophercloud/pull/3585) [v2] identity.v3.Endpoint: add enabled field on creation and on update -* [GH-3590](https://github.com/gophercloud/gophercloud/pull/3590) [v2] fix (image/v2/images): image v2 unmarshal issue -* [GH-3594](https://github.com/gophercloud/gophercloud/pull/3594) [v2] Add new fields for ListOpts volumetypes -* [GH-3595](https://github.com/gophercloud/gophercloud/pull/3595) [v2] identity.v3.Endpoint: make name as optional on creation - -## v2.9.0 (2025-11-17) - -* [GH-3508](https://github.com/gophercloud/gophercloud/pull/3508) [v2] Trigger "hold" workflow on merge groups -* [GH-3511](https://github.com/gophercloud/gophercloud/pull/3511) [v2] Closes #2321 - Fix TestRolesCRUD by including DomainID to TestRolesCRUD -* [GH-3513](https://github.com/gophercloud/gophercloud/pull/3513) [v2] build(deps): bump actions/labeler from 5 to 6 -* [GH-3516](https://github.com/gophercloud/gophercloud/pull/3516) [v2] refactor: Trivial fixes -* [GH-3524](https://github.com/gophercloud/gophercloud/pull/3524) [v2] [glance]: Add 'uploading' status -* [GH-3525](https://github.com/gophercloud/gophercloud/pull/3525) [v2] compute: Add host aggregate uuid field -* [GH-3526](https://github.com/gophercloud/gophercloud/pull/3526) [v2] Enable deletion for network and loadbalancer quotas -* [GH-3541](https://github.com/gophercloud/gophercloud/pull/3541) [v2] docs: Document tested releases for acceptance tests -* [GH-3544](https://github.com/gophercloud/gophercloud/pull/3544) [v2] Identity V3: Add Options field to roles. -* [GH-3547](https://github.com/gophercloud/gophercloud/pull/3547) [v2] Add config_drive to server struct -* [GH-3548](https://github.com/gophercloud/gophercloud/pull/3548) [v2] Identity: Add description field to roles -* [GH-3549](https://github.com/gophercloud/gophercloud/pull/3549) [v2] compute: add cpu info topology cells entry -* [GH-3550](https://github.com/gophercloud/gophercloud/pull/3550) [v2] Migrate epoxy jobs to Ubuntu 24.04 (Noble), drop caracal jobs -* [GH-3551](https://github.com/gophercloud/gophercloud/pull/3551) [v2] build(deps): bump github/codeql-action from 3 to 4 -* [GH-3557](https://github.com/gophercloud/gophercloud/pull/3557) [v2] Fix EC2 authentication to work with new Keystone auth requirement -* [GH-3558](https://github.com/gophercloud/gophercloud/pull/3558) [v2] identity/services: add omitempty to the `type` field -* [GH-3559](https://github.com/gophercloud/gophercloud/pull/3559) [v2] fix: handle Nova create image response for microversion 2.45 and above - -## v2.8.0 (2025-08-18) - -* [GH-3348](https://github.com/gophercloud/gophercloud/pull/3348) [v2] [networking] add ExtractRoutersInto func helper to routers -* [GH-3354](https://github.com/gophercloud/gophercloud/pull/3354) [v2] Fix a small typo -* [GH-3358](https://github.com/gophercloud/gophercloud/pull/3358) [v2] tests: fix devstack master branch tests -* [GH-3361](https://github.com/gophercloud/gophercloud/pull/3361) [v2] octavia: fix http_version type to float -* [GH-3362](https://github.com/gophercloud/gophercloud/pull/3362) [v2] tests: fix containerinfra template creation -* [GH-3367](https://github.com/gophercloud/gophercloud/pull/3367) [v2] Use Makefile for CI jobs -* [GH-3375](https://github.com/gophercloud/gophercloud/pull/3375) [v2] core: add missing Builder interfaces -* [GH-3378](https://github.com/gophercloud/gophercloud/pull/3378) [v2] tests: fix failing rabbitmq service -* [GH-3379](https://github.com/gophercloud/gophercloud/pull/3379) [v2] CI: Remove Bobcat -* [GH-3384](https://github.com/gophercloud/gophercloud/pull/3384) [v2] Move master CI jobs to Ubuntu 24.04 -* [GH-3386](https://github.com/gophercloud/gophercloud/pull/3386) [v2] tests: Fix TestBGPAgentCRUD -* [GH-3387](https://github.com/gophercloud/gophercloud/pull/3387) [v2] Update the doc of openstack.AuthOptionsFromEnv function -* [GH-3389](https://github.com/gophercloud/gophercloud/pull/3389) [v2] networking: add constants for statuses -* [GH-3391](https://github.com/gophercloud/gophercloud/pull/3391) [v2] CI: Add Epoxy -* [GH-3393](https://github.com/gophercloud/gophercloud/pull/3393) [v2] dns: implement shared zones list -* [GH-3394](https://github.com/gophercloud/gophercloud/pull/3394) [v2] acceptance: Prevent 409 when bulk-creating secgroup rules -* [GH-3396](https://github.com/gophercloud/gophercloud/pull/3396) [v2] identity: add support for string boolean in users' enabled member -* [GH-3397](https://github.com/gophercloud/gophercloud/pull/3397) [v2] Adjust List func to accept a Builder in tenants, routers and security groups packages -* [GH-3399](https://github.com/gophercloud/gophercloud/pull/3399) [v2] blockstorage: add manage-existing and unmanage api call -* [GH-3401](https://github.com/gophercloud/gophercloud/pull/3401) [v2] Added address groups to Networking extensions, with tests. -* [GH-3407](https://github.com/gophercloud/gophercloud/pull/3407) [v2] neutron: add segment_id support to subnets -* [GH-3413](https://github.com/gophercloud/gophercloud/pull/3413) [v2] build(deps): bump joelanford/go-apidiff from 0.8.2 to 0.8.3 -* [GH-3416](https://github.com/gophercloud/gophercloud/pull/3416) [v2] tests: bump devstack-action -* [GH-3422](https://github.com/gophercloud/gophercloud/pull/3422) [v2] Fix documentation for gateway_ip in subnet update -* [GH-3431](https://github.com/gophercloud/gophercloud/pull/3431) [v2] Use container-infra for OpenStack-API-Version -* [GH-3433](https://github.com/gophercloud/gophercloud/pull/3433) [v2] make: Use fixed version of gotestsum -* [GH-3434](https://github.com/gophercloud/gophercloud/pull/3434) [v2] Randomize test order for unit tests -* [GH-3435](https://github.com/gophercloud/gophercloud/pull/3435) [v2] Add versioned endpoint discovery -* [GH-3438](https://github.com/gophercloud/gophercloud/pull/3438) [v2] dns: add support for /v2/quotas -* [GH-3439](https://github.com/gophercloud/gophercloud/pull/3439) [v2] neutron: add segments extension package -* [GH-3446](https://github.com/gophercloud/gophercloud/pull/3446) nova: add support for hostname updates -* [GH-3452](https://github.com/gophercloud/gophercloud/pull/3452) [v2] neutron: allow omission of subnet_id for IP address -* [GH-3454](https://github.com/gophercloud/gophercloud/pull/3454) [v2] blockstorage: add isPublic query option for volume types -* [GH-3458](https://github.com/gophercloud/gophercloud/pull/3458) [v2] Fix pagination for messaging client -* [GH-3465](https://github.com/gophercloud/gophercloud/pull/3465) [v2] tests: Fix TestVLANTransparentCRUD test -* [GH-3466](https://github.com/gophercloud/gophercloud/pull/3466) [v2] tests: fix tests for recent PR backports -* [GH-3469](https://github.com/gophercloud/gophercloud/pull/3469) [v2] tests: shorten GH-A job names -* [GH-3473](https://github.com/gophercloud/gophercloud/pull/3473) [v2] core: clone service type aliases instead of referencing global slice -* [GH-3475](https://github.com/gophercloud/gophercloud/pull/3475) [v2] Implement update & delete traits on resource provider -* [GH-3476](https://github.com/gophercloud/gophercloud/pull/3476) [v2] tests: fix volumetypes unit tests -* [GH-3477](https://github.com/gophercloud/gophercloud/pull/3477) [v2] script: Improve getenvvar helper -* [GH-3481](https://github.com/gophercloud/gophercloud/pull/3481) [v2] Implement hypervisors.GetExt: Get with Query parameter -* [GH-3487](https://github.com/gophercloud/gophercloud/pull/3487) [v2] Add networking taas tapmirror suite -* [GH-3489](https://github.com/gophercloud/gophercloud/pull/3489) [v2] Fix incorrect ICMP field description in PortRangeMax comment -* [GH-3494](https://github.com/gophercloud/gophercloud/pull/3494) [v2] Networking v2: Support two time formats for subnet, router, SG rule (#3492) -* [GH-3495](https://github.com/gophercloud/gophercloud/pull/3495) [v2] build(deps): bump actions/checkout from 4 to 5 - -## v2.7.0 (2025-04-03) - -* [GH-3306](https://github.com/gophercloud/gophercloud/pull/3306) [v2] identity: Add Get endpoint by ID -* [GH-3325](https://github.com/gophercloud/gophercloud/pull/3325) [v2] Switch to a version of gocovmerge compatible with go 1.22 -* [GH-3327](https://github.com/gophercloud/gophercloud/pull/3327) Merge pull request #3209 from shiftstack/proper-service-discovery -* [GH-3328](https://github.com/gophercloud/gophercloud/pull/3328) [v2] Improve support for `network standard-attr-*` extensions -* [GH-3330](https://github.com/gophercloud/gophercloud/pull/3330) [v2] Enhance Snapshot struct and add ListDetail function in V3 blockstorage -* [GH-3333](https://github.com/gophercloud/gophercloud/pull/3333) [v2] vpnaas: add support for more ciphers (auth, encryption, pfs modes) -* [GH-3334](https://github.com/gophercloud/gophercloud/pull/3334) [v2] Added support for VIF's in Baremetal -* [GH-3335](https://github.com/gophercloud/gophercloud/pull/3335) [v2] Baremetal virtual media Get API - -## v2.6.0 (2025-03-03) - -* [GH-3309](https://github.com/gophercloud/gophercloud/pull/3309) Backport: Added support for hypervisor_hostname to v2 - -## v2.5.0 (2025-02-11) - -* [GH-3278](https://github.com/gophercloud/gophercloud/pull/3278) [v2] test: Ensure that randomly created secgroup rules don't conflict -* [GH-3287](https://github.com/gophercloud/gophercloud/pull/3287) [v2] Fix panic in ExtractIntoStructPtr -* [GH-3288](https://github.com/gophercloud/gophercloud/pull/3288) [v2] Fix JSON field name hints in APIVersion structs -* [GH-3292](https://github.com/gophercloud/gophercloud/pull/3292) [v2] Add permissions to the label-issue workflow -* [GH-3294](https://github.com/gophercloud/gophercloud/pull/3294) [v2] Add support for zone sharing in DNS v2 -* [GH-3296](https://github.com/gophercloud/gophercloud/pull/3296) build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0 -* [GH-3297](https://github.com/gophercloud/gophercloud/pull/3297) [v2] build(deps): bump golang.org/x/crypto from 0.31.0 to 0.32.0 -* [GH-3298](https://github.com/gophercloud/gophercloud/pull/3298) [v2] build(deps): bump golang.org/x/crypto from 0.32.0 to 0.33.0 - -## v2.4.0 (2024-12-18) - -* [GH-3270](https://github.com/gophercloud/gophercloud/pull/3270) [v2] SG rules: implement bulk create -* [GH-3273](https://github.com/gophercloud/gophercloud/pull/3273) [v2] Add missing fields in Objectstorage and compute API - -## v2.3.0 (2024-12-06) - -* [GH-3213](https://github.com/gophercloud/gophercloud/pull/3213) [v2] Handle nova api version > 2.87 for hypervisor -* [GH-3236](https://github.com/gophercloud/gophercloud/pull/3236) [v2] Added required fields for Node API Parity -* [GH-3248](https://github.com/gophercloud/gophercloud/pull/3248) [v2] Add support for disable_power_off -* [GH-3261](https://github.com/gophercloud/gophercloud/pull/3261) [v2] Misc cleanups -* [GH-3262](https://github.com/gophercloud/gophercloud/pull/3262) [v2] Address govet 1.24 issue - -## v2.2.0 (2024-10-18) - -* [GH-3176](https://github.com/gophercloud/gophercloud/pull/3176) [v2] [containerinfra]: add "MasterLBEnabled" in Cluster results -* [GH-3181](https://github.com/gophercloud/gophercloud/pull/3181) [v2] octavia: add new options to health monitors -* [GH-3182](https://github.com/gophercloud/gophercloud/pull/3182) [v2] octavia: add new security options to pools and listeners -* [GH-3195](https://github.com/gophercloud/gophercloud/pull/3195) [v2] [core]: handle empty response body -* [GH-3196](https://github.com/gophercloud/gophercloud/pull/3196) [v2] [fwaas_v2]: proper ParseResponse handling -* [GH-3198](https://github.com/gophercloud/gophercloud/pull/3198) [v2] compute: Fix expected and actual test results -* [GH-3199](https://github.com/gophercloud/gophercloud/pull/3199) [v2] [octavia] add an ability to filter flavors and flavorprofiles -* [GH-3214](https://github.com/gophercloud/gophercloud/pull/3214) [v2] [manila] add scheduler_hints to the shares CreateOpts -* [GH-3215](https://github.com/gophercloud/gophercloud/pull/3215) [v2] [manila] add share_group_id to share's CreateOpts -* [GH-3219](https://github.com/gophercloud/gophercloud/pull/3219) [v2] docs: Remove outdated godoc - -## v2.1.1 (2024-09-18) - -* [GH-3161](https://github.com/gophercloud/gophercloud/pull/3161) [v2] fix: create security group rule with any protocol - -## v2.1.0 (2024-07-24) - -* [GH-3078](https://github.com/gophercloud/gophercloud/pull/3078) [networking]: add BGP VPNs support -* [GH-3086](https://github.com/gophercloud/gophercloud/pull/3086) build(deps): bump golang.org/x/crypto from 0.24.0 to 0.25.0 -* [GH-3090](https://github.com/gophercloud/gophercloud/pull/3090) Adding support for field dns_publish_fixed_ip in a subnet -* [GH-3092](https://github.com/gophercloud/gophercloud/pull/3092) [neutron]: introduce Stateful argument for the security groups -* [GH-3094](https://github.com/gophercloud/gophercloud/pull/3094) [neutron]: introduce Description argument for the portforwarding -* [GH-3106](https://github.com/gophercloud/gophercloud/pull/3106) clouds: Parse trust_id from clouds.yaml -* [GH-3131](https://github.com/gophercloud/gophercloud/pull/3131) Align ServiceFail provisioning state value with Ironic -* [GH-3136](https://github.com/gophercloud/gophercloud/pull/3136) Added node.Retired - -## v2.0.0 (2024-05-27) - -MAIN BREAKING CHANGES: - -* **Gophercloud now requires Go v1.22.** -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) Gophercloud now escapes container and object names in all `objects` and `containers` functions. If you were previously escaping names (with, for example: `url.PathEscape` or `url.QueryEscape`), then you should REMOVE that and pass the intended names to Gophercloud directly. -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) The `containers.ListOpts#Full` and `objects.ListOpts#Full` properties are REMOVED from the Gophercloud API. The reason for that is: plaintext listing is unfixably wrong and won't handle special characters reliably (i.e. `\n`). -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) Empty container names, container names containing a slash (`/`), and empty object names are now rejected in Gophercloud before any call to Swift. -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) In `objectstorage`: `containers.ErrInvalidContainerName` is now `v1.ErrInvalidContainerName`. -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) New name validation errors in `objectstorage`: - * `v1.ErrEmptyContainerName` - * `v1.ErrEmptyObjectName` -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) In `objects.Copy`: the `destination` field (e.g. `objects.CopyOpts#Destination`) must be in the form `/container/object`: the function will reject a destination path if it doesn't start with a slash (`/`). -* [GH-2560](https://github.com/gophercloud/gophercloud/pull/2560) loadbalancer: Use CreateMemberOpts instead of BatchUpdateMemberOpts in PoolCreateOpts -* [GH-2886](https://github.com/gophercloud/gophercloud/pull/2886) ports: Fix value_specs implementation -* [GH-2665](https://github.com/gophercloud/gophercloud/pull/2665) Cinder: Remove multiatttach request parameter -* [GH-2936](https://github.com/gophercloud/gophercloud/pull/2936) Make Gophercloud context-aware: all function signatures triggering an HTTP call now accept a context.Context for tracing and cancellation -* [GH-2970](https://github.com/gophercloud/gophercloud/pull/2970) Remove context from the Provider client -* [GH-2904](https://github.com/gophercloud/gophercloud/pull/2904) Remove error code types - -New features and improvements: - -* [GH-2486](https://github.com/gophercloud/gophercloud/pull/2486) Fix BareMetalV1 version -* [GH-2492](https://github.com/gophercloud/gophercloud/pull/2492) Add tags for loadbalancer l7policy and l7rule -* [GH-2560](https://github.com/gophercloud/gophercloud/pull/2560) loadbalancer: Use CreateMemberOpts instead of BatchUpdateMemberOpts in PoolCreateOpts -* [GH-2561](https://github.com/gophercloud/gophercloud/pull/2561) compute: add ext_specs to flavor -* [GH-2613](https://github.com/gophercloud/gophercloud/pull/2613) Migrate baremetal inventory to a common location -* [GH-2724](https://github.com/gophercloud/gophercloud/pull/2724) baremetal: introduce Node Inventory API -* [GH-2725](https://github.com/gophercloud/gophercloud/pull/2725) baremetal: finish moving common inventory bits -* [GH-2736](https://github.com/gophercloud/gophercloud/pull/2736) Composable templates -* [GH-2781](https://github.com/gophercloud/gophercloud/pull/2781) baremetal: support ironic native PluginData -* [GH-2791](https://github.com/gophercloud/gophercloud/pull/2791) Add microversion utilities -* [GH-2806](https://github.com/gophercloud/gophercloud/pull/2806) Fix list ports with multiple fixedip parameters -* [GH-2809](https://github.com/gophercloud/gophercloud/pull/2809) Remove code for CDN (poppy) -* [GH-2812](https://github.com/gophercloud/gophercloud/pull/2812) Revert "Fix baremetal jobs on Ubuntu 20.04" -* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) objects: Escape names in Gophercloud -* [GH-2828](https://github.com/gophercloud/gophercloud/pull/2828) Octavia: Add tags to resources missing them -* [GH-2834](https://github.com/gophercloud/gophercloud/pull/2834) baremetal: implemented ParsedLLDP in the standard PluginData -* [GH-2866](https://github.com/gophercloud/gophercloud/pull/2866) loadbalancer additional_vips by snigle -* [GH-2881](https://github.com/gophercloud/gophercloud/pull/2881) Adding missing QoS field for router -* [GH-2883](https://github.com/gophercloud/gophercloud/pull/2883) Context-aware methods to ProviderClient and ServiceClient -* [GH-2892](https://github.com/gophercloud/gophercloud/pull/2892) Authenticate with a clouds.yaml - -## v1.12.0 (2024-05-27) - -* [GH-2979](https://github.com/gophercloud/gophercloud/pull/2979) [v1] CI backports -* [GH-2985](https://github.com/gophercloud/gophercloud/pull/2985) [v1] baremetal: fix handling of the "fields" query argument -* [GH-2989](https://github.com/gophercloud/gophercloud/pull/2989) [v1] [CI] Fix portbiding tests -* [GH-2992](https://github.com/gophercloud/gophercloud/pull/2992) [v1] [CI] Fix portbiding tests -* [GH-2993](https://github.com/gophercloud/gophercloud/pull/2993) [v1] build(deps): bump EmilienM/devstack-action from 0.14 to 0.15 -* [GH-2998](https://github.com/gophercloud/gophercloud/pull/2998) [v1] testhelper: mark all helpers with t.Helper -* [GH-3043](https://github.com/gophercloud/gophercloud/pull/3043) [v1] CI: remove Zed from testing coverage - -## v1.11.0 (2024-03-07) - -This version reverts the inclusion of Context in the v1 branch. This inclusion -didn't add much value because no packages were using it; on the other hand, it -introduced a bug when using the Context property of the Provider client. - -## v1.10.0 (2024-02-27) **RETRACTED**: see https://github.com/gophercloud/gophercloud/issues/2969 - -* [GH-2893](https://github.com/gophercloud/gophercloud/pull/2893) [v1] authentication: Add WithContext functions -* [GH-2894](https://github.com/gophercloud/gophercloud/pull/2894) [v1] pager: Add WithContext functions -* [GH-2899](https://github.com/gophercloud/gophercloud/pull/2899) [v1] Authenticate with a clouds.yaml -* [GH-2917](https://github.com/gophercloud/gophercloud/pull/2917) [v1] Add ParseOption type to made clouds.Parse() more usable for optional With* funcs -* [GH-2924](https://github.com/gophercloud/gophercloud/pull/2924) [v1] build(deps): bump EmilienM/devstack-action from 0.11 to 0.14 -* [GH-2933](https://github.com/gophercloud/gophercloud/pull/2933) [v1] Fix AllowReauth reauthentication -* [GH-2950](https://github.com/gophercloud/gophercloud/pull/2950) [v1] compute: Use volumeID, not attachmentID for volume attachments - -## v1.9.0 (2024-02-02) **RETRACTED**: see https://github.com/gophercloud/gophercloud/issues/2969 - -New features and improvements: - -* [GH-2884](https://github.com/gophercloud/gophercloud/pull/2884) [v1] Context-aware methods to ProviderClient and ServiceClient -* [GH-2887](https://github.com/gophercloud/gophercloud/pull/2887) [v1] Add support of Flavors and FlavorProfiles for Octavia -* [GH-2875](https://github.com/gophercloud/gophercloud/pull/2875) [v1] [db/v1/instance]: adding support for availability_zone for a db instance - -CI changes: - -* [GH-2856](https://github.com/gophercloud/gophercloud/pull/2856) [v1] Fix devstack install on EOL magnum branches -* [GH-2857](https://github.com/gophercloud/gophercloud/pull/2857) [v1] Fix networking acceptance tests -* [GH-2858](https://github.com/gophercloud/gophercloud/pull/2858) [v1] build(deps): bump actions/upload-artifact from 3 to 4 -* [GH-2859](https://github.com/gophercloud/gophercloud/pull/2859) [v1] build(deps): bump github/codeql-action from 2 to 3 - -## v1.8.0 (2023-11-30) - -New features and improvements: - -* [GH-2800](https://github.com/gophercloud/gophercloud/pull/2800) [v1] Fix options initialization in ServiceClient.Request (fixes #2798) -* [GH-2823](https://github.com/gophercloud/gophercloud/pull/2823) [v1] Add more godoc to GuestFormat -* [GH-2826](https://github.com/gophercloud/gophercloud/pull/2826) Allow objects.CreateTempURL with names containing /v1/ - -CI changes: - -* [GH-2802](https://github.com/gophercloud/gophercloud/pull/2802) [v1] Add job for bobcat stable/2023.2 -* [GH-2819](https://github.com/gophercloud/gophercloud/pull/2819) [v1] Test files alongside code -* [GH-2814](https://github.com/gophercloud/gophercloud/pull/2814) Make fixtures part of tests -* [GH-2796](https://github.com/gophercloud/gophercloud/pull/2796) [v1] ci/unit: switch to coverallsapp/github-action -* [GH-2840](https://github.com/gophercloud/gophercloud/pull/2840) unit tests: Fix the installation of tools - -## v1.7.0 (2023-09-22) - -New features and improvements: - -* [GH-2782](https://github.com/gophercloud/gophercloud/pull/2782) [v1] (manual clean backport) Add tag field to compute block_device_v2 - -CI changes: - -* [GH-2760](https://github.com/gophercloud/gophercloud/pull/2760) [v1 backports] semver auto labels -* [GH-2775](https://github.com/gophercloud/gophercloud/pull/2775) [v1] Fix typos in comments -* [GH-2783](https://github.com/gophercloud/gophercloud/pull/2783) [v1] (clean manual backport) ci/functional: fix ubuntu version & add antelope -* [GH-2785](https://github.com/gophercloud/gophercloud/pull/2785) [v1] Acceptance: Handle numerical version names in version comparison helpers -* [GH-2787](https://github.com/gophercloud/gophercloud/pull/2787) backport-v1: fixes to semver label -* [GH-2788](https://github.com/gophercloud/gophercloud/pull/2788) [v1] Make acceptance tests internal - - -## v1.6.0 (2023-08-30) - -New features and improvements: - -* [GH-2712](https://github.com/gophercloud/gophercloud/pull/2712) [v1] README: minor change to test backport workflow -* [GH-2713](https://github.com/gophercloud/gophercloud/pull/2713) [v1] tests: run MultiAttach with a capable Cinder Type -* [GH-2714](https://github.com/gophercloud/gophercloud/pull/2714) [v1] Add CRUD support for encryption in volume v3 types -* [GH-2715](https://github.com/gophercloud/gophercloud/pull/2715) [v1] Add projectID to fwaas_v2 policy CreateOpts and ListOpts -* [GH-2716](https://github.com/gophercloud/gophercloud/pull/2716) [v1] Add projectID to fwaas_v2 CreateOpts -* [GH-2717](https://github.com/gophercloud/gophercloud/pull/2717) [v1] [manila]: add reset and force delete actions to a snapshot -* [GH-2718](https://github.com/gophercloud/gophercloud/pull/2718) [v1] [cinder]: add reset and force delete actions to volumes and snapshots -* [GH-2721](https://github.com/gophercloud/gophercloud/pull/2721) [v1] orchestration: Explicit error in optionsmap creation -* [GH-2723](https://github.com/gophercloud/gophercloud/pull/2723) [v1] Add conductor API to Baremetal V1 -* [GH-2729](https://github.com/gophercloud/gophercloud/pull/2729) [v1] networking/v2/ports: allow list filter by security group - -CI changes: - -* [GH-2675](https://github.com/gophercloud/gophercloud/pull/2675) [v1][CI] Drop periodic jobs from stable branch -* [GH-2683](https://github.com/gophercloud/gophercloud/pull/2683) [v1] CI tweaks - - -## v1.5.0 (2023-06-21) - -New features and improvements: - -* [GH-2634](https://github.com/gophercloud/gophercloud/pull/2634) baremetal: update inspection inventory with recent additions -* [GH-2635](https://github.com/gophercloud/gophercloud/pull/2635) [manila]: Add Share Replicas support -* [GH-2637](https://github.com/gophercloud/gophercloud/pull/2637) [FWaaS_v2]: Add FWaaS_V2 workflow and enable tests -* [GH-2639](https://github.com/gophercloud/gophercloud/pull/2639) Implement errors.Unwrap() on unexpected status code errors -* [GH-2648](https://github.com/gophercloud/gophercloud/pull/2648) [manila]: implement share transfer API - - -## v1.4.0 (2023-05-25) - -New features and improvements: - -* [GH-2465](https://github.com/gophercloud/gophercloud/pull/2465) keystone: add v3 limits update operation -* [GH-2596](https://github.com/gophercloud/gophercloud/pull/2596) keystone: add v3 limits get operation -* [GH-2618](https://github.com/gophercloud/gophercloud/pull/2618) keystone: add v3 limits delete operation -* [GH-2616](https://github.com/gophercloud/gophercloud/pull/2616) Add CRUD support for register limit APIs -* [GH-2610](https://github.com/gophercloud/gophercloud/pull/2610) Add PUT/HEAD/DELETE for identity/v3/OS-INHERIT -* [GH-2597](https://github.com/gophercloud/gophercloud/pull/2597) Add validation and optimise objects.BulkDelete -* [GH-2602](https://github.com/gophercloud/gophercloud/pull/2602) [swift v1]: introduce a TempURLKey argument for objects.CreateTempURLOpts struct -* [GH-2623](https://github.com/gophercloud/gophercloud/pull/2623) Add the ability to remove ingress/egress policies from fwaas_v2 groups -* [GH-2625](https://github.com/gophercloud/gophercloud/pull/2625) neutron: Support trunk_details extension - -CI changes: - -* [GH-2608](https://github.com/gophercloud/gophercloud/pull/2608) Drop train and ussuri jobs -* [GH-2589](https://github.com/gophercloud/gophercloud/pull/2589) Bump EmilienM/devstack-action from 0.10 to 0.11 -* [GH-2604](https://github.com/gophercloud/gophercloud/pull/2604) Bump mheap/github-action-required-labels from 3 to 4 -* [GH-2620](https://github.com/gophercloud/gophercloud/pull/2620) Pin goimport dep to a version that works with go 1.14 -* [GH-2619](https://github.com/gophercloud/gophercloud/pull/2619) Fix version comparison for acceptance tests -* [GH-2627](https://github.com/gophercloud/gophercloud/pull/2627) Limits: Fix ToDo to create registered limit and use it -* [GH-2629](https://github.com/gophercloud/gophercloud/pull/2629) [manila]: Add share from snapshot restore functional test - - -## v1.3.0 (2023-03-28) - -* [GH-2464](https://github.com/gophercloud/gophercloud/pull/2464) keystone: add v3 limits create operation -* [GH-2512](https://github.com/gophercloud/gophercloud/pull/2512) Manila: add List for share-access-rules API -* [GH-2529](https://github.com/gophercloud/gophercloud/pull/2529) Added target state "rebuild" for Ironic nodes -* [GH-2539](https://github.com/gophercloud/gophercloud/pull/2539) Add release instructions -* [GH-2540](https://github.com/gophercloud/gophercloud/pull/2540) [all] IsEmpty to check for HTTP status 204 -* [GH-2543](https://github.com/gophercloud/gophercloud/pull/2543) keystone: add v3 OS-FEDERATION mappings get operation -* [GH-2545](https://github.com/gophercloud/gophercloud/pull/2545) baremetal: add inspection_{started,finished}_at to Node -* [GH-2546](https://github.com/gophercloud/gophercloud/pull/2546) Drop train job for baremetal -* [GH-2549](https://github.com/gophercloud/gophercloud/pull/2549) objects: Clarify ExtractContent usage -* [GH-2550](https://github.com/gophercloud/gophercloud/pull/2550) keystone: add v3 OS-FEDERATION mappings update operation -* [GH-2552](https://github.com/gophercloud/gophercloud/pull/2552) objectstorage: Reject container names with a slash -* [GH-2555](https://github.com/gophercloud/gophercloud/pull/2555) nova: introduce servers.ListSimple along with the more detailed servers.List -* [GH-2558](https://github.com/gophercloud/gophercloud/pull/2558) Expand docs on 'clientconfig' usage -* [GH-2563](https://github.com/gophercloud/gophercloud/pull/2563) Support propagate_uplink_status for Ports -* [GH-2567](https://github.com/gophercloud/gophercloud/pull/2567) Fix invalid baremetal-introspection service type -* [GH-2568](https://github.com/gophercloud/gophercloud/pull/2568) Prefer github mirrors over opendev repos -* [GH-2571](https://github.com/gophercloud/gophercloud/pull/2571) Swift V1: support object versioning -* [GH-2572](https://github.com/gophercloud/gophercloud/pull/2572) networking v2: add extraroutes Add and Remove methods -* [GH-2573](https://github.com/gophercloud/gophercloud/pull/2573) Enable tests for object versioning -* [GH-2576](https://github.com/gophercloud/gophercloud/pull/2576) keystone: add v3 OS-FEDERATION mappings delete operation -* [GH-2578](https://github.com/gophercloud/gophercloud/pull/2578) Add periodic jobs for OpenStack zed release and reduce periodic jobs frequency -* [GH-2580](https://github.com/gophercloud/gophercloud/pull/2580) [neutron v2]: Add support for network segments update -* [GH-2583](https://github.com/gophercloud/gophercloud/pull/2583) Add missing rule protocol constants for IPIP -* [GH-2584](https://github.com/gophercloud/gophercloud/pull/2584) CI: workaround mongodb dependency for messaging and clustering master jobs -* [GH-2587](https://github.com/gophercloud/gophercloud/pull/2587) fix: Incorrect Documentation -* [GH-2593](https://github.com/gophercloud/gophercloud/pull/2593) Make TestMTUNetworkCRUDL deterministic -* [GH-2594](https://github.com/gophercloud/gophercloud/pull/2594) Bump actions/setup-go from 3 to 4 - - -## v1.2.0 (2023-01-27) - -Starting with this version, Gophercloud sends its actual version in the -user-agent string in the format `gophercloud/v1.2.0`. It no longer sends the -hardcoded string `gophercloud/2.0.0`. - -* [GH-2542](https://github.com/gophercloud/gophercloud/pull/2542) Add field hidden in containerinfra/v1/clustertemplates -* [GH-2537](https://github.com/gophercloud/gophercloud/pull/2537) Support value_specs for Ports -* [GH-2530](https://github.com/gophercloud/gophercloud/pull/2530) keystone: add v3 OS-FEDERATION mappings create operation -* [GH-2519](https://github.com/gophercloud/gophercloud/pull/2519) Modify user-agent header to ensure current gophercloud version is provided - -## v1.1.1 (2022-12-07) - -The GOPROXY cache for v1.1.0 was corrupted with a tag pointing to the wrong commit. This release fixes the problem by exposing a new release with the same content. - -Please use `v1.1.1` instead of `v1.1.0` to avoid cache issues. - -## v1.1.0 (2022-11-24) - -* [GH-2513](https://github.com/gophercloud/gophercloud/pull/2513) objectstorage: Do not parse NoContent responses -* [GH-2503](https://github.com/gophercloud/gophercloud/pull/2503) Bump golang.org/x/crypto -* [GH-2501](https://github.com/gophercloud/gophercloud/pull/2501) Staskraev/l3 agent scheduler -* [GH-2496](https://github.com/gophercloud/gophercloud/pull/2496) Manila: add Get for share-access-rules API -* [GH-2491](https://github.com/gophercloud/gophercloud/pull/2491) Add VipQosPolicyID to loadbalancer Create and Update -* [GH-2488](https://github.com/gophercloud/gophercloud/pull/2488) Add Persistance for octavia pools.UpdateOpts -* [GH-2487](https://github.com/gophercloud/gophercloud/pull/2487) Add Prometheus protocol for octavia listeners -* [GH-2482](https://github.com/gophercloud/gophercloud/pull/2482) Add createdAt, updatedAt and provisionUpdatedAt fields in Baremetal V1 nodes -* [GH-2479](https://github.com/gophercloud/gophercloud/pull/2479) Add service_types support for neutron subnet -* [GH-2477](https://github.com/gophercloud/gophercloud/pull/2477) Port CreatedAt and UpdatedAt: add back JSON tags -* [GH-2475](https://github.com/gophercloud/gophercloud/pull/2475) Support old time format for port CreatedAt and UpdatedAt -* [GH-2474](https://github.com/gophercloud/gophercloud/pull/2474) Implementing re-image volumeaction -* [GH-2470](https://github.com/gophercloud/gophercloud/pull/2470) keystone: add v3 limits GetEnforcementModel operation -* [GH-2468](https://github.com/gophercloud/gophercloud/pull/2468) keystone: add v3 OS-FEDERATION extension List Mappings -* [GH-2458](https://github.com/gophercloud/gophercloud/pull/2458) Fix typo in blockstorage/v3/attachments docs -* [GH-2456](https://github.com/gophercloud/gophercloud/pull/2456) Add support for Update for flavors -* [GH-2453](https://github.com/gophercloud/gophercloud/pull/2453) Add description to flavor -* [GH-2417](https://github.com/gophercloud/gophercloud/pull/2417) Neutron v2: ScheduleBGPSpeakerOpts, RemoveBGPSpeaker, Lis… - -## 1.0.0 (2022-08-29) - -UPGRADE NOTES + PROMISE OF COMPATIBILITY - -* Introducing Gophercloud v1! Like for every other release so far, all clients will upgrade automatically with `go get -d github.com/gophercloud/gophercloud` unless the dependency is pinned in `go.mod`. -* Gophercloud v1 comes with a promise of compatibility: no breaking changes are expected to merge before v2.0.0. - -IMPROVEMENTS - -* Added `compute.v2/extensions/services.Delete` [GH-2427](https://github.com/gophercloud/gophercloud/pull/2427) -* Added support for `standard-attr-revisions` to `networking/v2/networks`, `networking/v2/ports`, and `networking/v2/subnets` [GH-2437](https://github.com/gophercloud/gophercloud/pull/2437) -* Added `updated_at` and `created_at` fields to `networking/v2/ports.Port` [GH-2445](https://github.com/gophercloud/gophercloud/pull/2445) - -## 0.25.0 (May 30, 2022) - -BREAKING CHANGES - -* Replaced `blockstorage/noauth.NewBlockStorageNoAuth` with `NewBlockStorageNoAuthV2` and `NewBlockStorageNoAuthV3` [GH-2343](https://github.com/gophercloud/gophercloud/pull/2343) -* Renamed `blockstorage/extensions/schedulerstats.Capabilities`'s `GoodnessFuction` field to `GoodnessFunction` [GH-2346](https://github.com/gophercloud/gophercloud/pull/2346) - -IMPROVEMENTS - -* Added `RequestOpts.OmitHeaders` to provider client [GH-2315](https://github.com/gophercloud/gophercloud/pull/2315) -* Added `identity/v3/extensions/projectendpoints.List` [GH-2304](https://github.com/gophercloud/gophercloud/pull/2304) -* Added `identity/v3/extensions/projectendpoints.Create` [GH-2304](https://github.com/gophercloud/gophercloud/pull/2304) -* Added `identity/v3/extensions/projectendpoints.Delete` [GH-2304](https://github.com/gophercloud/gophercloud/pull/2304) -* Added protocol `any` to `networking/v2/extensions/security/rules.Create` [GH-2310](https://github.com/gophercloud/gophercloud/pull/2310) -* Added `REDIRECT_PREFIX` and `REDIRECT_HTTP_CODE` to `loadbalancer/v2/l7policies.Create` [GH-2324](https://github.com/gophercloud/gophercloud/pull/2324) -* Added `SOURCE_IP_PORT` LB method to `loadbalancer/v2/pools.Create` [GH-2300](https://github.com/gophercloud/gophercloud/pull/2300) -* Added `AllocatedCapacityGB` capability to `blockstorage/extensions/schedulerstats.Capabilities` [GH-2348](https://github.com/gophercloud/gophercloud/pull/2348) -* Added `Metadata` to `dns/v2/recordset.RecordSet` [GH-2353](https://github.com/gophercloud/gophercloud/pull/2353) -* Added missing fields to `compute/v2/extensions/servergroups.List` [GH-2355](https://github.com/gophercloud/gophercloud/pull/2355) -* Added missing labels fields to `containerinfra/v1/nodegroups` [GH-2377](https://github.com/gophercloud/gophercloud/pull/2377) -* Added missing fields to `loadbalancer/v2/listeners.Listener` [GH-2407](https://github.com/gophercloud/gophercloud/pull/2407) -* Added `identity/v3/limits.List` [GH-2360](https://github.com/gophercloud/gophercloud/pull/2360) -* Added `ParentProviderUUID` to `placement/v1/resourceproviders.Create` [GH-2356](https://github.com/gophercloud/gophercloud/pull/2356) -* Added `placement/v1/resourceproviders.Delete` [GH-2357](https://github.com/gophercloud/gophercloud/pull/2357) -* Added `placement/v1/resourceproviders.Get` [GH-2358](https://github.com/gophercloud/gophercloud/pull/2358) -* Added `placement/v1/resourceproviders.Update` [GH-2359](https://github.com/gophercloud/gophercloud/pull/2359) -* Added `networking/v2/extensions/bgp/peers.List` [GH-2241](https://github.com/gophercloud/gophercloud/pull/2241) -* Added `networking/v2/extensions/bgp/peers.Get` [GH-2241](https://github.com/gophercloud/gophercloud/pull/2241) -* Added `networking/v2/extensions/bgp/peers.Create` [GH-2388](https://github.com/gophercloud/gophercloud/pull/2388) -* Added `networking/v2/extensions/bgp/peers.Delete` [GH-2388](https://github.com/gophercloud/gophercloud/pull/2388) -* Added `networking/v2/extensions/bgp/peers.Update` [GH-2396](https://github.com/gophercloud/gophercloud/pull/2396) -* Added `networking/v2/extensions/bgp/speakers.Create` [GH-2395](https://github.com/gophercloud/gophercloud/pull/2395) -* Added `networking/v2/extensions/bgp/speakers.Delete` [GH-2395](https://github.com/gophercloud/gophercloud/pull/2395) -* Added `networking/v2/extensions/bgp/speakers.Update` [GH-2400](https://github.com/gophercloud/gophercloud/pull/2400) -* Added `networking/v2/extensions/bgp/speakers.AddBGPPeer` [GH-2400](https://github.com/gophercloud/gophercloud/pull/2400) -* Added `networking/v2/extensions/bgp/speakers.RemoveBGPPeer` [GH-2400](https://github.com/gophercloud/gophercloud/pull/2400) -* Added `networking/v2/extensions/bgp/speakers.GetAdvertisedRoutes` [GH-2406](https://github.com/gophercloud/gophercloud/pull/2406) -* Added `networking/v2/extensions/bgp/speakers.AddGatewayNetwork` [GH-2406](https://github.com/gophercloud/gophercloud/pull/2406) -* Added `networking/v2/extensions/bgp/speakers.RemoveGatewayNetwork` [GH-2406](https://github.com/gophercloud/gophercloud/pull/2406) -* Added `baremetal/v1/nodes.SetMaintenance` and `baremetal/v1/nodes.UnsetMaintenance` [GH-2384](https://github.com/gophercloud/gophercloud/pull/2384) -* Added `sharedfilesystems/v2/services.List` [GH-2350](https://github.com/gophercloud/gophercloud/pull/2350) -* Added `sharedfilesystems/v2/schedulerstats.List` [GH-2350](https://github.com/gophercloud/gophercloud/pull/2350) -* Added `sharedfilesystems/v2/schedulerstats.ListDetail` [GH-2350](https://github.com/gophercloud/gophercloud/pull/2350) -* Added ability to handle 502 and 504 errors [GH-2245](https://github.com/gophercloud/gophercloud/pull/2245) -* Added `IncludeSubtree` to `identity/v3/roles.ListAssignments` [GH-2411](https://github.com/gophercloud/gophercloud/pull/2411) - -## 0.24.0 (December 13, 2021) - -UPGRADE NOTES - -* Set Go minimum version to 1.14 [GH-2294](https://github.com/gophercloud/gophercloud/pull/2294) - -IMPROVEMENTS - -* Added `blockstorage/v3/qos.Get` [GH-2283](https://github.com/gophercloud/gophercloud/pull/2283) -* Added `blockstorage/v3/qos.Update` [GH-2283](https://github.com/gophercloud/gophercloud/pull/2283) -* Added `blockstorage/v3/qos.DeleteKeys` [GH-2283](https://github.com/gophercloud/gophercloud/pull/2283) -* Added `blockstorage/v3/qos.Associate` [GH-2284](https://github.com/gophercloud/gophercloud/pull/2284) -* Added `blockstorage/v3/qos.Disassociate` [GH-2284](https://github.com/gophercloud/gophercloud/pull/2284) -* Added `blockstorage/v3/qos.DisassociateAll` [GH-2284](https://github.com/gophercloud/gophercloud/pull/2284) -* Added `blockstorage/v3/qos.ListAssociations` [GH-2284](https://github.com/gophercloud/gophercloud/pull/2284) - -## 0.23.0 (November 12, 2021) - -IMPROVEMENTS - -* Added `networking/v2/extensions/agents.ListBGPSpeakers` [GH-2229](https://github.com/gophercloud/gophercloud/pull/2229) -* Added `networking/v2/extensions/bgp/speakers.BGPSpeaker` [GH-2229](https://github.com/gophercloud/gophercloud/pull/2229) -* Added `identity/v3/roles.Project.Domain` [GH-2235](https://github.com/gophercloud/gophercloud/pull/2235) -* Added `identity/v3/roles.User.Domain` [GH-2235](https://github.com/gophercloud/gophercloud/pull/2235) -* Added `identity/v3/roles.Group.Domain` [GH-2235](https://github.com/gophercloud/gophercloud/pull/2235) -* Added `loadbalancer/v2/pools.CreateOpts.Tags` [GH-2237](https://github.com/gophercloud/gophercloud/pull/2237) -* Added `loadbalancer/v2/pools.UpdateOpts.Tags` [GH-2237](https://github.com/gophercloud/gophercloud/pull/2237) -* Added `loadbalancer/v2/pools.Pool.Tags` [GH-2237](https://github.com/gophercloud/gophercloud/pull/2237) -* Added `networking/v2/extensions/bgp/speakers.List` [GH-2238](https://github.com/gophercloud/gophercloud/pull/2238) -* Added `networking/v2/extensions/bgp/speakers.Get` [GH-2238](https://github.com/gophercloud/gophercloud/pull/2238) -* Added `compute/v2/extensions/keypairs.CreateOpts.Type` [GH-2231](https://github.com/gophercloud/gophercloud/pull/2231) -* When doing Keystone re-authentification, keep the error if it failed [GH-2259](https://github.com/gophercloud/gophercloud/pull/2259) -* Added new loadbalancer pool monitor types (TLS-HELLO, UDP-CONNECT and SCTP) [GH-2237](https://github.com/gophercloud/gophercloud/pull/2261) - -## 0.22.0 (October 7, 2021) - -BREAKING CHANGES - -* The types of several Object Storage Update fields have been changed to pointers in order to allow the value to be unset via the HTTP headers: - * `objectstorage/v1/accounts.UpdateOpts.ContentType` - * `objectstorage/v1/accounts.UpdateOpts.DetectContentType` - * `objectstorage/v1/containers.UpdateOpts.ContainerRead` - * `objectstorage/v1/containers.UpdateOpts.ContainerSyncTo` - * `objectstorage/v1/containers.UpdateOpts.ContainerSyncKey` - * `objectstorage/v1/containers.UpdateOpts.ContainerWrite` - * `objectstorage/v1/containers.UpdateOpts.ContentType` - * `objectstorage/v1/containers.UpdateOpts.DetectContentType` - * `objectstorage/v1/objects.UpdateOpts.ContentDisposition` - * `objectstorage/v1/objects.UpdateOpts.ContentEncoding` - * `objectstorage/v1/objects.UpdateOpts.ContentType` - * `objectstorage/v1/objects.UpdateOpts.DeleteAfter` - * `objectstorage/v1/objects.UpdateOpts.DeleteAt` - * `objectstorage/v1/objects.UpdateOpts.DetectContentType` - -BUG FIXES - -* Fixed issue with not being able to unset Object Storage values via HTTP headers [GH-2218](https://github.com/gophercloud/gophercloud/pull/2218) - -IMPROVEMENTS - -* Added `compute/v2/servers.Server.ServerGroups` [GH-2217](https://github.com/gophercloud/gophercloud/pull/2217) -* Added `imageservice/v2/images.ReplaceImageProtected` to allow the `protected` field to be updated [GH-2221](https://github.com/gophercloud/gophercloud/pull/2221) -* More details added to the 404/Not Found error message [GH-2223](https://github.com/gophercloud/gophercloud/pull/2223) -* Added `openstack/baremetal/v1/nodes.CreateSubscriptionOpts.HttpHeaders` [GH-2224](https://github.com/gophercloud/gophercloud/pull/2224) - -## 0.21.0 (September 14, 2021) - -IMPROVEMENTS - -* Added `blockstorage/extensions/volumehost` [GH-2212](https://github.com/gophercloud/gophercloud/pull/2212) -* Added `loadbalancer/v2/listeners.CreateOpts.Tags` [GH-2214](https://github.com/gophercloud/gophercloud/pull/2214) -* Added `loadbalancer/v2/listeners.UpdateOpts.Tags` [GH-2214](https://github.com/gophercloud/gophercloud/pull/2214) -* Added `loadbalancer/v2/listeners.Listener.Tags` [GH-2214](https://github.com/gophercloud/gophercloud/pull/2214) - -## 0.20.0 (August 10, 2021) - -IMPROVEMENTS - -* Added `RetryFunc` to enable custom retry functions. [GH-2194](https://github.com/gophercloud/gophercloud/pull/2194) -* Added `openstack/baremetal/v1/nodes.GetVendorPassthruMethods` [GH-2201](https://github.com/gophercloud/gophercloud/pull/2201) -* Added `openstack/baremetal/v1/nodes.GetAllSubscriptions` [GH-2201](https://github.com/gophercloud/gophercloud/pull/2201) -* Added `openstack/baremetal/v1/nodes.GetSubscription` [GH-2201](https://github.com/gophercloud/gophercloud/pull/2201) -* Added `openstack/baremetal/v1/nodes.DeleteSubscription` [GH-2201](https://github.com/gophercloud/gophercloud/pull/2201) -* Added `openstack/baremetal/v1/nodes.CreateSubscription` [GH-2201](https://github.com/gophercloud/gophercloud/pull/2201) - -## 0.19.0 (July 22, 2021) - -NOTES / BREAKING CHANGES - -* `compute/v2/extensions/keypairs.List` now takes a `ListOptsBuilder` argument [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* `compute/v2/extensions/keypairs.Get` now takes a `GetOptsBuilder` argument [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* `compute/v2/extensions/keypairs.Delete` now takes a `DeleteOptsBuilder` argument [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* `compute/v2/extensions/hypervisors.List` now takes a `ListOptsBuilder` argument [GH-2187](https://github.com/gophercloud/gophercloud/pull/2187) - -IMPROVEMENTS - -* Added `blockstorage/v3/qos.List` [GH-2167](https://github.com/gophercloud/gophercloud/pull/2167) -* Added `compute/v2/extensions/volumeattach.CreateOpts.Tag` [GH-2177](https://github.com/gophercloud/gophercloud/pull/2177) -* Added `compute/v2/extensions/volumeattach.CreateOpts.DeleteOnTermination` [GH-2177](https://github.com/gophercloud/gophercloud/pull/2177) -* Added `compute/v2/extensions/volumeattach.VolumeAttachment.Tag` [GH-2177](https://github.com/gophercloud/gophercloud/pull/2177) -* Added `compute/v2/extensions/volumeattach.VolumeAttachment.DeleteOnTermination` [GH-2177](https://github.com/gophercloud/gophercloud/pull/2177) -* Added `db/v1/instances.Instance.Address` [GH-2179](https://github.com/gophercloud/gophercloud/pull/2179) -* Added `compute/v2/servers.ListOpts.AvailabilityZone` [GH-2098](https://github.com/gophercloud/gophercloud/pull/2098) -* Added `compute/v2/extensions/keypairs.ListOpts` [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* Added `compute/v2/extensions/keypairs.GetOpts` [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* Added `compute/v2/extensions/keypairs.DeleteOpts` [GH-2186](https://github.com/gophercloud/gophercloud/pull/2186) -* Added `objectstorage/v2/containers.GetHeader.Timestamp` [GH-2185](https://github.com/gophercloud/gophercloud/pull/2185) -* Added `compute/v2/extensions.ListOpts` [GH-2187](https://github.com/gophercloud/gophercloud/pull/2187) -* Added `sharedfilesystems/v2/shares.Share.CreateShareFromSnapshotSupport` [GH-2191](https://github.com/gophercloud/gophercloud/pull/2191) -* Added `compute/v2/servers.Network.Tag` for use in `CreateOpts` [GH-2193](https://github.com/gophercloud/gophercloud/pull/2193) - -## 0.18.0 (June 11, 2021) - -NOTES / BREAKING CHANGES - -* As of [GH-2160](https://github.com/gophercloud/gophercloud/pull/2160), Gophercloud no longer URL encodes Object Storage containers and object names. You can still encode them yourself before passing the names to the Object Storage functions. - -* `baremetal/v1/nodes.ListBIOSSettings` now takes three parameters. The third, new, parameter is `ListBIOSSettingsOptsBuilder` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) - -BUG FIXES - -* Fixed expected OK codes to use default codes [GH-2173](https://github.com/gophercloud/gophercloud/pull/2173) -* Fixed inablity to create sub-containers (objects with `/` in their name) [GH-2160](https://github.com/gophercloud/gophercloud/pull/2160) - -IMPROVEMENTS - -* Added `orchestration/v1/stacks.ListOpts.ShowHidden` [GH-2104](https://github.com/gophercloud/gophercloud/pull/2104) -* Added `loadbalancer/v2/listeners.ProtocolSCTP` [GH-2149](https://github.com/gophercloud/gophercloud/pull/2149) -* Added `loadbalancer/v2/listeners.CreateOpts.TLSVersions` [GH-2150](https://github.com/gophercloud/gophercloud/pull/2150) -* Added `loadbalancer/v2/listeners.UpdateOpts.TLSVersions` [GH-2150](https://github.com/gophercloud/gophercloud/pull/2150) -* Added `baremetal/v1/nodes.CreateOpts.NetworkData` [GH-2154](https://github.com/gophercloud/gophercloud/pull/2154) -* Added `baremetal/v1/nodes.Node.NetworkData` [GH-2154](https://github.com/gophercloud/gophercloud/pull/2154) -* Added `loadbalancer/v2/pools.ProtocolPROXYV2` [GH-2158](https://github.com/gophercloud/gophercloud/pull/2158) -* Added `loadbalancer/v2/pools.ProtocolSCTP` [GH-2158](https://github.com/gophercloud/gophercloud/pull/2158) -* Added `placement/v1/resourceproviders.GetAllocations` [GH-2162](https://github.com/gophercloud/gophercloud/pull/2162) -* Added `baremetal/v1/nodes.CreateOpts.BIOSInterface` [GH-2164](https://github.com/gophercloud/gophercloud/pull/2164) -* Added `baremetal/v1/nodes.Node.BIOSInterface` [GH-2164](https://github.com/gophercloud/gophercloud/pull/2164) -* Added `baremetal/v1/nodes.NodeValidation.BIOS` [GH-2164](https://github.com/gophercloud/gophercloud/pull/2164) -* Added `baremetal/v1/nodes.ListBIOSSettings` [GH-2171](https://github.com/gophercloud/gophercloud/pull/2171) -* Added `baremetal/v1/nodes.GetBIOSSetting` [GH-2171](https://github.com/gophercloud/gophercloud/pull/2171) -* Added `baremetal/v1/nodes.ListBIOSSettingsOpts` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.AttributeType` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.AllowableValues` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.LowerBound` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.UpperBound` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.MinLength` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.MaxLength` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.ReadOnly` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.ResetRequired` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) -* Added `baremetal/v1/nodes.BIOSSetting.Unique` [GH-2174](https://github.com/gophercloud/gophercloud/pull/2174) - -## 0.17.0 (April 9, 2021) - -IMPROVEMENTS - -* `networking/v2/extensions/quotas.QuotaDetail.Reserved` can handle both `int` and `string` values [GH-2126](https://github.com/gophercloud/gophercloud/pull/2126) -* Added `blockstorage/v3/volumetypes.ListExtraSpecs` [GH-2123](https://github.com/gophercloud/gophercloud/pull/2123) -* Added `blockstorage/v3/volumetypes.GetExtraSpec` [GH-2123](https://github.com/gophercloud/gophercloud/pull/2123) -* Added `blockstorage/v3/volumetypes.CreateExtraSpecs` [GH-2123](https://github.com/gophercloud/gophercloud/pull/2123) -* Added `blockstorage/v3/volumetypes.UpdateExtraSpec` [GH-2123](https://github.com/gophercloud/gophercloud/pull/2123) -* Added `blockstorage/v3/volumetypes.DeleteExtraSpec` [GH-2123](https://github.com/gophercloud/gophercloud/pull/2123) -* Added `identity/v3/roles.ListAssignmentOpts.IncludeNames` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `identity/v3/roles.AssignedRoles.Name` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `identity/v3/roles.Domain.Name` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `identity/v3/roles.Project.Name` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `identity/v3/roles.User.Name` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `identity/v3/roles.Group.Name` [GH-2133](https://github.com/gophercloud/gophercloud/pull/2133) -* Added `blockstorage/extensions/availabilityzones.List` [GH-2135](https://github.com/gophercloud/gophercloud/pull/2135) -* Added `blockstorage/v3/volumetypes.ListAccesses` [GH-2138](https://github.com/gophercloud/gophercloud/pull/2138) -* Added `blockstorage/v3/volumetypes.AddAccess` [GH-2138](https://github.com/gophercloud/gophercloud/pull/2138) -* Added `blockstorage/v3/volumetypes.RemoveAccess` [GH-2138](https://github.com/gophercloud/gophercloud/pull/2138) -* Added `blockstorage/v3/qos.Create` [GH-2140](https://github.com/gophercloud/gophercloud/pull/2140) -* Added `blockstorage/v3/qos.Delete` [GH-2140](https://github.com/gophercloud/gophercloud/pull/2140) - -## 0.16.0 (February 23, 2021) - -UPGRADE NOTES - -* `baremetal/v1/nodes.CleanStep.Interface` has changed from `string` to `StepInterface` [GH-2120](https://github.com/gophercloud/gophercloud/pull/2120) - -BUG FIXES - -* Fixed `xor` logic issues in `loadbalancers/v2/l7policies.CreateOpts` [GH-2087](https://github.com/gophercloud/gophercloud/pull/2087) -* Fixed `xor` logic issues in `loadbalancers/v2/listeners.CreateOpts` [GH-2087](https://github.com/gophercloud/gophercloud/pull/2087) -* Fixed `If-Modified-Since` so it's correctly sent in a `objectstorage/v1/objects.Download` request [GH-2108](https://github.com/gophercloud/gophercloud/pull/2108) -* Fixed `If-Unmodified-Since` so it's correctly sent in a `objectstorage/v1/objects.Download` request [GH-2108](https://github.com/gophercloud/gophercloud/pull/2108) - -IMPROVEMENTS - -* Added `blockstorage/extensions/limits.Get` [GH-2084](https://github.com/gophercloud/gophercloud/pull/2084) -* `clustering/v1/clusters.RemoveNodes` now returns an `ActionResult` [GH-2089](https://github.com/gophercloud/gophercloud/pull/2089) -* Added `identity/v3/projects.ListAvailable` [GH-2090](https://github.com/gophercloud/gophercloud/pull/2090) -* Added `blockstorage/extensions/backups.ListDetail` [GH-2085](https://github.com/gophercloud/gophercloud/pull/2085) -* Allow all ports to be removed in `networking/v2/extensions/fwaas_v2/groups.UpdateOpts` [GH-2073] -* Added `imageservice/v2/images.ListOpts.Hidden` [GH-2094](https://github.com/gophercloud/gophercloud/pull/2094) -* Added `imageservice/v2/images.CreateOpts.Hidden` [GH-2094](https://github.com/gophercloud/gophercloud/pull/2094) -* Added `imageservice/v2/images.ReplaceImageHidden` [GH-2094](https://github.com/gophercloud/gophercloud/pull/2094) -* Added `imageservice/v2/images.Image.Hidden` [GH-2094](https://github.com/gophercloud/gophercloud/pull/2094) -* Added `containerinfra/v1/clusters.CreateOpts.MasterLBEnabled` [GH-2102](https://github.com/gophercloud/gophercloud/pull/2102) -* Added the ability to define a custom function to handle "Retry-After" (429) responses [GH-2097](https://github.com/gophercloud/gophercloud/pull/2097) -* Added `baremetal/v1/nodes.JBOD` constant for the `RAIDLevel` type [GH-2103](https://github.com/gophercloud/gophercloud/pull/2103) -* Added support for Block Storage quotas of volume typed resources [GH-2109](https://github.com/gophercloud/gophercloud/pull/2109) -* Added `blockstorage/extensions/volumeactions.ChangeType` [GH-2113](https://github.com/gophercloud/gophercloud/pull/2113) -* Added `baremetal/v1/nodes.DeployStep` [GH-2120](https://github.com/gophercloud/gophercloud/pull/2120) -* Added `baremetal/v1/nodes.ProvisionStateOpts.DeploySteps` [GH-2120](https://github.com/gophercloud/gophercloud/pull/2120) -* Added `baremetal/v1/nodes.CreateOpts.AutomatedClean` [GH-2122](https://github.com/gophercloud/gophercloud/pull/2122) - -## 0.15.0 (December 27, 2020) - -BREAKING CHANGES - -* `compute/v2/extensions/servergroups.List` now takes a `ListOpts` parameter. You can pass `nil` if you don't need to use this. - -IMPROVEMENTS - -* Added `loadbalancer/v2/pools.CreateMemberOpts.Tags` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.UpdateMemberOpts.Backup` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.UpdateMemberOpts.MonitorAddress` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.UpdateMemberOpts.MonitorPort` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.UpdateMemberOpts.Tags` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.BatchUpdateMemberOpts.Backup` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.BatchUpdateMemberOpts.MonitorAddress` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.BatchUpdateMemberOpts.MonitorPort` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `loadbalancer/v2/pools.BatchUpdateMemberOpts.Tags` [GH-2056](https://github.com/gophercloud/gophercloud/pull/2056) -* Added `networking/v2/extensions/quotas.GetDetail` [GH-2061](https://github.com/gophercloud/gophercloud/pull/2061) -* Added `networking/v2/extensions/quotas.UpdateOpts.Trunk` [GH-2061](https://github.com/gophercloud/gophercloud/pull/2061) -* Added `objectstorage/v1/accounts.UpdateOpts.RemoveMetadata` [GH-2063](https://github.com/gophercloud/gophercloud/pull/2063) -* Added `objectstorage/v1/objects.UpdateOpts.RemoveMetadata` [GH-2063](https://github.com/gophercloud/gophercloud/pull/2063) -* Added `identity/v3/catalog.List` [GH-2067](https://github.com/gophercloud/gophercloud/pull/2067) -* Added `networking/v2/extensions/fwaas_v2/policies.List` [GH-2057](https://github.com/gophercloud/gophercloud/pull/2057) -* Added `networking/v2/extensions/fwaas_v2/policies.Create` [GH-2057](https://github.com/gophercloud/gophercloud/pull/2057) -* Added `networking/v2/extensions/fwaas_v2/policies.Get` [GH-2057](https://github.com/gophercloud/gophercloud/pull/2057) -* Added `networking/v2/extensions/fwaas_v2/policies.Update` [GH-2057](https://github.com/gophercloud/gophercloud/pull/2057) -* Added `networking/v2/extensions/fwaas_v2/policies.Delete` [GH-2057](https://github.com/gophercloud/gophercloud/pull/2057) -* Added `compute/v2/extensions/servergroups.ListOpts.AllProjects` [GH-2070](https://github.com/gophercloud/gophercloud/pull/2070) -* Added `objectstorage/v1/containers.CreateOpts.StoragePolicy` [GH-2075](https://github.com/gophercloud/gophercloud/pull/2075) -* Added `blockstorage/v3/snapshots.Update` [GH-2081](https://github.com/gophercloud/gophercloud/pull/2081) -* Added `loadbalancer/v2/l7policies.CreateOpts.Rules` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/listeners.CreateOpts.DefaultPool` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/listeners.CreateOpts.L7Policies` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/listeners.Listener.DefaultPool` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/loadbalancers.CreateOpts.Listeners` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/loadbalancers.CreateOpts.Pools` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/pools.CreateOpts.Members` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) -* Added `loadbalancer/v2/pools.CreateOpts.Monitor` [GH-2077](https://github.com/gophercloud/gophercloud/pull/2077) - - -## 0.14.0 (November 11, 2020) - -IMPROVEMENTS - -* Added `identity/v3/endpoints.Endpoint.Enabled` [GH-2030](https://github.com/gophercloud/gophercloud/pull/2030) -* Added `containerinfra/v1/clusters.Upgrade` [GH-2032](https://github.com/gophercloud/gophercloud/pull/2032) -* Added `compute/apiversions.List` [GH-2037](https://github.com/gophercloud/gophercloud/pull/2037) -* Added `compute/apiversions.Get` [GH-2037](https://github.com/gophercloud/gophercloud/pull/2037) -* Added `compute/v2/servers.ListOpts.IP` [GH-2038](https://github.com/gophercloud/gophercloud/pull/2038) -* Added `compute/v2/servers.ListOpts.IP6` [GH-2038](https://github.com/gophercloud/gophercloud/pull/2038) -* Added `compute/v2/servers.ListOpts.UserID` [GH-2038](https://github.com/gophercloud/gophercloud/pull/2038) -* Added `dns/v2/transfer/accept.List` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/accept.Get` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/accept.Create` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/requests.List` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/requests.Get` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/requests.Update` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `dns/v2/transfer/requests.Delete` [GH-2041](https://github.com/gophercloud/gophercloud/pull/2041) -* Added `baremetal/v1/nodes.RescueWait` [GH-2052](https://github.com/gophercloud/gophercloud/pull/2052) -* Added `baremetal/v1/nodes.Unrescuing` [GH-2052](https://github.com/gophercloud/gophercloud/pull/2052) -* Added `networking/v2/extensions/fwaas_v2/groups.List` [GH-2050](https://github.com/gophercloud/gophercloud/pull/2050) -* Added `networking/v2/extensions/fwaas_v2/groups.Get` [GH-2050](https://github.com/gophercloud/gophercloud/pull/2050) -* Added `networking/v2/extensions/fwaas_v2/groups.Create` [GH-2050](https://github.com/gophercloud/gophercloud/pull/2050) -* Added `networking/v2/extensions/fwaas_v2/groups.Update` [GH-2050](https://github.com/gophercloud/gophercloud/pull/2050) -* Added `networking/v2/extensions/fwaas_v2/groups.Delete` [GH-2050](https://github.com/gophercloud/gophercloud/pull/2050) - -BUG FIXES - -* Changed `networking/v2/extensions/layer3/routers.Routes` from `[]Route` to `*[]Route` [GH-2043](https://github.com/gophercloud/gophercloud/pull/2043) - -## 0.13.0 (September 27, 2020) - -IMPROVEMENTS - -* Added `ProtocolTerminatedHTTPS` as a valid listener protocol to `loadbalancer/v2/listeners` [GH-1992](https://github.com/gophercloud/gophercloud/pull/1992) -* Added `objectstorage/v1/objects.CreateTempURLOpts.Timestamp` [GH-1994](https://github.com/gophercloud/gophercloud/pull/1994) -* Added `compute/v2/extensions/schedulerhints.SchedulerHints.DifferentCell` [GH-2012](https://github.com/gophercloud/gophercloud/pull/2012) -* Added `loadbalancer/v2/quotas.Get` [GH-2010](https://github.com/gophercloud/gophercloud/pull/2010) -* Added `messaging/v2/queues.CreateOpts.EnableEncryptMessages` [GH-2016](https://github.com/gophercloud/gophercloud/pull/2016) -* Added `messaging/v2/queues.ListOpts.Name` [GH-2018](https://github.com/gophercloud/gophercloud/pull/2018) -* Added `messaging/v2/queues.ListOpts.WithCount` [GH-2018](https://github.com/gophercloud/gophercloud/pull/2018) -* Added `loadbalancer/v2/quotas.Update` [GH-2023](https://github.com/gophercloud/gophercloud/pull/2023) -* Added `loadbalancer/v2/loadbalancers.ListOpts.AvailabilityZone` [GH-2026](https://github.com/gophercloud/gophercloud/pull/2026) -* Added `loadbalancer/v2/loadbalancers.CreateOpts.AvailabilityZone` [GH-2026](https://github.com/gophercloud/gophercloud/pull/2026) -* Added `loadbalancer/v2/loadbalancers.LoadBalancer.AvailabilityZone` [GH-2026](https://github.com/gophercloud/gophercloud/pull/2026) -* Added `networking/v2/extensions/layer3/routers.ListL3Agents` [GH-2025](https://github.com/gophercloud/gophercloud/pull/2025) - -BUG FIXES - -* Fixed URL escaping in `objectstorage/v1/objects.CreateTempURL` [GH-1994](https://github.com/gophercloud/gophercloud/pull/1994) -* Remove unused `ServiceClient` from `compute/v2/servers.CreateOpts` [GH-2004](https://github.com/gophercloud/gophercloud/pull/2004) -* Changed `objectstorage/v1/objects.CreateOpts.DeleteAfter` from `int` to `int64` [GH-2014](https://github.com/gophercloud/gophercloud/pull/2014) -* Changed `objectstorage/v1/objects.CreateOpts.DeleteAt` from `int` to `int64` [GH-2014](https://github.com/gophercloud/gophercloud/pull/2014) -* Changed `objectstorage/v1/objects.UpdateOpts.DeleteAfter` from `int` to `int64` [GH-2014](https://github.com/gophercloud/gophercloud/pull/2014) -* Changed `objectstorage/v1/objects.UpdateOpts.DeleteAt` from `int` to `int64` [GH-2014](https://github.com/gophercloud/gophercloud/pull/2014) - - -## 0.12.0 (June 25, 2020) - -UPGRADE NOTES - -* The URL used in the `compute/v2/extensions/bootfromvolume` package has been changed from `os-volumes_boot` to `servers`. - -IMPROVEMENTS - -* The URL used in the `compute/v2/extensions/bootfromvolume` package has been changed from `os-volumes_boot` to `servers` [GH-1973](https://github.com/gophercloud/gophercloud/pull/1973) -* Modify `baremetal/v1/nodes.LogicalDisk.PhysicalDisks` type to support physical disks hints [GH-1982](https://github.com/gophercloud/gophercloud/pull/1982) -* Added `baremetalintrospection/httpbasic` which provides an HTTP Basic Auth client [GH-1986](https://github.com/gophercloud/gophercloud/pull/1986) -* Added `baremetal/httpbasic` which provides an HTTP Basic Auth client [GH-1983](https://github.com/gophercloud/gophercloud/pull/1983) -* Added `containerinfra/v1/clusters.CreateOpts.MergeLabels` [GH-1985](https://github.com/gophercloud/gophercloud/pull/1985) - -BUG FIXES - -* Changed `containerinfra/v1/clusters.Cluster.HealthStatusReason` from `string` to `map[string]interface{}` [GH-1968](https://github.com/gophercloud/gophercloud/pull/1968) -* Fixed marshalling of `blockstorage/extensions/backups.ImportBackup.Metadata` [GH-1967](https://github.com/gophercloud/gophercloud/pull/1967) -* Fixed typo of "OAUth" to "OAuth" in `identity/v3/extensions/oauth1` [GH-1969](https://github.com/gophercloud/gophercloud/pull/1969) -* Fixed goroutine leak during reauthentication [GH-1978](https://github.com/gophercloud/gophercloud/pull/1978) -* Changed `baremetalintrospection/v1/introspection.RootDiskType.Size` from `int` to `int64` [GH-1988](https://github.com/gophercloud/gophercloud/pull/1988) - -## 0.11.0 (May 14, 2020) - -UPGRADE NOTES - -* Object storage container and object names are now URL encoded [GH-1930](https://github.com/gophercloud/gophercloud/pull/1930) -* All responses now have access to the returned headers. Please report any issues this has caused [GH-1942](https://github.com/gophercloud/gophercloud/pull/1942) -* Changes have been made to the internal HTTP client to ensure response bodies are handled in a way that enables connections to be re-used more efficiently [GH-1952](https://github.com/gophercloud/gophercloud/pull/1952) - -IMPROVEMENTS - -* Added `objectstorage/v1/containers.BulkDelete` [GH-1930](https://github.com/gophercloud/gophercloud/pull/1930) -* Added `objectstorage/v1/objects.BulkDelete` [GH-1930](https://github.com/gophercloud/gophercloud/pull/1930) -* Object storage container and object names are now URL encoded [GH-1930](https://github.com/gophercloud/gophercloud/pull/1930) -* All responses now have access to the returned headers [GH-1942](https://github.com/gophercloud/gophercloud/pull/1942) -* Added `compute/v2/extensions/injectnetworkinfo.InjectNetworkInfo` [GH-1941](https://github.com/gophercloud/gophercloud/pull/1941) -* Added `compute/v2/extensions/resetnetwork.ResetNetwork` [GH-1941](https://github.com/gophercloud/gophercloud/pull/1941) -* Added `identity/v3/extensions/trusts.ListRoles` [GH-1939](https://github.com/gophercloud/gophercloud/pull/1939) -* Added `identity/v3/extensions/trusts.GetRole` [GH-1939](https://github.com/gophercloud/gophercloud/pull/1939) -* Added `identity/v3/extensions/trusts.CheckRole` [GH-1939](https://github.com/gophercloud/gophercloud/pull/1939) -* Added `identity/v3/extensions/oauth1.Create` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.CreateConsumer` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.DeleteConsumer` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.ListConsumers` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.GetConsumer` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.UpdateConsumer` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.RequestToken` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.AuthorizeToken` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.CreateAccessToken` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.GetAccessToken` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.RevokeAccessToken` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.ListAccessTokens` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.ListAccessTokenRoles` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `identity/v3/extensions/oauth1.GetAccessTokenRole` [GH-1935](https://github.com/gophercloud/gophercloud/pull/1935) -* Added `networking/v2/extensions/agents.Update` [GH-1954](https://github.com/gophercloud/gophercloud/pull/1954) -* Added `networking/v2/extensions/agents.Delete` [GH-1954](https://github.com/gophercloud/gophercloud/pull/1954) -* Added `networking/v2/extensions/agents.ScheduleDHCPNetwork` [GH-1954](https://github.com/gophercloud/gophercloud/pull/1954) -* Added `networking/v2/extensions/agents.RemoveDHCPNetwork` [GH-1954](https://github.com/gophercloud/gophercloud/pull/1954) -* Added `identity/v3/projects.CreateOpts.Extra` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `identity/v3/projects.CreateOpts.Options` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `identity/v3/projects.UpdateOpts.Extra` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `identity/v3/projects.UpdateOpts.Options` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `identity/v3/projects.Project.Extra` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `identity/v3/projects.Options.Options` [GH-1951](https://github.com/gophercloud/gophercloud/pull/1951) -* Added `imageservice/v2/images.Image.OpenStackImageImportMethods` [GH-1962](https://github.com/gophercloud/gophercloud/pull/1962) -* Added `imageservice/v2/images.Image.OpenStackImageStoreIDs` [GH-1962](https://github.com/gophercloud/gophercloud/pull/1962) - -BUG FIXES - -* Changed`identity/v3/extensions/trusts.Trust.RemainingUses` from `bool` to `int` [GH-1939](https://github.com/gophercloud/gophercloud/pull/1939) -* Changed `identity/v3/applicationcredentials.CreateOpts.ExpiresAt` from `string` to `*time.Time` [GH-1937](https://github.com/gophercloud/gophercloud/pull/1937) -* Fixed issue with unmarshalling/decoding slices of composed structs [GH-1964](https://github.com/gophercloud/gophercloud/pull/1964) - -## 0.10.0 (April 12, 2020) - -UPGRADE NOTES - -* The various `IDFromName` convenience functions have been moved to https://github.com/gophercloud/utils [GH-1897](https://github.com/gophercloud/gophercloud/pull/1897) -* `sharedfilesystems/v2/shares.GetExportLocations` was renamed to `sharedfilesystems/v2/shares.ListExportLocations` [GH-1932](https://github.com/gophercloud/gophercloud/pull/1932) - -IMPROVEMENTS - -* Added `blockstorage/extensions/volumeactions.SetBootable` [GH-1891](https://github.com/gophercloud/gophercloud/pull/1891) -* Added `blockstorage/extensions/backups.Export` [GH-1894](https://github.com/gophercloud/gophercloud/pull/1894) -* Added `blockstorage/extensions/backups.Import` [GH-1894](https://github.com/gophercloud/gophercloud/pull/1894) -* Added `placement/v1/resourceproviders.GetTraits` [GH-1899](https://github.com/gophercloud/gophercloud/pull/1899) -* Added the ability to authenticate with Amazon EC2 Credentials [GH-1900](https://github.com/gophercloud/gophercloud/pull/1900) -* Added ability to list Nova services by binary and host [GH-1904](https://github.com/gophercloud/gophercloud/pull/1904) -* Added `compute/v2/extensions/services.Update` [GH-1902](https://github.com/gophercloud/gophercloud/pull/1902) -* Added system scope to v3 authentication [GH-1908](https://github.com/gophercloud/gophercloud/pull/1908) -* Added `identity/v3/extensions/ec2tokens.ValidateS3Token` [GH-1906](https://github.com/gophercloud/gophercloud/pull/1906) -* Added `containerinfra/v1/clusters.Cluster.HealthStatus` [GH-1910](https://github.com/gophercloud/gophercloud/pull/1910) -* Added `containerinfra/v1/clusters.Cluster.HealthStatusReason` [GH-1910](https://github.com/gophercloud/gophercloud/pull/1910) -* Added `loadbalancer/v2/amphorae.Failover` [GH-1912](https://github.com/gophercloud/gophercloud/pull/1912) -* Added `identity/v3/extensions/ec2credentials.List` [GH-1916](https://github.com/gophercloud/gophercloud/pull/1916) -* Added `identity/v3/extensions/ec2credentials.Get` [GH-1916](https://github.com/gophercloud/gophercloud/pull/1916) -* Added `identity/v3/extensions/ec2credentials.Create` [GH-1916](https://github.com/gophercloud/gophercloud/pull/1916) -* Added `identity/v3/extensions/ec2credentials.Delete` [GH-1916](https://github.com/gophercloud/gophercloud/pull/1916) -* Added `ErrUnexpectedResponseCode.ResponseHeader` [GH-1919](https://github.com/gophercloud/gophercloud/pull/1919) -* Added support for TOTP authentication [GH-1922](https://github.com/gophercloud/gophercloud/pull/1922) -* `sharedfilesystems/v2/shares.GetExportLocations` was renamed to `sharedfilesystems/v2/shares.ListExportLocations` [GH-1932](https://github.com/gophercloud/gophercloud/pull/1932) -* Added `sharedfilesystems/v2/shares.GetExportLocation` [GH-1932](https://github.com/gophercloud/gophercloud/pull/1932) -* Added `sharedfilesystems/v2/shares.Revert` [GH-1931](https://github.com/gophercloud/gophercloud/pull/1931) -* Added `sharedfilesystems/v2/shares.ResetStatus` [GH-1931](https://github.com/gophercloud/gophercloud/pull/1931) -* Added `sharedfilesystems/v2/shares.ForceDelete` [GH-1931](https://github.com/gophercloud/gophercloud/pull/1931) -* Added `sharedfilesystems/v2/shares.Unmanage` [GH-1931](https://github.com/gophercloud/gophercloud/pull/1931) -* Added `blockstorage/v3/attachments.Create` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) -* Added `blockstorage/v3/attachments.List` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) -* Added `blockstorage/v3/attachments.Get` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) -* Added `blockstorage/v3/attachments.Update` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) -* Added `blockstorage/v3/attachments.Delete` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) -* Added `blockstorage/v3/attachments.Complete` [GH-1934](https://github.com/gophercloud/gophercloud/pull/1934) - -BUG FIXES - -* Fixed issue with Orchestration `get_file` only being able to read JSON and YAML files [GH-1915](https://github.com/gophercloud/gophercloud/pull/1915) - -## 0.9.0 (March 10, 2020) - -UPGRADE NOTES - -* The way we implement new API result fields added by microversions has changed. Previously, we would declare a dedicated `ExtractFoo` function in a file called `microversions.go`. Now, we are declaring those fields inline of the original result struct as a pointer. [GH-1854](https://github.com/gophercloud/gophercloud/pull/1854) - -* `compute/v2/servers.CreateOpts.Networks` has changed from `[]Network` to `interface{}` in order to support creating servers that have no networks. [GH-1884](https://github.com/gophercloud/gophercloud/pull/1884) - -IMPROVEMENTS - -* Added `compute/v2/extensions/instanceactions.List` [GH-1848](https://github.com/gophercloud/gophercloud/pull/1848) -* Added `compute/v2/extensions/instanceactions.Get` [GH-1848](https://github.com/gophercloud/gophercloud/pull/1848) -* Added `networking/v2/ports.List.FixedIPs` [GH-1849](https://github.com/gophercloud/gophercloud/pull/1849) -* Added `identity/v3/extensions/trusts.List` [GH-1855](https://github.com/gophercloud/gophercloud/pull/1855) -* Added `identity/v3/extensions/trusts.Get` [GH-1855](https://github.com/gophercloud/gophercloud/pull/1855) -* Added `identity/v3/extensions/trusts.Trust.ExpiresAt` [GH-1857](https://github.com/gophercloud/gophercloud/pull/1857) -* Added `identity/v3/extensions/trusts.Trust.DeletedAt` [GH-1857](https://github.com/gophercloud/gophercloud/pull/1857) -* Added `compute/v2/extensions/instanceactions.InstanceActionDetail` [GH-1851](https://github.com/gophercloud/gophercloud/pull/1851) -* Added `compute/v2/extensions/instanceactions.Event` [GH-1851](https://github.com/gophercloud/gophercloud/pull/1851) -* Added `compute/v2/extensions/instanceactions.ListOpts` [GH-1858](https://github.com/gophercloud/gophercloud/pull/1858) -* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey` [GH-1864](https://github.com/gophercloud/gophercloud/pull/1864) -* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey2` [GH-1864](https://github.com/gophercloud/gophercloud/pull/1864) -* Added `placement/v1/resourceproviders.GetUsages` [GH-1862](https://github.com/gophercloud/gophercloud/pull/1862) -* Added `placement/v1/resourceproviders.GetInventories` [GH-1862](https://github.com/gophercloud/gophercloud/pull/1862) -* Added `imageservice/v2/images.ReplaceImageMinRam` [GH-1867](https://github.com/gophercloud/gophercloud/pull/1867) -* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey` [GH-1865](https://github.com/gophercloud/gophercloud/pull/1865) -* Added `objectstorage/v1/containers.CreateOpts.TempURLKey2` [GH-1865](https://github.com/gophercloud/gophercloud/pull/1865) -* Added `blockstorage/extensions/volumetransfers.List` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869) -* Added `blockstorage/extensions/volumetransfers.Create` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869) -* Added `blockstorage/extensions/volumetransfers.Accept` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869) -* Added `blockstorage/extensions/volumetransfers.Get` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869) -* Added `blockstorage/extensions/volumetransfers.Delete` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869) -* Added `blockstorage/extensions/backups.RestoreFromBackup` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871) -* Added `blockstorage/v3/volumes.CreateOpts.BackupID` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871) -* Added `blockstorage/v3/volumes.Volume.BackupID` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871) -* Added `identity/v3/projects.ListOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.ListOpts.TagsAny` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.ListOpts.NotTags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.ListOpts.NotTagsAny` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.CreateOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.UpdateOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Added `identity/v3/projects.Project.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882) -* Changed `compute/v2/servers.CreateOpts.Networks` from `[]Network` to `interface{}` to support creating servers with no networks. [GH-1884](https://github.com/gophercloud/gophercloud/pull/1884) - - -BUG FIXES - -* Added support for `int64` headers, which were previously being silently dropped [GH-1860](https://github.com/gophercloud/gophercloud/pull/1860) -* Allow image properties with empty values [GH-1875](https://github.com/gophercloud/gophercloud/pull/1875) -* Fixed `compute/v2/extensions/extendedserverattributes.ServerAttributesExt.Userdata` JSON tag [GH-1881](https://github.com/gophercloud/gophercloud/pull/1881) - -## 0.8.0 (February 8, 2020) - -UPGRADE NOTES - -* The behavior of `keymanager/v1/acls.SetOpts` has changed. Instead of a struct, it is now `[]SetOpt`. See [GH-1816](https://github.com/gophercloud/gophercloud/pull/1816) for implementation details. - -IMPROVEMENTS - -* The result of `containerinfra/v1/clusters.Resize` now returns only the UUID when calling `Extract`. This is a backwards-breaking change from the previous struct that was returned [GH-1649](https://github.com/gophercloud/gophercloud/pull/1649) -* Added `compute/v2/extensions/shelveunshelve.Shelve` [GH-1799](https://github.com/gophercloud/gophercloud/pull/1799) -* Added `compute/v2/extensions/shelveunshelve.ShelveOffload` [GH-1799](https://github.com/gophercloud/gophercloud/pull/1799) -* Added `compute/v2/extensions/shelveunshelve.Unshelve` [GH-1799](https://github.com/gophercloud/gophercloud/pull/1799) -* Added `containerinfra/v1/nodegroups.Get` [GH-1774](https://github.com/gophercloud/gophercloud/pull/1774) -* Added `containerinfra/v1/nodegroups.List` [GH-1774](https://github.com/gophercloud/gophercloud/pull/1774) -* Added `orchestration/v1/resourcetypes.List` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806) -* Added `orchestration/v1/resourcetypes.GetSchema` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806) -* Added `orchestration/v1/resourcetypes.GenerateTemplate` [GH-1806](https://github.com/gophercloud/gophercloud/pull/1806) -* Added `keymanager/v1/acls.SetOpt` and changed `keymanager/v1/acls.SetOpts` to `[]SetOpt` [GH-1816](https://github.com/gophercloud/gophercloud/pull/1816) -* Added `blockstorage/apiversions.List` [GH-458](https://github.com/gophercloud/gophercloud/pull/458) -* Added `blockstorage/apiversions.Get` [GH-458](https://github.com/gophercloud/gophercloud/pull/458) -* Added `StatusCodeError` interface and `GetStatusCode` convenience method [GH-1820](https://github.com/gophercloud/gophercloud/pull/1820) -* Added pagination support to `compute/v2/extensions/usage.SingleTenant` [GH-1819](https://github.com/gophercloud/gophercloud/pull/1819) -* Added pagination support to `compute/v2/extensions/usage.AllTenants` [GH-1819](https://github.com/gophercloud/gophercloud/pull/1819) -* Added `placement/v1/resourceproviders.List` [GH-1815](https://github.com/gophercloud/gophercloud/pull/1815) -* Allow `CreateMemberOptsBuilder` to be passed in `loadbalancer/v2/pools.Create` [GH-1822](https://github.com/gophercloud/gophercloud/pull/1822) -* Added `Backup` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824) -* Added `MonitorAddress` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824) -* Added `MonitorPort` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824) -* Changed `Impersonation` to a non-required field in `identity/v3/extensions/trusts.CreateOpts` [GH-1818](https://github.com/gophercloud/gophercloud/pull/1818) -* Added `InsertHeaders` to `loadbalancer/v2/listeners.UpdateOpts` [GH-1835](https://github.com/gophercloud/gophercloud/pull/1835) -* Added `NUMATopology` to `baremetalintrospection/v1/introspection.Data` [GH-1842](https://github.com/gophercloud/gophercloud/pull/1842) -* Added `placement/v1/resourceproviders.Create` [GH-1841](https://github.com/gophercloud/gophercloud/pull/1841) -* Added `blockstorage/extensions/volumeactions.UploadImageOpts.Visibility` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873) -* Added `blockstorage/extensions/volumeactions.UploadImageOpts.Protected` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873) -* Added `blockstorage/extensions/volumeactions.VolumeImage.Visibility` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873) -* Added `blockstorage/extensions/volumeactions.VolumeImage.Protected` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873) - -BUG FIXES - -* Changed `sort_key` to `sort_keys` in ` workflow/v2/crontriggers.ListOpts` [GH-1809](https://github.com/gophercloud/gophercloud/pull/1809) -* Allow `blockstorage/extensions/schedulerstats.Capabilities.MaxOverSubscriptionRatio` to accept both string and int/float responses [GH-1817](https://github.com/gophercloud/gophercloud/pull/1817) -* Fixed bug in `NewLoadBalancerV2` for situations when the LBaaS service was advertised without a `/v2.0` endpoint [GH-1829](https://github.com/gophercloud/gophercloud/pull/1829) -* Fixed JSON tags in `baremetal/v1/ports.UpdateOperation` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840) -* Fixed JSON tags in `networking/v2/extensions/lbaas/vips.commonResult.Extract()` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840) - -## 0.7.0 (December 3, 2019) - -IMPROVEMENTS - -* Allow a token to be used directly for authentication instead of generating a new token based on a given token [GH-1752](https://github.com/gophercloud/gophercloud/pull/1752) -* Moved `tags.ServerTagsExt` to servers.TagsExt` [GH-1760](https://github.com/gophercloud/gophercloud/pull/1760) -* Added `tags`, `tags-any`, `not-tags`, and `not-tags-any` to `compute/v2/servers.ListOpts` [GH-1759](https://github.com/gophercloud/gophercloud/pull/1759) -* Added `AccessRule` to `identity/v3/applicationcredentials` [GH-1758](https://github.com/gophercloud/gophercloud/pull/1758) -* Gophercloud no longer returns an error when multiple endpoints are found. Instead, it will choose the first endpoint and discard the others [GH-1766](https://github.com/gophercloud/gophercloud/pull/1766) -* Added `networking/v2/extensions/fwaas_v2/rules.Create` [GH-1768](https://github.com/gophercloud/gophercloud/pull/1768) -* Added `networking/v2/extensions/fwaas_v2/rules.Delete` [GH-1771](https://github.com/gophercloud/gophercloud/pull/1771) -* Added `loadbalancer/v2/providers.List` [GH-1765](https://github.com/gophercloud/gophercloud/pull/1765) -* Added `networking/v2/extensions/fwaas_v2/rules.Get` [GH-1772](https://github.com/gophercloud/gophercloud/pull/1772) -* Added `networking/v2/extensions/fwaas_v2/rules.Update` [GH-1776](https://github.com/gophercloud/gophercloud/pull/1776) -* Added `networking/v2/extensions/fwaas_v2/rules.List` [GH-1783](https://github.com/gophercloud/gophercloud/pull/1783) -* Added `MaxRetriesDown` into `loadbalancer/v2/monitors.CreateOpts` [GH-1785](https://github.com/gophercloud/gophercloud/pull/1785) -* Added `MaxRetriesDown` into `loadbalancer/v2/monitors.UpdateOpts` [GH-1786](https://github.com/gophercloud/gophercloud/pull/1786) -* Added `MaxRetriesDown` into `loadbalancer/v2/monitors.Monitor` [GH-1787](https://github.com/gophercloud/gophercloud/pull/1787) -* Added `MaxRetriesDown` into `loadbalancer/v2/monitors.ListOpts` [GH-1788](https://github.com/gophercloud/gophercloud/pull/1788) -* Updated `go.mod` dependencies, specifically to account for CVE-2019-11840 with `golang.org/x/crypto` [GH-1793](https://github.com/gophercloud/gophercloud/pull/1788) - -## 0.6.0 (October 17, 2019) - -UPGRADE NOTES - -* The way reauthentication works has been refactored. This should not cause a problem, but please report bugs if it does. See [GH-1746](https://github.com/gophercloud/gophercloud/pull/1746) for more information. - -IMPROVEMENTS - -* Added `networking/v2/extensions/quotas.Get` [GH-1742](https://github.com/gophercloud/gophercloud/pull/1742) -* Added `networking/v2/extensions/quotas.Update` [GH-1747](https://github.com/gophercloud/gophercloud/pull/1747) -* Refactored the reauthentication implementation to use goroutines and added a check to prevent an infinite loop in certain situations. [GH-1746](https://github.com/gophercloud/gophercloud/pull/1746) - -BUG FIXES - -* Changed `Flavor` to `FlavorID` in `loadbalancer/v2/loadbalancers` [GH-1744](https://github.com/gophercloud/gophercloud/pull/1744) -* Changed `Flavor` to `FlavorID` in `networking/v2/extensions/lbaas_v2/loadbalancers` [GH-1744](https://github.com/gophercloud/gophercloud/pull/1744) -* The `go-yaml` dependency was updated to `v2.2.4` to fix possible DDOS vulnerabilities [GH-1751](https://github.com/gophercloud/gophercloud/pull/1751) - -## 0.5.0 (October 13, 2019) - -IMPROVEMENTS - -* Added `VolumeType` to `compute/v2/extensions/bootfromvolume.BlockDevice`[GH-1690](https://github.com/gophercloud/gophercloud/pull/1690) -* Added `networking/v2/extensions/layer3/portforwarding.List` [GH-1688](https://github.com/gophercloud/gophercloud/pull/1688) -* Added `networking/v2/extensions/layer3/portforwarding.Get` [GH-1698](https://github.com/gophercloud/gophercloud/pull/1696) -* Added `compute/v2/extensions/tags.ReplaceAll` [GH-1696](https://github.com/gophercloud/gophercloud/pull/1696) -* Added `compute/v2/extensions/tags.Add` [GH-1696](https://github.com/gophercloud/gophercloud/pull/1696) -* Added `networking/v2/extensions/layer3/portforwarding.Update` [GH-1703](https://github.com/gophercloud/gophercloud/pull/1703) -* Added `ExtractDomain` method to token results in `identity/v3/tokens` [GH-1712](https://github.com/gophercloud/gophercloud/pull/1712) -* Added `AllowedCIDRs` to `loadbalancer/v2/listeners.CreateOpts` [GH-1710](https://github.com/gophercloud/gophercloud/pull/1710) -* Added `AllowedCIDRs` to `loadbalancer/v2/listeners.UpdateOpts` [GH-1710](https://github.com/gophercloud/gophercloud/pull/1710) -* Added `AllowedCIDRs` to `loadbalancer/v2/listeners.Listener` [GH-1710](https://github.com/gophercloud/gophercloud/pull/1710) -* Added `compute/v2/extensions/tags.Add` [GH-1695](https://github.com/gophercloud/gophercloud/pull/1695) -* Added `compute/v2/extensions/tags.ReplaceAll` [GH-1694](https://github.com/gophercloud/gophercloud/pull/1694) -* Added `compute/v2/extensions/tags.Delete` [GH-1699](https://github.com/gophercloud/gophercloud/pull/1699) -* Added `compute/v2/extensions/tags.DeleteAll` [GH-1700](https://github.com/gophercloud/gophercloud/pull/1700) -* Added `ImageStatusImporting` as an image status [GH-1725](https://github.com/gophercloud/gophercloud/pull/1725) -* Added `ByPath` to `baremetalintrospection/v1/introspection.RootDiskType` [GH-1730](https://github.com/gophercloud/gophercloud/pull/1730) -* Added `AttachedVolumes` to `compute/v2/servers.Server` [GH-1732](https://github.com/gophercloud/gophercloud/pull/1732) -* Enable unmarshaling server tags to a `compute/v2/servers.Server` struct [GH-1734] -* Allow setting an empty members list in `loadbalancer/v2/pools.BatchUpdateMembers` [GH-1736](https://github.com/gophercloud/gophercloud/pull/1736) -* Allow unsetting members' subnet ID and name in `loadbalancer/v2/pools.BatchUpdateMemberOpts` [GH-1738](https://github.com/gophercloud/gophercloud/pull/1738) - -BUG FIXES - -* Changed struct type for options in `networking/v2/extensions/lbaas_v2/listeners` to `UpdateOptsBuilder` interface instead of specific UpdateOpts type [GH-1705](https://github.com/gophercloud/gophercloud/pull/1705) -* Changed struct type for options in `networking/v2/extensions/lbaas_v2/loadbalancers` to `UpdateOptsBuilder` interface instead of specific UpdateOpts type [GH-1706](https://github.com/gophercloud/gophercloud/pull/1706) -* Fixed issue with `blockstorage/v1/volumes.Create` where the response was expected to be 202 [GH-1720](https://github.com/gophercloud/gophercloud/pull/1720) -* Changed `DefaultTlsContainerRef` from `string` to `*string` in `loadbalancer/v2/listeners.UpdateOpts` to allow the value to be removed during update. [GH-1723](https://github.com/gophercloud/gophercloud/pull/1723) -* Changed `SniContainerRefs` from `[]string{}` to `*[]string{}` in `loadbalancer/v2/listeners.UpdateOpts` to allow the value to be removed during update. [GH-1723](https://github.com/gophercloud/gophercloud/pull/1723) -* Changed `DefaultTlsContainerRef` from `string` to `*string` in `networking/v2/extensions/lbaas_v2/listeners.UpdateOpts` to allow the value to be removed during update. [GH-1723](https://github.com/gophercloud/gophercloud/pull/1723) -* Changed `SniContainerRefs` from `[]string{}` to `*[]string{}` in `networking/v2/extensions/lbaas_v2/listeners.UpdateOpts` to allow the value to be removed during update. [GH-1723](https://github.com/gophercloud/gophercloud/pull/1723) - - -## 0.4.0 (September 3, 2019) - -IMPROVEMENTS - -* Added `blockstorage/extensions/quotasets.results.QuotaSet.Groups` [GH-1668](https://github.com/gophercloud/gophercloud/pull/1668) -* Added `blockstorage/extensions/quotasets.results.QuotaUsageSet.Groups` [GH-1668](https://github.com/gophercloud/gophercloud/pull/1668) -* Added `containerinfra/v1/clusters.CreateOpts.FixedNetwork` [GH-1674](https://github.com/gophercloud/gophercloud/pull/1674) -* Added `containerinfra/v1/clusters.CreateOpts.FixedSubnet` [GH-1676](https://github.com/gophercloud/gophercloud/pull/1676) -* Added `containerinfra/v1/clusters.CreateOpts.FloatingIPEnabled` [GH-1677](https://github.com/gophercloud/gophercloud/pull/1677) -* Added `CreatedAt` and `UpdatedAt` to `loadbalancers/v2/loadbalancers.LoadBalancer` [GH-1681](https://github.com/gophercloud/gophercloud/pull/1681) -* Added `networking/v2/extensions/layer3/portforwarding.Create` [GH-1651](https://github.com/gophercloud/gophercloud/pull/1651) -* Added `networking/v2/extensions/agents.ListDHCPNetworks` [GH-1686](https://github.com/gophercloud/gophercloud/pull/1686) -* Added `networking/v2/extensions/layer3/portforwarding.Delete` [GH-1652](https://github.com/gophercloud/gophercloud/pull/1652) -* Added `compute/v2/extensions/tags.List` [GH-1679](https://github.com/gophercloud/gophercloud/pull/1679) -* Added `compute/v2/extensions/tags.Check` [GH-1679](https://github.com/gophercloud/gophercloud/pull/1679) - -BUG FIXES - -* Changed `identity/v3/endpoints.ListOpts.RegionID` from `int` to `string` [GH-1664](https://github.com/gophercloud/gophercloud/pull/1664) -* Fixed issue where older time formats in some networking APIs/resources were unable to be parsed [GH-1671](https://github.com/gophercloud/gophercloud/pull/1664) -* Changed `SATA`, `SCSI`, and `SAS` types to `InterfaceType` in `baremetal/v1/nodes` [GH-1683] - -## 0.3.0 (July 31, 2019) - -IMPROVEMENTS - -* Added `baremetal/apiversions.List` [GH-1577](https://github.com/gophercloud/gophercloud/pull/1577) -* Added `baremetal/apiversions.Get` [GH-1577](https://github.com/gophercloud/gophercloud/pull/1577) -* Added `compute/v2/extensions/servergroups.CreateOpts.Policy` [GH-1636](https://github.com/gophercloud/gophercloud/pull/1636) -* Added `identity/v3/extensions/trusts.Create` [GH-1644](https://github.com/gophercloud/gophercloud/pull/1644) -* Added `identity/v3/extensions/trusts.Delete` [GH-1644](https://github.com/gophercloud/gophercloud/pull/1644) -* Added `CreatedAt` and `UpdatedAt` to `networking/v2/extensions/layer3/floatingips.FloatingIP` [GH-1647](https://github.com/gophercloud/gophercloud/issues/1646) -* Added `CreatedAt` and `UpdatedAt` to `networking/v2/extensions/security/groups.SecGroup` [GH-1654](https://github.com/gophercloud/gophercloud/issues/1654) -* Added `CreatedAt` and `UpdatedAt` to `networking/v2/networks.Network` [GH-1657](https://github.com/gophercloud/gophercloud/issues/1657) -* Added `keymanager/v1/containers.CreateSecretRef` [GH-1659](https://github.com/gophercloud/gophercloud/issues/1659) -* Added `keymanager/v1/containers.DeleteSecretRef` [GH-1659](https://github.com/gophercloud/gophercloud/issues/1659) -* Added `sharedfilesystems/v2/shares.GetMetadata` [GH-1656](https://github.com/gophercloud/gophercloud/issues/1656) -* Added `sharedfilesystems/v2/shares.GetMetadatum` [GH-1656](https://github.com/gophercloud/gophercloud/issues/1656) -* Added `sharedfilesystems/v2/shares.SetMetadata` [GH-1656](https://github.com/gophercloud/gophercloud/issues/1656) -* Added `sharedfilesystems/v2/shares.UpdateMetadata` [GH-1656](https://github.com/gophercloud/gophercloud/issues/1656) -* Added `sharedfilesystems/v2/shares.DeleteMetadatum` [GH-1656](https://github.com/gophercloud/gophercloud/issues/1656) -* Added `sharedfilesystems/v2/sharetypes.IDFromName` [GH-1662](https://github.com/gophercloud/gophercloud/issues/1662) - - - -BUG FIXES - -* Changed `baremetal/v1/nodes.CleanStep.Args` from `map[string]string` to `map[string]interface{}` [GH-1638](https://github.com/gophercloud/gophercloud/pull/1638) -* Removed `URLPath` and `ExpectedCodes` from `loadbalancer/v2/monitors.ToMonitorCreateMap` since Octavia now provides default values when these fields are not specified [GH-1640](https://github.com/gophercloud/gophercloud/pull/1540) - - -## 0.2.0 (June 17, 2019) - -IMPROVEMENTS - -* Added `networking/v2/extensions/qos/rules.ListBandwidthLimitRules` [GH-1584](https://github.com/gophercloud/gophercloud/pull/1584) -* Added `networking/v2/extensions/qos/rules.GetBandwidthLimitRule` [GH-1584](https://github.com/gophercloud/gophercloud/pull/1584) -* Added `networking/v2/extensions/qos/rules.CreateBandwidthLimitRule` [GH-1584](https://github.com/gophercloud/gophercloud/pull/1584) -* Added `networking/v2/extensions/qos/rules.UpdateBandwidthLimitRule` [GH-1589](https://github.com/gophercloud/gophercloud/pull/1589) -* Added `networking/v2/extensions/qos/rules.DeleteBandwidthLimitRule` [GH-1590](https://github.com/gophercloud/gophercloud/pull/1590) -* Added `networking/v2/extensions/qos/policies.List` [GH-1591](https://github.com/gophercloud/gophercloud/pull/1591) -* Added `networking/v2/extensions/qos/policies.Get` [GH-1593](https://github.com/gophercloud/gophercloud/pull/1593) -* Added `networking/v2/extensions/qos/rules.ListDSCPMarkingRules` [GH-1594](https://github.com/gophercloud/gophercloud/pull/1594) -* Added `networking/v2/extensions/qos/policies.Create` [GH-1595](https://github.com/gophercloud/gophercloud/pull/1595) -* Added `compute/v2/extensions/diagnostics.Get` [GH-1592](https://github.com/gophercloud/gophercloud/pull/1592) -* Added `networking/v2/extensions/qos/policies.Update` [GH-1603](https://github.com/gophercloud/gophercloud/pull/1603) -* Added `networking/v2/extensions/qos/policies.Delete` [GH-1603](https://github.com/gophercloud/gophercloud/pull/1603) -* Added `networking/v2/extensions/qos/rules.CreateDSCPMarkingRule` [GH-1605](https://github.com/gophercloud/gophercloud/pull/1605) -* Added `networking/v2/extensions/qos/rules.UpdateDSCPMarkingRule` [GH-1605](https://github.com/gophercloud/gophercloud/pull/1605) -* Added `networking/v2/extensions/qos/rules.GetDSCPMarkingRule` [GH-1609](https://github.com/gophercloud/gophercloud/pull/1609) -* Added `networking/v2/extensions/qos/rules.DeleteDSCPMarkingRule` [GH-1609](https://github.com/gophercloud/gophercloud/pull/1609) -* Added `networking/v2/extensions/qos/rules.ListMinimumBandwidthRules` [GH-1615](https://github.com/gophercloud/gophercloud/pull/1615) -* Added `networking/v2/extensions/qos/rules.GetMinimumBandwidthRule` [GH-1615](https://github.com/gophercloud/gophercloud/pull/1615) -* Added `networking/v2/extensions/qos/rules.CreateMinimumBandwidthRule` [GH-1615](https://github.com/gophercloud/gophercloud/pull/1615) -* Added `Hostname` to `baremetalintrospection/v1/introspection.Data` [GH-1627](https://github.com/gophercloud/gophercloud/pull/1627) -* Added `networking/v2/extensions/qos/rules.UpdateMinimumBandwidthRule` [GH-1624](https://github.com/gophercloud/gophercloud/pull/1624) -* Added `networking/v2/extensions/qos/rules.DeleteMinimumBandwidthRule` [GH-1624](https://github.com/gophercloud/gophercloud/pull/1624) -* Added `networking/v2/extensions/qos/ruletypes.GetRuleType` [GH-1625](https://github.com/gophercloud/gophercloud/pull/1625) -* Added `Extra` to `baremetalintrospection/v1/introspection.Data` [GH-1611](https://github.com/gophercloud/gophercloud/pull/1611) -* Added `blockstorage/extensions/volumeactions.SetImageMetadata` [GH-1621](https://github.com/gophercloud/gophercloud/pull/1621) - -BUG FIXES - -* Updated `networking/v2/extensions/qos/rules.UpdateBandwidthLimitRule` to use return code 200 [GH-1606](https://github.com/gophercloud/gophercloud/pull/1606) -* Fixed bug in `compute/v2/extensions/schedulerhints.SchedulerHints.Query` where contents will now be marshalled to a string [GH-1620](https://github.com/gophercloud/gophercloud/pull/1620) - -## 0.1.0 (May 27, 2019) - -Initial tagged release. diff --git a/vendor/github.com/gophercloud/gophercloud/v2/LICENSE b/vendor/github.com/gophercloud/gophercloud/v2/LICENSE deleted file mode 100644 index c3f4f2f7c9ba..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/LICENSE +++ /dev/null @@ -1,192 +0,0 @@ -Copyright 2012-2013 Rackspace, Inc. -Copyright Gophercloud authors - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. - ------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/vendor/github.com/gophercloud/gophercloud/v2/Makefile b/vendor/github.com/gophercloud/gophercloud/v2/Makefile deleted file mode 100644 index c63adb8d0319..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/Makefile +++ /dev/null @@ -1,123 +0,0 @@ -undefine GOFLAGS - -GOLANGCI_LINT_VERSION?=v1.62.2 -GOTESTSUM_VERSION?=v1.12.2 -GO_TEST?=go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --format testname -- -TIMEOUT := "60m" - -ifeq ($(shell command -v podman 2> /dev/null),) - RUNNER=docker -else - RUNNER=podman -endif - -# if the golangci-lint steps fails with one of the following error messages: -# -# directory prefix . does not contain main module or its selected dependencies -# -# failed to initialize build cache at /root/.cache/golangci-lint: mkdir /root/.cache/golangci-lint: permission denied -# -# you probably have to fix the SELinux security context for root directory plus your cache -# -# chcon -Rt svirt_sandbox_file_t . -# chcon -Rt svirt_sandbox_file_t ~/.cache/golangci-lint -lint: - mkdir -p ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION) - $(RUNNER) run -t --rm \ - -v $(shell pwd):/app \ - -v ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION):/root/.cache \ - -w /app \ - -e GOFLAGS="-tags=acceptance" \ - golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint run -v --max-same-issues 50 -.PHONY: lint - -format: - gofmt -w -s $(shell pwd) -.PHONY: format - -unit: - $(GO_TEST) -shuffle on ./... -.PHONY: unit - -coverage: - $(GO_TEST) -shuffle on -covermode count -coverprofile cover.out -coverpkg=./... ./... -.PHONY: coverage - -acceptance: acceptance-basic acceptance-baremetal acceptance-blockstorage acceptance-compute acceptance-container acceptance-containerinfra acceptance-db acceptance-dns acceptance-identity acceptance-image acceptance-keymanager acceptance-loadbalancer acceptance-messaging acceptance-networking acceptance-objectstorage acceptance-orchestration acceptance-placement acceptance-sharedfilesystems acceptance-workflow -.PHONY: acceptance - -acceptance-basic: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack -.PHONY: acceptance-basic - -acceptance-baremetal: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/baremetal/... -.PHONY: acceptance-baremetal - -acceptance-blockstorage: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/blockstorage/... -.PHONY: acceptance-blockstorage - -acceptance-compute: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/compute/... -.PHONY: acceptance-compute - -acceptance-container: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/container/... -.PHONY: acceptance-container - -acceptance-containerinfra: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/containerinfra/... -.PHONY: acceptance-containerinfra - -acceptance-db: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/db/... -.PHONY: acceptance-db - -acceptance-dns: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/dns/... -.PHONY: acceptance-dns - -acceptance-identity: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/identity/... -.PHONY: acceptance-identity - -acceptance-image: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/image/... -.PHONY: acceptance-image - -acceptance-keymanager: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/keymanager/... -.PHONY: acceptance-keymanager - -acceptance-loadbalancer: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/loadbalancer/... -.PHONY: acceptance-loadbalancer - -acceptance-messaging: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/messaging/... -.PHONY: acceptance-messaging - -acceptance-networking: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/networking/... -.PHONY: acceptance-networking - -acceptance-objectstorage: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/objectstorage/... -.PHONY: acceptance-objectstorage - -acceptance-orchestration: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/orchestration/... -.PHONY: acceptance-orchestration - -acceptance-placement: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/placement/... -.PHONY: acceptance-placement - -acceptance-sharedfilesystems: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/sharedfilesystems/... -.PHONY: acceptance-sharefilesystems - -acceptance-workflow: - $(GO_TEST) -timeout $(TIMEOUT) -tags "fixtures acceptance" ./internal/acceptance/openstack/workflow/... -.PHONY: acceptance-workflow diff --git a/vendor/github.com/gophercloud/gophercloud/v2/README.md b/vendor/github.com/gophercloud/gophercloud/v2/README.md deleted file mode 100644 index ca47f5b0ba5c..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/README.md +++ /dev/null @@ -1,252 +0,0 @@ -# Gophercloud: an OpenStack SDK for Go -[![Coverage Status](https://coveralls.io/repos/github/gophercloud/gophercloud/badge.svg?branch=master)](https://coveralls.io/github/gophercloud/gophercloud?branch=master) - -Gophercloud is a Go SDK for OpenStack. - -Join us on kubernetes slack, on [#gophercloud](https://kubernetes.slack.com/archives/C05G4NJ6P6X). Visit [slack.k8s.io](https://slack.k8s.io) for an invitation. - -> **Note** -> This branch contains the current stable branch of Gophercloud: `v2`. -> The legacy stable version can be found in the `v1` branch. - -## How to install - -Reference a Gophercloud package in your code: - -```go -import "github.com/gophercloud/gophercloud/v2" -``` - -Then update your `go.mod`: - -```shell -go mod tidy -``` - -## Getting started - -### Credentials - -Because you'll be hitting an API, you will need to retrieve your OpenStack -credentials and either store them in a `clouds.yaml` file, as environment -variables, or in your local Go files. The first method is recommended because -it decouples credential information from source code, allowing you to push the -latter to your version control system without any security risk. - -You will need to retrieve the following: - -* A valid Keystone identity URL -* Credentials. These can be a username/password combo, a set of Application - Credentials, a pre-generated token, or any other supported authentication - mechanism. - -For users who have the OpenStack dashboard installed, there's a shortcut. If -you visit the `project/api_access` path in Horizon and click on the -"Download OpenStack RC File" button at the top right hand corner, you can -download either a `clouds.yaml` file or an `openrc` bash file that exports all -of your access details to environment variables. To use the `clouds.yaml` file, -place it at `~/.config/openstack/clouds.yaml`. To use the `openrc` file, run -`source openrc` and you will be prompted for your password. - -### Gophercloud authentication - -Gophercloud authentication is organized into two layered abstractions: -* `ProviderClient` holds the authentication token and can be used to build a - `ServiceClient`. -* `ServiceClient` specializes against one specific OpenStack module and can - directly be used to make API calls. - -A provider client is a top-level client that all of your OpenStack service -clients derive from. The provider contains all of the authentication details -that allow your Go code to access the API - such as the base URL and token ID. - -One single Provider client can be used to build as many Service clients as needed. - -**With `clouds.yaml`** - -```go -package main - -import ( - "context" - - "github.com/gophercloud/gophercloud/v2/openstack" - "github.com/gophercloud/gophercloud/v2/openstack/config" - "github.com/gophercloud/gophercloud/v2/openstack/config/clouds" -) - -func main() { - ctx := context.Background() - - // Fetch coordinates from a `cloud.yaml` in the current directory, or - // in the well-known config directories (different for each operating - // system). - authOptions, endpointOptions, tlsConfig, err := clouds.Parse() - if err != nil { - panic(err) - } - - // Call Keystone to get an authentication token, and use it to - // construct a ProviderClient. All functions hitting the OpenStack API - // accept a `context.Context` to enable tracing and cancellation. - providerClient, err := config.NewProviderClient(ctx, authOptions, config.WithTLSConfig(tlsConfig)) - if err != nil { - panic(err) - } - - // Use the ProviderClient and the endpoint options fetched from - // `clouds.yaml` to build a service client: a compute client in this - // case. Note that the contructor does not accept a `context.Context`: - // no further call to the OpenStack API is needed at this stage. - computeClient, err := openstack.NewComputeV2(providerClient, endpointOptions) - if err != nil { - panic(err) - } - - // use the computeClient -} -``` - -**With environment variables (`openrc`)** - -Gophercloud can parse the environment variables set by running `source openrc`: - -```go -package main - -import ( - "context" - "os" - - "github.com/gophercloud/gophercloud/v2" - "github.com/gophercloud/gophercloud/v2/openstack" -) - -func main() { - ctx := context.Background() - - opts, err := openstack.AuthOptionsFromEnv() - if err != nil { - panic(err) - } - - providerClient, err := openstack.AuthenticatedClient(ctx, opts) - if err != nil { - panic(err) - } - - computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), - }) - if err != nil { - panic(err) - } - - // use the computeClient -} -``` - -**Manually** - -You can also generate a "Provider" by passing in your credentials -explicitly: - -```go -package main - -import ( - "context" - - "github.com/gophercloud/gophercloud/v2" - "github.com/gophercloud/gophercloud/v2/openstack" -) - -func main() { - ctx := context.Background() - - providerClient, err := openstack.AuthenticatedClient(ctx, gophercloud.AuthOptions{ - IdentityEndpoint: "https://openstack.example.com:5000/v2.0", - Username: "username", - Password: "password", - }) - if err != nil { - panic(err) - } - - computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{ - Region: "RegionName", - }) - if err != nil { - panic(err) - } - - // use the computeClient -} -``` - -### Provision a server - -We can use the Compute service client generated above for any Compute API -operation we want. In our case, we want to provision a new server. To do this, -we invoke the `Create` method and pass in the flavor ID (hardware -specification) and image ID (operating system) we're interested in: - -```go -import "github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers" - -func main() { - // [...] - - server, err := servers.Create(context.TODO(), computeClient, servers.CreateOpts{ - Name: "My new server!", - FlavorRef: "flavor_id", - ImageRef: "image_id", - }).Extract() - - // [...] -``` - -The above code sample creates a new server with the parameters, and returns a -[`servers.Server`](https://pkg.go.dev/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers#Server). - -## Supported Services - -| **Service** | **Name** | **Module** | **1.x** | **2.x** | -|:------------------------:|------------------|:----------------------------------:|:-------:|:-------:| -| Baremetal | Ironic | `openstack/baremetal` | ✔ | ✔ | -| Baremetal Introspection | Ironic Inspector | `openstack/baremetalintrospection` | ✔ | ✔ | -| Block Storage | Cinder | `openstack/blockstorage` | ✔ | ✔ | -| Clustering | Senlin | `openstack/clustering` | ✔ | ✘ | -| Compute | Nova | `openstack/compute` | ✔ | ✔ | -| Container | Zun | `openstack/container` | ✔ | ✔ | -| Container Infrastructure | Magnum | `openstack/containerinfra` | ✔ | ✔ | -| Database | Trove | `openstack/db` | ✔ | ✔ | -| DNS | Designate | `openstack/dns` | ✔ | ✔ | -| Identity | Keystone | `openstack/identity` | ✔ | ✔ | -| Image | Glance | `openstack/image` | ✔ | ✔ | -| Key Management | Barbican | `openstack/keymanager` | ✔ | ✔ | -| Load Balancing | Octavia | `openstack/loadbalancer` | ✔ | ✔ | -| Messaging | Zaqar | `openstack/messaging` | ✔ | ✔ | -| Networking | Neutron | `openstack/networking` | ✔ | ✔ | -| Object Storage | Swift | `openstack/objectstorage` | ✔ | ✔ | - -## Advanced Usage - -Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gophercloud works. - -## Backwards-Compatibility Guarantees - -Gophercloud versioning follows [semver](https://semver.org/spec/v2.0.0.html). - -Before `v1.0.0`, there were no guarantees. Starting with v1, there will be no breaking changes within a major release. - -See the [Release instructions](./RELEASE.md). - -## Contributing - -See the [contributing guide](./.github/CONTRIBUTING.md). - -## Help and feedback - -If you're struggling with something or have spotted a potential bug, feel free -to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues). diff --git a/vendor/github.com/gophercloud/gophercloud/v2/RELEASE.md b/vendor/github.com/gophercloud/gophercloud/v2/RELEASE.md deleted file mode 100644 index 6490ed887786..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/RELEASE.md +++ /dev/null @@ -1,79 +0,0 @@ -# Gophercloud release - -## Contributions - -### The semver label - -Gophercloud follows [semver](https://semver.org/). - -Each Pull request must have a label indicating its impact on the API: -* `semver:patch` for changes that don't impact the API -* `semver:minor` for changes that impact the API in a backwards-compatible fashion -* `semver:major` for changes that introduce a breaking change in the API - -Automation prevents merges if the label is not present. - -### Metadata - -The release notes for a given release are generated based on the PR title: make -sure that the PR title is descriptive. - -## Release of a new version - -Requirements: -* [`gh`](https://github.com/cli/cli) -* [`jq`](https://stedolan.github.io/jq/) - -### Step 1: Collect all PRs since the last release - -Supposing that the base release is `v1.2.0`: - -``` -for commit_sha in $(git log --pretty=format:"%h" v1.2.0..HEAD); do - gh pr list --search "$commit_sha" --state merged --json number,title,labels,url -done | jq '.[]' | jq --slurp 'unique_by(.number)' > prs.json -``` - -This JSON file will be useful later. - -### Step 2: Determine the version - -In order to determine the version of the next release, we first check that no incompatible change is detected in the code that has been merged since the last release. This step can be automated with the `gorelease` tool: - -```shell -gorelease | grep -B2 -A0 '^## incompatible changes' -``` - -If the tool detects incompatible changes outside a `testing` package, then the bump is major. - -Next, we check all PRs merged since the last release using the file `prs.json` that we generated above. - -* Find PRs labeled with `semver:major`: `jq 'map(select(contains({labels: [{name: "semver:major"}]}) ))' prs.json` -* Find PRs labeled with `semver:minor`: `jq 'map(select(contains({labels: [{name: "semver:minor"}]}) ))' prs.json` - -The highest semver descriptor determines the release bump. - -### Step 3: Release notes and version string - -Once all PRs have a sensible title, generate the release notes: - -```shell -jq -r '.[] | "* [GH-\(.number)](\(.url)) \(.title)"' prs.json -``` - -Add that to the top of `CHANGELOG.md`. Also add any information that could be useful to consumers willing to upgrade. - -**Set the new version string in the `DefaultUserAgent` constant in `provider_client.go`.** - -Create a PR with these two changes. The new PR should be labeled with the semver label corresponding to the type of bump. - -### Step 3: Git tag and Github release - -The Go mod system relies on Git tags. In order to simulate a review mechanism, we rely on Github to create the tag through the Release mechanism. - -* [Prepare a new release](https://github.com/gophercloud/gophercloud/releases/new) -* Let Github generate the release notes by clicking on Generate release notes -* Click on **Save draft** -* Ask another Gophercloud maintainer to review and publish the release - -_Note: never change a release or force-push a tag. Tags are almost immediately picked up by the Go proxy and changing the commit it points to will be detected as tampering._ diff --git a/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go b/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go deleted file mode 100644 index 616919d00086..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go +++ /dev/null @@ -1,517 +0,0 @@ -package gophercloud - -/* -AuthOptions stores information needed to authenticate to an OpenStack Cloud. -You can populate one manually, or use a provider's AuthOptionsFromEnv() function -to read relevant information from the standard environment variables. Pass one -to a provider's AuthenticatedClient function to authenticate and obtain a -ProviderClient representing an active session on that provider. - -Its fields are the union of those recognized by each identity implementation and -provider. - -An example of manually providing authentication information: - - opts := gophercloud.AuthOptions{ - IdentityEndpoint: "https://openstack.example.com:5000/v2.0", - Username: "{username}", - Password: "{password}", - TenantID: "{tenant_id}", - } - - provider, err := openstack.AuthenticatedClient(context.TODO(), opts) - -An example of using AuthOptionsFromEnv(), where the environment variables can -be read from a file, such as a standard openrc file: - - opts, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(context.TODO(), opts) -*/ -type AuthOptions struct { - // IdentityEndpoint specifies the HTTP endpoint that is required to work with - // the Identity API of the appropriate version. While it's ultimately needed by - // all of the identity services, it will often be populated by a provider-level - // function. - // - // The IdentityEndpoint is typically referred to as the "auth_url" or - // "OS_AUTH_URL" in the information provided by the cloud operator. - IdentityEndpoint string `json:"-"` - - // Username is required if using Identity V2 API. Consult with your provider's - // control panel to discover your account's username. In Identity V3, either - // UserID or a combination of Username and DomainID or DomainName are needed. - Username string `json:"username,omitempty"` - UserID string `json:"-"` - - Password string `json:"password,omitempty"` - - // Passcode is used in TOTP authentication method - Passcode string `json:"passcode,omitempty"` - - // At most one of DomainID and DomainName must be provided if using Username - // with Identity V3. Otherwise, either are optional. - DomainID string `json:"-"` - DomainName string `json:"name,omitempty"` - - // The TenantID and TenantName fields are optional for the Identity V2 API. - // The same fields are known as project_id and project_name in the Identity - // V3 API, but are collected as TenantID and TenantName here in both cases. - // Some providers allow you to specify a TenantName instead of the TenantId. - // Some require both. Your provider's authentication policies will determine - // how these fields influence authentication. - // If DomainID or DomainName are provided, they will also apply to TenantName. - // It is not currently possible to authenticate with Username and a Domain - // and scope to a Project in a different Domain by using TenantName. To - // accomplish that, the ProjectID will need to be provided as the TenantID - // option. - TenantID string `json:"tenantId,omitempty"` - TenantName string `json:"tenantName,omitempty"` - - // AllowReauth should be set to true if you grant permission for Gophercloud to - // cache your credentials in memory, and to allow Gophercloud to attempt to - // re-authenticate automatically if/when your token expires. If you set it to - // false, it will not cache these settings, but re-authentication will not be - // possible. This setting defaults to false. - // - // NOTE: The reauth function will try to re-authenticate endlessly if left - // unchecked. The way to limit the number of attempts is to provide a custom - // HTTP client to the provider client and provide a transport that implements - // the RoundTripper interface and stores the number of failed retries. For an - // example of this, see here: - // https://github.com/rackspace/rack/blob/1.0.0/auth/clients.go#L311 - AllowReauth bool `json:"-"` - - // TokenID allows users to authenticate (possibly as another user) with an - // authentication token ID. - TokenID string `json:"-"` - - // Scope determines the scoping of the authentication request. - Scope *AuthScope `json:"-"` - - // Authentication through Application Credentials requires supplying name, project and secret - // For project we can use TenantID - ApplicationCredentialID string `json:"-"` - ApplicationCredentialName string `json:"-"` - ApplicationCredentialSecret string `json:"-"` -} - -// AuthScope allows a created token to be limited to a specific domain or project. -type AuthScope struct { - ProjectID string - ProjectName string - DomainID string - DomainName string - System bool - TrustID string -} - -// ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder -// interface in the v2 tokens package -func (opts AuthOptions) ToTokenV2CreateMap() (map[string]any, error) { - // Populate the request map. - authMap := make(map[string]any) - - if opts.Username != "" { - if opts.Password != "" { - authMap["passwordCredentials"] = map[string]any{ - "username": opts.Username, - "password": opts.Password, - } - } else { - return nil, ErrMissingInput{Argument: "Password"} - } - } else if opts.TokenID != "" { - authMap["token"] = map[string]any{ - "id": opts.TokenID, - } - } else { - return nil, ErrMissingInput{Argument: "Username"} - } - - if opts.TenantID != "" { - authMap["tenantId"] = opts.TenantID - } - if opts.TenantName != "" { - authMap["tenantName"] = opts.TenantName - } - - return map[string]any{"auth": authMap}, nil -} - -// ToTokenV3CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder -// interface in the v3 tokens package -func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]any) (map[string]any, error) { - type domainReq struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - } - - type userReq struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Password *string `json:"password,omitempty"` - Passcode *string `json:"passcode,omitempty"` - Domain *domainReq `json:"domain,omitempty"` - } - - type passwordReq struct { - User userReq `json:"user"` - } - - type tokenReq struct { - ID string `json:"id"` - } - - type applicationCredentialReq struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - User *userReq `json:"user,omitempty"` - Secret *string `json:"secret,omitempty"` - } - - type totpReq struct { - User *userReq `json:"user,omitempty"` - } - - type identityReq struct { - Methods []string `json:"methods"` - Password *passwordReq `json:"password,omitempty"` - Token *tokenReq `json:"token,omitempty"` - ApplicationCredential *applicationCredentialReq `json:"application_credential,omitempty"` - TOTP *totpReq `json:"totp,omitempty"` - } - - type authReq struct { - Identity identityReq `json:"identity"` - } - - type request struct { - Auth authReq `json:"auth"` - } - - // Populate the request structure based on the provided arguments. Create and return an error - // if insufficient or incompatible information is present. - var req request - - if opts.Password == "" && opts.Passcode == "" { - if opts.TokenID != "" { - // Because we aren't using password authentication, it's an error to also provide any of the user-based authentication - // parameters. - if opts.Username != "" { - return nil, ErrUsernameWithToken{} - } - if opts.UserID != "" { - return nil, ErrUserIDWithToken{} - } - if opts.DomainID != "" { - return nil, ErrDomainIDWithToken{} - } - if opts.DomainName != "" { - return nil, ErrDomainNameWithToken{} - } - - // Configure the request for Token authentication. - req.Auth.Identity.Methods = []string{"token"} - req.Auth.Identity.Token = &tokenReq{ - ID: opts.TokenID, - } - - } else if opts.ApplicationCredentialID != "" { - // Configure the request for ApplicationCredentialID authentication. - // https://github.com/openstack/keystoneauth/blob/stable/rocky/keystoneauth1/identity/v3/application_credential.py#L48-L67 - // There are three kinds of possible application_credential requests - // 1. application_credential id + secret - // 2. application_credential name + secret + user_id - // 3. application_credential name + secret + username + domain_id / domain_name - if opts.ApplicationCredentialSecret == "" { - return nil, ErrAppCredMissingSecret{} - } - req.Auth.Identity.Methods = []string{"application_credential"} - req.Auth.Identity.ApplicationCredential = &applicationCredentialReq{ - ID: &opts.ApplicationCredentialID, - Secret: &opts.ApplicationCredentialSecret, - } - } else if opts.ApplicationCredentialName != "" { - if opts.ApplicationCredentialSecret == "" { - return nil, ErrAppCredMissingSecret{} - } - - var userRequest *userReq - - if opts.UserID != "" { - // UserID could be used without the domain information - userRequest = &userReq{ - ID: &opts.UserID, - } - } - - if userRequest == nil && opts.Username == "" { - // Make sure that Username or UserID are provided - return nil, ErrUsernameOrUserID{} - } - - if userRequest == nil && opts.DomainID != "" { - userRequest = &userReq{ - Name: &opts.Username, - Domain: &domainReq{ID: &opts.DomainID}, - } - } - - if userRequest == nil && opts.DomainName != "" { - userRequest = &userReq{ - Name: &opts.Username, - Domain: &domainReq{Name: &opts.DomainName}, - } - } - - // Make sure that DomainID or DomainName are provided among Username - if userRequest == nil { - return nil, ErrDomainIDOrDomainName{} - } - - req.Auth.Identity.Methods = []string{"application_credential"} - req.Auth.Identity.ApplicationCredential = &applicationCredentialReq{ - Name: &opts.ApplicationCredentialName, - User: userRequest, - Secret: &opts.ApplicationCredentialSecret, - } - } else { - // If no password or token ID or ApplicationCredential are available, authentication can't continue. - return nil, ErrMissingPassword{} - } - } else { - // Password authentication. - if opts.Password != "" { - req.Auth.Identity.Methods = append(req.Auth.Identity.Methods, "password") - } - - // TOTP authentication. - if opts.Passcode != "" { - req.Auth.Identity.Methods = append(req.Auth.Identity.Methods, "totp") - } - - // At least one of Username and UserID must be specified. - if opts.Username == "" && opts.UserID == "" { - return nil, ErrUsernameOrUserID{} - } - - if opts.Username != "" { - // If Username is provided, UserID may not be provided. - if opts.UserID != "" { - return nil, ErrUsernameOrUserID{} - } - - // Either DomainID or DomainName must also be specified. - if opts.DomainID == "" && opts.DomainName == "" { - return nil, ErrDomainIDOrDomainName{} - } - - if opts.DomainID != "" { - if opts.DomainName != "" { - return nil, ErrDomainIDOrDomainName{} - } - - // Configure the request for Username and Password authentication with a DomainID. - if opts.Password != "" { - req.Auth.Identity.Password = &passwordReq{ - User: userReq{ - Name: &opts.Username, - Password: &opts.Password, - Domain: &domainReq{ID: &opts.DomainID}, - }, - } - } - if opts.Passcode != "" { - req.Auth.Identity.TOTP = &totpReq{ - User: &userReq{ - Name: &opts.Username, - Passcode: &opts.Passcode, - Domain: &domainReq{ID: &opts.DomainID}, - }, - } - } - } - - if opts.DomainName != "" { - // Configure the request for Username and Password authentication with a DomainName. - if opts.Password != "" { - req.Auth.Identity.Password = &passwordReq{ - User: userReq{ - Name: &opts.Username, - Password: &opts.Password, - Domain: &domainReq{Name: &opts.DomainName}, - }, - } - } - - if opts.Passcode != "" { - req.Auth.Identity.TOTP = &totpReq{ - User: &userReq{ - Name: &opts.Username, - Passcode: &opts.Passcode, - Domain: &domainReq{Name: &opts.DomainName}, - }, - } - } - } - } - - if opts.UserID != "" { - // If UserID is specified, neither DomainID nor DomainName may be. - if opts.DomainID != "" { - return nil, ErrDomainIDWithUserID{} - } - if opts.DomainName != "" { - return nil, ErrDomainNameWithUserID{} - } - - // Configure the request for UserID and Password authentication. - if opts.Password != "" { - req.Auth.Identity.Password = &passwordReq{ - User: userReq{ - ID: &opts.UserID, - Password: &opts.Password, - }, - } - } - - if opts.Passcode != "" { - req.Auth.Identity.TOTP = &totpReq{ - User: &userReq{ - ID: &opts.UserID, - Passcode: &opts.Passcode, - }, - } - } - } - } - - b, err := BuildRequestBody(req, "") - if err != nil { - return nil, err - } - - if len(scope) != 0 { - b["auth"].(map[string]any)["scope"] = scope - } - - return b, nil -} - -// ToTokenV3ScopeMap builds a scope from AuthOptions and satisfies interface in -// the v3 tokens package. -func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]any, error) { - // For backwards compatibility. - // If AuthOptions.Scope was not set, try to determine it. - // This works well for common scenarios. - if opts.Scope == nil { - opts.Scope = new(AuthScope) - if opts.TenantID != "" { - opts.Scope.ProjectID = opts.TenantID - } else { - if opts.TenantName != "" { - opts.Scope.ProjectName = opts.TenantName - opts.Scope.DomainID = opts.DomainID - opts.Scope.DomainName = opts.DomainName - } - } - } - - if opts.Scope.System { - return map[string]any{ - "system": map[string]any{ - "all": true, - }, - }, nil - } - - if opts.Scope.TrustID != "" { - return map[string]any{ - "OS-TRUST:trust": map[string]string{ - "id": opts.Scope.TrustID, - }, - }, nil - } - - if opts.Scope.ProjectName != "" { - // ProjectName provided: either DomainID or DomainName must also be supplied. - // ProjectID may not be supplied. - if opts.Scope.DomainID == "" && opts.Scope.DomainName == "" { - return nil, ErrScopeDomainIDOrDomainName{} - } - if opts.Scope.ProjectID != "" { - return nil, ErrScopeProjectIDOrProjectName{} - } - - if opts.Scope.DomainID != "" { - // ProjectName + DomainID - return map[string]any{ - "project": map[string]any{ - "name": &opts.Scope.ProjectName, - "domain": map[string]any{"id": &opts.Scope.DomainID}, - }, - }, nil - } - - if opts.Scope.DomainName != "" { - // ProjectName + DomainName - return map[string]any{ - "project": map[string]any{ - "name": &opts.Scope.ProjectName, - "domain": map[string]any{"name": &opts.Scope.DomainName}, - }, - }, nil - } - } else if opts.Scope.ProjectID != "" { - // ProjectID provided. ProjectName, DomainID, and DomainName may not be provided. - if opts.Scope.DomainID != "" { - return nil, ErrScopeProjectIDAlone{} - } - if opts.Scope.DomainName != "" { - return nil, ErrScopeProjectIDAlone{} - } - - // ProjectID - return map[string]any{ - "project": map[string]any{ - "id": &opts.Scope.ProjectID, - }, - }, nil - } else if opts.Scope.DomainID != "" { - // DomainID provided. ProjectID, ProjectName, and DomainName may not be provided. - if opts.Scope.DomainName != "" { - return nil, ErrScopeDomainIDOrDomainName{} - } - - // DomainID - return map[string]any{ - "domain": map[string]any{ - "id": &opts.Scope.DomainID, - }, - }, nil - } else if opts.Scope.DomainName != "" { - // DomainName - return map[string]any{ - "domain": map[string]any{ - "name": &opts.Scope.DomainName, - }, - }, nil - } - - return nil, nil -} - -func (opts AuthOptions) CanReauth() bool { - if opts.Passcode != "" { - // cannot reauth using TOTP passcode - return false - } - - return opts.AllowReauth -} - -// ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder -// interface in the v3 tokens package. -func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]any) (map[string]string, error) { - return nil, nil -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go b/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go deleted file mode 100644 index 9a49cce8e57c..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go +++ /dev/null @@ -1,52 +0,0 @@ -package gophercloud - -/* -AuthResult is the result from the request that was used to obtain a provider -client's Keystone token. It is returned from ProviderClient.GetAuthResult(). - -The following types satisfy this interface: - - github.com/gophercloud/gophercloud/openstack/identity/v2/tokens.CreateResult - github.com/gophercloud/gophercloud/openstack/identity/v3/tokens.CreateResult - -Usage example: - - import ( - "github.com/gophercloud/gophercloud/v2" - tokens2 "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens" - tokens3 "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" - ) - - func GetAuthenticatedUserID(providerClient *gophercloud.ProviderClient) (string, error) { - r := providerClient.GetAuthResult() - if r == nil { - //ProviderClient did not use openstack.Authenticate(), e.g. because token - //was set manually with ProviderClient.SetToken() - return "", errors.New("no AuthResult available") - } - switch r := r.(type) { - case tokens2.CreateResult: - u, err := r.ExtractUser() - if err != nil { - return "", err - } - return u.ID, nil - case tokens3.CreateResult: - u, err := r.ExtractUser() - if err != nil { - return "", err - } - return u.ID, nil - default: - panic(fmt.Sprintf("got unexpected AuthResult type %t", r)) - } - } - -Both implementing types share a lot of methods by name, like ExtractUser() in -this example. But those methods cannot be part of the AuthResult interface -because the return types are different (in this case, type tokens2.User vs. -type tokens3.User). -*/ -type AuthResult interface { - ExtractTokenID() (string, error) -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/endpoint_search.go b/vendor/github.com/gophercloud/gophercloud/v2/endpoint_search.go deleted file mode 100644 index 34d76a1b8da4..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/endpoint_search.go +++ /dev/null @@ -1,138 +0,0 @@ -package gophercloud - -import "slices" - -// Availability indicates to whom a specific service endpoint is accessible: -// the internet at large, internal networks only, or only to administrators. -// Different identity services use different terminology for these. Identity v2 -// lists them as different kinds of URLs within the service catalog ("adminURL", -// "internalURL", and "publicURL"), while v3 lists them as "Interfaces" in an -// endpoint's response. -type Availability string - -const ( - // AvailabilityAdmin indicates that an endpoint is only available to - // administrators. - AvailabilityAdmin Availability = "admin" - - // AvailabilityPublic indicates that an endpoint is available to everyone on - // the internet. - AvailabilityPublic Availability = "public" - - // AvailabilityInternal indicates that an endpoint is only available within - // the cluster's internal network. - AvailabilityInternal Availability = "internal" -) - -// ServiceTypeAliases contains a mapping of service types to any aliases, as -// defined by the OpenStack Service Types Authority. Only service types that -// we support are included. -var ServiceTypeAliases = map[string][]string{ - "application-container": {"container"}, - "baremetal": {"bare-metal"}, - "baremetal-introspection": {}, - "block-storage": {"block-store", "volume", "volumev2", "volumev3"}, - "compute": {}, - "container-infrastructure-management": {"container-infrastructure", "container-infra"}, - "database": {}, - "dns": {}, - "identity": {}, - "image": {}, - "key-manager": {}, - "load-balancer": {}, - "message": {"messaging"}, - "networking": {}, - "object-store": {}, - "orchestration": {}, - "placement": {}, - "shared-file-system": {"sharev2", "share"}, - "workflow": {"workflowv2"}, -} - -// EndpointOpts specifies search criteria used by queries against an -// OpenStack service catalog. The options must contain enough information to -// unambiguously identify one, and only one, endpoint within the catalog. -// -// Usually, these are passed to service client factory functions in a provider -// package, like "openstack.NewComputeV2()". -type EndpointOpts struct { - // Type [required] is the service type for the client (e.g., "compute", - // "object-store"), as defined by the OpenStack Service Types Authority. - // This will generally be supplied by the service client function, but a - // user-given value will be honored if provided. - Type string - - // Name [optional] is the service name for the client (e.g., "nova") as it - // appears in the service catalog. Services can have the same Type but a - // different Name, which is why both Type and Name are sometimes needed. - Name string - - // Aliases [optional] is the set of aliases of the service type (e.g. - // "volumev2"/"volumev3", "volume" and "block-store" for the - // "block-storage" service type), as defined by the OpenStack Service Types - // Authority. As with Type, this will generally be supplied by the service - // client function, but a user-given value will be honored if provided. - Aliases []string - - // Region [required] is the geographic region in which the endpoint resides, - // generally specifying which datacenter should house your resources. - // Required only for services that span multiple regions. - Region string - - // Version [optional] is the major version of the service required. It it not - // a microversion. Use this to ensure the correct endpoint is selected when - // multiple API versions are available. - Version int - - // Availability [optional] is the visibility of the endpoint to be returned. - // Valid types include the constants AvailabilityPublic, AvailabilityInternal, - // or AvailabilityAdmin from this package. - // - // Availability is not required, and defaults to AvailabilityPublic. Not all - // providers or services offer all Availability options. - Availability Availability -} - -/* -EndpointLocator is an internal function to be used by provider implementations. - -It provides an implementation that locates a single endpoint from a service -catalog for a specific ProviderClient based on user-provided EndpointOpts. The -provider then uses it to discover related ServiceClients. -*/ -type EndpointLocator func(EndpointOpts) (string, error) - -// ApplyDefaults is an internal method to be used by provider implementations. -// -// It sets EndpointOpts fields if not already set, including a default type. -// Currently, EndpointOpts.Availability defaults to the public endpoint. -func (eo *EndpointOpts) ApplyDefaults(t string) { - if eo.Type == "" { - eo.Type = t - } - if eo.Availability == "" { - eo.Availability = AvailabilityPublic - } - if len(eo.Aliases) == 0 { - if aliases, ok := ServiceTypeAliases[eo.Type]; ok { - // happy path: user requested a service type by its official name - eo.Aliases = slices.Clone(aliases) - } else { - // unhappy path: user requested a service type by its alias or an - // invalid/unsupported service type - // TODO(stephenfin): This should probably be an error in v3 - for t, aliases := range ServiceTypeAliases { - if slices.Contains(aliases, eo.Type) { - // we intentionally override the service type, even if it - // was explicitly requested by the user - eo.Type = t - eo.Aliases = slices.Clone(aliases) - } - } - } - } -} - -func (eo *EndpointOpts) Types() []string { - return append([]string{eo.Type}, eo.Aliases...) -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/errors.go b/vendor/github.com/gophercloud/gophercloud/v2/errors.go deleted file mode 100644 index 2698c2039561..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/errors.go +++ /dev/null @@ -1,351 +0,0 @@ -package gophercloud - -import ( - "bytes" - "errors" - "fmt" - "net/http" - "strings" -) - -// BaseError is an error type that all other error types embed. -type BaseError struct { - DefaultErrString string - Info string -} - -func (e BaseError) Error() string { - e.DefaultErrString = "An error occurred while executing a Gophercloud request." - return e.choseErrString() -} - -func (e BaseError) choseErrString() string { - if e.Info != "" { - return e.Info - } - return e.DefaultErrString -} - -// ErrMissingInput is the error when input is required in a particular -// situation but not provided by the user -type ErrMissingInput struct { - BaseError - Argument string -} - -func (e ErrMissingInput) Error() string { - e.DefaultErrString = fmt.Sprintf("Missing input for argument [%s]", e.Argument) - return e.choseErrString() -} - -// ErrInvalidInput is an error type used for most non-HTTP Gophercloud errors. -type ErrInvalidInput struct { - ErrMissingInput - Value any -} - -func (e ErrInvalidInput) Error() string { - e.DefaultErrString = fmt.Sprintf("Invalid input provided for argument [%s]: [%+v]", e.Argument, e.Value) - return e.choseErrString() -} - -// ErrMissingEnvironmentVariable is the error when environment variable is required -// in a particular situation but not provided by the user -type ErrMissingEnvironmentVariable struct { - BaseError - EnvironmentVariable string -} - -func (e ErrMissingEnvironmentVariable) Error() string { - e.DefaultErrString = fmt.Sprintf("Missing environment variable [%s]", e.EnvironmentVariable) - return e.choseErrString() -} - -// ErrMissingAnyoneOfEnvironmentVariables is the error when anyone of the environment variables -// is required in a particular situation but not provided by the user -type ErrMissingAnyoneOfEnvironmentVariables struct { - BaseError - EnvironmentVariables []string -} - -func (e ErrMissingAnyoneOfEnvironmentVariables) Error() string { - e.DefaultErrString = fmt.Sprintf( - "Missing one of the following environment variables [%s]", - strings.Join(e.EnvironmentVariables, ", "), - ) - return e.choseErrString() -} - -// ErrUnexpectedResponseCode is returned by the Request method when a response code other than -// those listed in OkCodes is encountered. -type ErrUnexpectedResponseCode struct { - BaseError - URL string - Method string - Expected []int - Actual int - Body []byte - ResponseHeader http.Header -} - -func (e ErrUnexpectedResponseCode) Error() string { - e.DefaultErrString = fmt.Sprintf( - "Expected HTTP response code %v when accessing [%s %s], but got %d instead: %s", - e.Expected, e.Method, e.URL, e.Actual, bytes.TrimSpace(e.Body), - ) - return e.choseErrString() -} - -// GetStatusCode returns the actual status code of the error. -func (e ErrUnexpectedResponseCode) GetStatusCode() int { - return e.Actual -} - -// ResponseCodeIs returns true if this error is or contains an ErrUnexpectedResponseCode reporting -// that the request failed with the given response code. For example, this checks if a request -// failed because of a 404 error: -// -// allServers, err := servers.List(client, servers.ListOpts{}) -// if gophercloud.ResponseCodeIs(err, http.StatusNotFound) { -// handleNotFound() -// } -// -// It is safe to pass a nil error, in which case this function always returns false. -func ResponseCodeIs(err error, status int) bool { - var codeError ErrUnexpectedResponseCode - if errors.As(err, &codeError) { - return codeError.Actual == status - } - return false -} - -// ErrTimeOut is the error type returned when an operations times out. -type ErrTimeOut struct { - BaseError -} - -func (e ErrTimeOut) Error() string { - e.DefaultErrString = "A time out occurred" - return e.choseErrString() -} - -// ErrUnableToReauthenticate is the error type returned when reauthentication fails. -type ErrUnableToReauthenticate struct { - BaseError - ErrOriginal error - ErrReauth error -} - -func (e ErrUnableToReauthenticate) Error() string { - e.DefaultErrString = fmt.Sprintf("Unable to re-authenticate: %s: %s", e.ErrOriginal, e.ErrReauth) - return e.choseErrString() -} - -// ErrErrorAfterReauthentication is the error type returned when reauthentication -// succeeds, but an error occurs afterword (usually an HTTP error). -type ErrErrorAfterReauthentication struct { - BaseError - ErrOriginal error -} - -func (e ErrErrorAfterReauthentication) Error() string { - e.DefaultErrString = fmt.Sprintf("Successfully re-authenticated, but got error executing request: %s", e.ErrOriginal) - return e.choseErrString() -} - -// ErrServiceNotFound is returned when no service in a service catalog matches -// the provided EndpointOpts. This is generally returned by provider service -// factory methods like "NewComputeV2()" and can mean that a service is not -// enabled for your account. -type ErrServiceNotFound struct { - BaseError -} - -func (e ErrServiceNotFound) Error() string { - e.DefaultErrString = "No suitable service could be found in the service catalog." - return e.choseErrString() -} - -// ErrEndpointNotFound is returned when no available endpoints match the -// provided EndpointOpts. This is also generally returned by provider service -// factory methods, and usually indicates that a region was specified -// incorrectly. -type ErrEndpointNotFound struct { - BaseError -} - -func (e ErrEndpointNotFound) Error() string { - e.DefaultErrString = "No suitable endpoint could be found in the service catalog." - return e.choseErrString() -} - -// ErrResourceNotFound is the error when trying to retrieve a resource's -// ID by name and the resource doesn't exist. -type ErrResourceNotFound struct { - BaseError - Name string - ResourceType string -} - -func (e ErrResourceNotFound) Error() string { - e.DefaultErrString = fmt.Sprintf("Unable to find %s with name %s", e.ResourceType, e.Name) - return e.choseErrString() -} - -// ErrMultipleResourcesFound is the error when trying to retrieve a resource's -// ID by name and multiple resources have the user-provided name. -type ErrMultipleResourcesFound struct { - BaseError - Name string - Count int - ResourceType string -} - -func (e ErrMultipleResourcesFound) Error() string { - e.DefaultErrString = fmt.Sprintf("Found %d %ss matching %s", e.Count, e.ResourceType, e.Name) - return e.choseErrString() -} - -// ErrUnexpectedType is the error when an unexpected type is encountered -type ErrUnexpectedType struct { - BaseError - Expected string - Actual string -} - -func (e ErrUnexpectedType) Error() string { - e.DefaultErrString = fmt.Sprintf("Expected %s but got %s", e.Expected, e.Actual) - return e.choseErrString() -} - -func unacceptedAttributeErr(attribute string) string { - return fmt.Sprintf("The base Identity V3 API does not accept authentication by %s", attribute) -} - -func redundantWithTokenErr(attribute string) string { - return fmt.Sprintf("%s may not be provided when authenticating with a TokenID", attribute) -} - -func redundantWithUserID(attribute string) string { - return fmt.Sprintf("%s may not be provided when authenticating with a UserID", attribute) -} - -// ErrAPIKeyProvided indicates that an APIKey was provided but can't be used. -type ErrAPIKeyProvided struct{ BaseError } - -func (e ErrAPIKeyProvided) Error() string { - return unacceptedAttributeErr("APIKey") -} - -// ErrTenantIDProvided indicates that a TenantID was provided but can't be used. -type ErrTenantIDProvided struct{ BaseError } - -func (e ErrTenantIDProvided) Error() string { - return unacceptedAttributeErr("TenantID") -} - -// ErrTenantNameProvided indicates that a TenantName was provided but can't be used. -type ErrTenantNameProvided struct{ BaseError } - -func (e ErrTenantNameProvided) Error() string { - return unacceptedAttributeErr("TenantName") -} - -// ErrUsernameWithToken indicates that a Username was provided, but token authentication is being used instead. -type ErrUsernameWithToken struct{ BaseError } - -func (e ErrUsernameWithToken) Error() string { - return redundantWithTokenErr("Username") -} - -// ErrUserIDWithToken indicates that a UserID was provided, but token authentication is being used instead. -type ErrUserIDWithToken struct{ BaseError } - -func (e ErrUserIDWithToken) Error() string { - return redundantWithTokenErr("UserID") -} - -// ErrDomainIDWithToken indicates that a DomainID was provided, but token authentication is being used instead. -type ErrDomainIDWithToken struct{ BaseError } - -func (e ErrDomainIDWithToken) Error() string { - return redundantWithTokenErr("DomainID") -} - -// ErrDomainNameWithToken indicates that a DomainName was provided, but token authentication is being used instead.s -type ErrDomainNameWithToken struct{ BaseError } - -func (e ErrDomainNameWithToken) Error() string { - return redundantWithTokenErr("DomainName") -} - -// ErrUsernameOrUserID indicates that neither username nor userID are specified, or both are at once. -type ErrUsernameOrUserID struct{ BaseError } - -func (e ErrUsernameOrUserID) Error() string { - return "Exactly one of Username and UserID must be provided for password authentication" -} - -// ErrDomainIDWithUserID indicates that a DomainID was provided, but unnecessary because a UserID is being used. -type ErrDomainIDWithUserID struct{ BaseError } - -func (e ErrDomainIDWithUserID) Error() string { - return redundantWithUserID("DomainID") -} - -// ErrDomainNameWithUserID indicates that a DomainName was provided, but unnecessary because a UserID is being used. -type ErrDomainNameWithUserID struct{ BaseError } - -func (e ErrDomainNameWithUserID) Error() string { - return redundantWithUserID("DomainName") -} - -// ErrDomainIDOrDomainName indicates that a username was provided, but no domain to scope it. -// It may also indicate that both a DomainID and a DomainName were provided at once. -type ErrDomainIDOrDomainName struct{ BaseError } - -func (e ErrDomainIDOrDomainName) Error() string { - return "You must provide exactly one of DomainID or DomainName to authenticate by Username" -} - -// ErrMissingPassword indicates that no password was provided and no token is available. -type ErrMissingPassword struct{ BaseError } - -func (e ErrMissingPassword) Error() string { - return "You must provide a password to authenticate" -} - -// ErrScopeDomainIDOrDomainName indicates that a domain ID or Name was required in a Scope, but not present. -type ErrScopeDomainIDOrDomainName struct{ BaseError } - -func (e ErrScopeDomainIDOrDomainName) Error() string { - return "You must provide exactly one of DomainID or DomainName in a Scope with ProjectName" -} - -// ErrScopeProjectIDOrProjectName indicates that both a ProjectID and a ProjectName were provided in a Scope. -type ErrScopeProjectIDOrProjectName struct{ BaseError } - -func (e ErrScopeProjectIDOrProjectName) Error() string { - return "You must provide at most one of ProjectID or ProjectName in a Scope" -} - -// ErrScopeProjectIDAlone indicates that a ProjectID was provided with other constraints in a Scope. -type ErrScopeProjectIDAlone struct{ BaseError } - -func (e ErrScopeProjectIDAlone) Error() string { - return "ProjectID must be supplied alone in a Scope" -} - -// ErrScopeEmpty indicates that no credentials were provided in a Scope. -type ErrScopeEmpty struct{ BaseError } - -func (e ErrScopeEmpty) Error() string { - return "You must provide either a Project or Domain in a Scope" -} - -// ErrAppCredMissingSecret indicates that no Application Credential Secret was provided with Application Credential ID or Name -type ErrAppCredMissingSecret struct{ BaseError } - -func (e ErrAppCredMissingSecret) Error() string { - return "You must provide an Application Credential Secret" -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/params.go b/vendor/github.com/gophercloud/gophercloud/v2/params.go deleted file mode 100644 index 4a2ed6c9425b..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/params.go +++ /dev/null @@ -1,544 +0,0 @@ -package gophercloud - -import ( - "encoding/json" - "fmt" - "net/url" - "reflect" - "strconv" - "strings" - "time" -) - -/* -BuildRequestBody builds a map[string]interface from the given `struct`, or -collection of `structs`. If parent is not an empty string, the final -map[string]interface returned will encapsulate the built one. Parent is -required when passing a list of `structs`. -For example: - - disk := 1 - createOpts := flavors.CreateOpts{ - ID: "1", - Name: "m1.tiny", - Disk: &disk, - RAM: 512, - VCPUs: 1, - RxTxFactor: 1.0, - } - - body, err := gophercloud.BuildRequestBody(createOpts, "flavor") - - - opts := []rules.CreateOpts{ - { - Direction: "ingress", - PortRangeMin: 80, - EtherType: rules.EtherType4, - PortRangeMax: 80, - Protocol: "tcp", - SecGroupID: "a7734e61-b545-452d-a3cd-0189cbd9747a", - }, - { - Direction: "ingress", - PortRangeMin: 443, - EtherType: rules.EtherType4, - PortRangeMax: 443, - Protocol: "tcp", - SecGroupID: "a7734e61-b545-452d-a3cd-0189cbd9747a", - }, - } - - body, err := gophercloud.BuildRequestBody(opts, "security_group_rules") - -The above examples can be run as-is, however it is recommended to look at how -BuildRequestBody is used within Gophercloud to more fully understand how it -fits within the request process as a whole rather than use it directly as shown -above. -*/ -func BuildRequestBody(opts any, parent string) (map[string]any, error) { - optsValue := reflect.ValueOf(opts) - if optsValue.Kind() == reflect.Ptr { - optsValue = optsValue.Elem() - } - - optsType := reflect.TypeOf(opts) - if optsType.Kind() == reflect.Ptr { - optsType = optsType.Elem() - } - - optsMap := make(map[string]any) - switch optsValue.Kind() { - case reflect.Struct: - //fmt.Printf("optsValue.Kind() is a reflect.Struct: %+v\n", optsValue.Kind()) - for i := 0; i < optsValue.NumField(); i++ { - v := optsValue.Field(i) - f := optsType.Field(i) - - if f.Name != strings.Title(f.Name) { - //fmt.Printf("Skipping field: %s...\n", f.Name) - continue - } - - //fmt.Printf("Starting on field: %s...\n", f.Name) - - zero := isZero(v) - //fmt.Printf("v is zero?: %v\n", zero) - - // if the field has a required tag that's set to "true" - if requiredTag := f.Tag.Get("required"); requiredTag == "true" { - //fmt.Printf("Checking required field [%s]:\n\tv: %+v\n\tisZero:%v\n", f.Name, v.Interface(), zero) - // if the field's value is zero, return a missing-argument error - if zero { - // if the field has a 'required' tag, it can't have a zero-value - err := ErrMissingInput{} - err.Argument = f.Name - return nil, err - } - } - - if xorTag := f.Tag.Get("xor"); xorTag != "" { - //fmt.Printf("Checking `xor` tag for field [%s] with value %+v:\n\txorTag: %s\n", f.Name, v, xorTag) - xorField := optsValue.FieldByName(xorTag) - var xorFieldIsZero bool - if reflect.ValueOf(xorField.Interface()) == reflect.Zero(xorField.Type()) { - xorFieldIsZero = true - } else { - if xorField.Kind() == reflect.Ptr { - xorField = xorField.Elem() - } - xorFieldIsZero = isZero(xorField) - } - if !(zero != xorFieldIsZero) { - err := ErrMissingInput{} - err.Argument = fmt.Sprintf("%s/%s", f.Name, xorTag) - err.Info = fmt.Sprintf("Exactly one of %s and %s must be provided", f.Name, xorTag) - return nil, err - } - } - - if orTag := f.Tag.Get("or"); orTag != "" { - //fmt.Printf("Checking `or` tag for field with:\n\tname: %+v\n\torTag:%s\n", f.Name, orTag) - //fmt.Printf("field is zero?: %v\n", zero) - if zero { - orField := optsValue.FieldByName(orTag) - var orFieldIsZero bool - if reflect.ValueOf(orField.Interface()) == reflect.Zero(orField.Type()) { - orFieldIsZero = true - } else { - if orField.Kind() == reflect.Ptr { - orField = orField.Elem() - } - orFieldIsZero = isZero(orField) - } - if orFieldIsZero { - err := ErrMissingInput{} - err.Argument = fmt.Sprintf("%s/%s", f.Name, orTag) - err.Info = fmt.Sprintf("At least one of %s and %s must be provided", f.Name, orTag) - return nil, err - } - } - } - - jsonTag := f.Tag.Get("json") - if jsonTag == "-" { - continue - } - - if v.Kind() == reflect.Slice || (v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Slice) { - sliceValue := v - if sliceValue.Kind() == reflect.Ptr { - sliceValue = sliceValue.Elem() - } - - for i := 0; i < sliceValue.Len(); i++ { - element := sliceValue.Index(i) - if element.Kind() == reflect.Struct || (element.Kind() == reflect.Ptr && element.Elem().Kind() == reflect.Struct) { - _, err := BuildRequestBody(element.Interface(), "") - if err != nil { - return nil, err - } - } - } - } - if v.Kind() == reflect.Struct || (v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct) { - if zero { - //fmt.Printf("value before change: %+v\n", optsValue.Field(i)) - if jsonTag != "" { - jsonTagPieces := strings.Split(jsonTag, ",") - if len(jsonTagPieces) > 1 && jsonTagPieces[1] == "omitempty" { - if v.CanSet() { - if !v.IsNil() { - if v.Kind() == reflect.Ptr { - v.Set(reflect.Zero(v.Type())) - } - } - //fmt.Printf("value after change: %+v\n", optsValue.Field(i)) - } - } - } - continue - } - - //fmt.Printf("Calling BuildRequestBody with:\n\tv: %+v\n\tf.Name:%s\n", v.Interface(), f.Name) - _, err := BuildRequestBody(v.Interface(), f.Name) - if err != nil { - return nil, err - } - } - } - - //fmt.Printf("opts: %+v \n", opts) - - b, err := json.Marshal(opts) - if err != nil { - return nil, err - } - - //fmt.Printf("string(b): %s\n", string(b)) - - err = json.Unmarshal(b, &optsMap) - if err != nil { - return nil, err - } - - //fmt.Printf("optsMap: %+v\n", optsMap) - - if parent != "" { - optsMap = map[string]any{parent: optsMap} - } - //fmt.Printf("optsMap after parent added: %+v\n", optsMap) - return optsMap, nil - case reflect.Slice, reflect.Array: - optsMaps := make([]map[string]any, optsValue.Len()) - for i := 0; i < optsValue.Len(); i++ { - b, err := BuildRequestBody(optsValue.Index(i).Interface(), "") - if err != nil { - return nil, err - } - optsMaps[i] = b - } - if parent == "" { - return nil, fmt.Errorf("Parent is required when passing an array or a slice.") - } - return map[string]any{parent: optsMaps}, nil - } - // Return an error if we can't work with the underlying type of 'opts' - return nil, fmt.Errorf("Options type is not a struct, a slice, or an array.") -} - -// EnabledState is a convenience type, mostly used in Create and Update -// operations. Because the zero value of a bool is FALSE, we need to use a -// pointer instead to indicate zero-ness. -type EnabledState *bool - -// Convenience vars for EnabledState values. -var ( - iTrue = true - iFalse = false - - Enabled EnabledState = &iTrue - Disabled EnabledState = &iFalse -) - -// IPVersion is a type for the possible IP address versions. Valid instances -// are IPv4 and IPv6 -type IPVersion int - -const ( - // IPv4 is used for IP version 4 addresses - IPv4 IPVersion = 4 - // IPv6 is used for IP version 6 addresses - IPv6 IPVersion = 6 -) - -// IntToPointer is a function for converting integers into integer pointers. -// This is useful when passing in options to operations. -func IntToPointer(i int) *int { - return &i -} - -/* -MaybeString is an internal function to be used by request methods in individual -resource packages. - -It takes a string that might be a zero value and returns either a pointer to its -address or nil. This is useful for allowing users to conveniently omit values -from an options struct by leaving them zeroed, but still pass nil to the JSON -serializer so they'll be omitted from the request body. -*/ -func MaybeString(original string) *string { - if original != "" { - return &original - } - return nil -} - -/* -MaybeInt is an internal function to be used by request methods in individual -resource packages. - -Like MaybeString, it accepts an int that may or may not be a zero value, and -returns either a pointer to its address or nil. It's intended to hint that the -JSON serializer should omit its field. -*/ -func MaybeInt(original int) *int { - if original != 0 { - return &original - } - return nil -} - -/* -func isUnderlyingStructZero(v reflect.Value) bool { - switch v.Kind() { - case reflect.Ptr: - return isUnderlyingStructZero(v.Elem()) - default: - return isZero(v) - } -} -*/ - -var t time.Time - -func isZero(v reflect.Value) bool { - //fmt.Printf("\n\nchecking isZero for value: %+v\n", v) - switch v.Kind() { - case reflect.Ptr: - if v.IsNil() { - return true - } - return false - case reflect.Func, reflect.Map, reflect.Slice: - return v.IsNil() - case reflect.Array: - z := true - for i := 0; i < v.Len(); i++ { - z = z && isZero(v.Index(i)) - } - return z - case reflect.Struct: - if v.Type() == reflect.TypeOf(t) { - return v.Interface().(time.Time).IsZero() - } - z := true - for i := 0; i < v.NumField(); i++ { - z = z && isZero(v.Field(i)) - } - return z - } - // Compare other types directly: - z := reflect.Zero(v.Type()) - //fmt.Printf("zero type for value: %+v\n\n\n", z) - return v.Interface() == z.Interface() -} - -/* -BuildQueryString is an internal function to be used by request methods in -individual resource packages. - -It accepts a tagged structure and expands it into a URL struct. Field names are -converted into query parameters based on a "q" tag. For example: - - type struct Something { - Bar string `q:"x_bar"` - Baz int `q:"lorem_ipsum"` - } - - instance := Something{ - Bar: "AAA", - Baz: "BBB", - } - -will be converted into "?x_bar=AAA&lorem_ipsum=BBB". - -The struct's fields may be strings, integers, slices, or boolean values. Fields -left at their type's zero value will be omitted from the query. - -Slice are handled in one of two ways: - - type struct Something { - Bar []string `q:"bar"` // E.g. ?bar=1&bar=2 - Baz []int `q:"baz" format="comma-separated"` // E.g. ?baz=1,2 - } -*/ -func BuildQueryString(opts any) (*url.URL, error) { - optsValue := reflect.ValueOf(opts) - if optsValue.Kind() == reflect.Ptr { - optsValue = optsValue.Elem() - } - - optsType := reflect.TypeOf(opts) - if optsType.Kind() == reflect.Ptr { - optsType = optsType.Elem() - } - - params := url.Values{} - - if optsValue.Kind() == reflect.Struct { - for i := 0; i < optsValue.NumField(); i++ { - v := optsValue.Field(i) - f := optsType.Field(i) - qTag := f.Tag.Get("q") - - // if the field has a 'q' tag, it goes in the query string - if qTag != "" { - tags := strings.Split(qTag, ",") - - // if the field is set, add it to the slice of query pieces - if !isZero(v) { - loop: - switch v.Kind() { - case reflect.Ptr: - v = v.Elem() - goto loop - case reflect.String: - params.Add(tags[0], v.String()) - case reflect.Int: - params.Add(tags[0], strconv.FormatInt(v.Int(), 10)) - case reflect.Bool: - params.Add(tags[0], strconv.FormatBool(v.Bool())) - case reflect.Slice: - var values []string - switch v.Type().Elem() { - case reflect.TypeOf(0): - for i := 0; i < v.Len(); i++ { - values = append(values, strconv.FormatInt(v.Index(i).Int(), 10)) - } - default: - for i := 0; i < v.Len(); i++ { - values = append(values, v.Index(i).String()) - } - } - if sliceFormat := f.Tag.Get("format"); sliceFormat == "comma-separated" { - params.Add(tags[0], strings.Join(values, ",")) - } else { - params[tags[0]] = append(params[tags[0]], values...) - } - case reflect.Map: - if v.Type().Key().Kind() == reflect.String && v.Type().Elem().Kind() == reflect.String { - var s []string - for _, k := range v.MapKeys() { - value := v.MapIndex(k).String() - s = append(s, fmt.Sprintf("'%s':'%s'", k.String(), value)) - } - params.Add(tags[0], fmt.Sprintf("{%s}", strings.Join(s, ", "))) - } - } - } else { - // if the field has a 'required' tag, it can't have a zero-value - if requiredTag := f.Tag.Get("required"); requiredTag == "true" { - return &url.URL{}, fmt.Errorf("Required query parameter [%s] not set.", f.Name) - } - } - } - } - - return &url.URL{RawQuery: params.Encode()}, nil - } - // Return an error if the underlying type of 'opts' isn't a struct. - return nil, fmt.Errorf("Options type is not a struct.") -} - -/* -BuildHeaders is an internal function to be used by request methods in -individual resource packages. - -It accepts an arbitrary tagged structure and produces a string map that's -suitable for use as the HTTP headers of an outgoing request. Field names are -mapped to header names based in "h" tags. - - type struct Something { - Bar string `h:"x_bar"` - Baz int `h:"lorem_ipsum"` - } - - instance := Something{ - Bar: "AAA", - Baz: "BBB", - } - -will be converted into: - - map[string]string{ - "x_bar": "AAA", - "lorem_ipsum": "BBB", - } - -Untagged fields and fields left at their zero values are skipped. Integers, -booleans and string values are supported. -*/ -func BuildHeaders(opts any) (map[string]string, error) { - optsValue := reflect.ValueOf(opts) - if optsValue.Kind() == reflect.Ptr { - optsValue = optsValue.Elem() - } - - optsType := reflect.TypeOf(opts) - if optsType.Kind() == reflect.Ptr { - optsType = optsType.Elem() - } - - optsMap := make(map[string]string) - if optsValue.Kind() == reflect.Struct { - for i := 0; i < optsValue.NumField(); i++ { - v := optsValue.Field(i) - f := optsType.Field(i) - hTag := f.Tag.Get("h") - - // if the field has a 'h' tag, it goes in the header - if hTag != "" { - tags := strings.Split(hTag, ",") - - // if the field is set, add it to the slice of query pieces - if !isZero(v) { - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - switch v.Kind() { - case reflect.String: - optsMap[tags[0]] = v.String() - case reflect.Int: - optsMap[tags[0]] = strconv.FormatInt(v.Int(), 10) - case reflect.Int64: - optsMap[tags[0]] = strconv.FormatInt(v.Int(), 10) - case reflect.Bool: - optsMap[tags[0]] = strconv.FormatBool(v.Bool()) - } - } else { - // if the field has a 'required' tag, it can't have a zero-value - if requiredTag := f.Tag.Get("required"); requiredTag == "true" { - return optsMap, fmt.Errorf("Required header [%s] not set.", f.Name) - } - } - } - - } - return optsMap, nil - } - // Return an error if the underlying type of 'opts' isn't a struct. - return optsMap, fmt.Errorf("Options type is not a struct.") -} - -// IDSliceToQueryString takes a slice of elements and converts them into a query -// string. For example, if name=foo and slice=[]int{20, 40, 60}, then the -// result would be `?name=20&name=40&name=60' -func IDSliceToQueryString(name string, ids []int) string { - str := "" - for k, v := range ids { - if k == 0 { - str += "?" - } else { - str += "&" - } - str += fmt.Sprintf("%s=%s", name, strconv.Itoa(v)) - } - return str -} - -// IntWithinRange returns TRUE if an integer falls within a defined range, and -// FALSE if not. -func IntWithinRange(val, min, max int) bool { - return val > min && val < max -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go b/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go deleted file mode 100644 index a9bde9457c01..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go +++ /dev/null @@ -1,576 +0,0 @@ -package gophercloud - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "io" - "net/http" - "slices" - "strings" - "sync" -) - -// DefaultUserAgent is the default User-Agent string set in the request header. -const ( - DefaultUserAgent = "gophercloud/v2.10.0" - DefaultMaxBackoffRetries = 60 -) - -// UserAgent represents a User-Agent header. -type UserAgent struct { - // prepend is the slice of User-Agent strings to prepend to DefaultUserAgent. - // All the strings to prepend are accumulated and prepended in the Join method. - prepend []string -} - -type RetryBackoffFunc func(context.Context, *ErrUnexpectedResponseCode, error, uint) error - -// RetryFunc is a catch-all function for retrying failed API requests. -// If it returns nil, the request will be retried. If it returns an error, -// the request method will exit with that error. failCount is the number of -// times the request has failed (starting at 1). -type RetryFunc func(context context.Context, method, url string, options *RequestOpts, err error, failCount uint) error - -// Prepend prepends a user-defined string to the default User-Agent string. Users -// may pass in one or more strings to prepend. -func (ua *UserAgent) Prepend(s ...string) { - ua.prepend = append(s, ua.prepend...) -} - -// Join concatenates all the user-defined User-Agend strings with the default -// Gophercloud User-Agent string. -func (ua *UserAgent) Join() string { - uaSlice := append(ua.prepend, DefaultUserAgent) - return strings.Join(uaSlice, " ") -} - -// ProviderClient stores details that are required to interact with any -// services within a specific provider's API. -// -// Generally, you acquire a ProviderClient by calling the NewClient method in -// the appropriate provider's child package, providing whatever authentication -// credentials are required. -type ProviderClient struct { - // IdentityBase is the base URL used for a particular provider's identity - // service - it will be used when issuing authenticatation requests. It - // should point to the root resource of the identity service, not a specific - // identity version. - IdentityBase string - - // IdentityEndpoint is the identity endpoint. This may be a specific version - // of the identity service. If this is the case, this endpoint is used rather - // than querying versions first. - IdentityEndpoint string - - // TokenID is the ID of the most recently issued valid token. - // NOTE: Aside from within a custom ReauthFunc, this field shouldn't be set by an application. - // To safely read or write this value, call `Token` or `SetToken`, respectively - TokenID string - - // EndpointLocator describes how this provider discovers the endpoints for - // its constituent services. - EndpointLocator EndpointLocator - - // HTTPClient allows users to interject arbitrary http, https, or other transit behaviors. - HTTPClient http.Client - - // UserAgent represents the User-Agent header in the HTTP request. - UserAgent UserAgent - - // ReauthFunc is the function used to re-authenticate the user if the request - // fails with a 401 HTTP response code. This a needed because there may be multiple - // authentication functions for different Identity service versions. - ReauthFunc func(context.Context) error - - // Throwaway determines whether if this client is a throw-away client. It's a copy of user's provider client - // with the token and reauth func zeroed. Such client can be used to perform reauthorization. - Throwaway bool - - // Retry backoff func is called when rate limited. - RetryBackoffFunc RetryBackoffFunc - - // MaxBackoffRetries set the maximum number of backoffs. When not set, defaults to DefaultMaxBackoffRetries - MaxBackoffRetries uint - - // A general failed request handler method - this is always called in the end if a request failed. Leave as nil - // to abort when an error is encountered. - RetryFunc RetryFunc - - // mut is a mutex for the client. It protects read and write access to client attributes such as getting - // and setting the TokenID. - mut *sync.RWMutex - - // reauthmut is a mutex for reauthentication it attempts to ensure that only one reauthentication - // attempt happens at one time. - reauthmut *reauthlock - - authResult AuthResult -} - -// reauthlock represents a set of attributes used to help in the reauthentication process. -type reauthlock struct { - sync.RWMutex - ongoing *reauthFuture -} - -// reauthFuture represents future result of the reauthentication process. -// while done channel is not closed, reauthentication is in progress. -// when done channel is closed, err contains the result of reauthentication. -type reauthFuture struct { - done chan struct{} - err error -} - -func newReauthFuture() *reauthFuture { - return &reauthFuture{ - make(chan struct{}), - nil, - } -} - -func (f *reauthFuture) Set(err error) { - f.err = err - close(f.done) -} - -func (f *reauthFuture) Get() error { - <-f.done - return f.err -} - -// AuthenticatedHeaders returns a map of HTTP headers that are common for all -// authenticated service requests. Blocks if Reauthenticate is in progress. -func (client *ProviderClient) AuthenticatedHeaders() (m map[string]string) { - if client.IsThrowaway() { - return - } - if client.reauthmut != nil { - // If a Reauthenticate is in progress, wait for it to complete. - client.reauthmut.Lock() - ongoing := client.reauthmut.ongoing - client.reauthmut.Unlock() - if ongoing != nil { - _ = ongoing.Get() - } - } - t := client.Token() - if t == "" { - return - } - return map[string]string{"X-Auth-Token": t} -} - -// UseTokenLock creates a mutex that is used to allow safe concurrent access to the auth token. -// If the application's ProviderClient is not used concurrently, this doesn't need to be called. -func (client *ProviderClient) UseTokenLock() { - client.mut = new(sync.RWMutex) - client.reauthmut = new(reauthlock) -} - -// GetAuthResult returns the result from the request that was used to obtain a -// provider client's Keystone token. -// -// The result is nil when authentication has not yet taken place, when the token -// was set manually with SetToken(), or when a ReauthFunc was used that does not -// record the AuthResult. -func (client *ProviderClient) GetAuthResult() AuthResult { - if client.mut != nil { - client.mut.RLock() - defer client.mut.RUnlock() - } - return client.authResult -} - -// Token safely reads the value of the auth token from the ProviderClient. Applications should -// call this method to access the token instead of the TokenID field -func (client *ProviderClient) Token() string { - if client.mut != nil { - client.mut.RLock() - defer client.mut.RUnlock() - } - return client.TokenID -} - -// SetToken safely sets the value of the auth token in the ProviderClient. Applications may -// use this method in a custom ReauthFunc. -// -// WARNING: This function is deprecated. Use SetTokenAndAuthResult() instead. -func (client *ProviderClient) SetToken(t string) { - if client.mut != nil { - client.mut.Lock() - defer client.mut.Unlock() - } - client.TokenID = t - client.authResult = nil -} - -// SetTokenAndAuthResult safely sets the value of the auth token in the -// ProviderClient and also records the AuthResult that was returned from the -// token creation request. Applications may call this in a custom ReauthFunc. -func (client *ProviderClient) SetTokenAndAuthResult(r AuthResult) error { - tokenID := "" - var err error - if r != nil { - tokenID, err = r.ExtractTokenID() - if err != nil { - return err - } - } - - if client.mut != nil { - client.mut.Lock() - defer client.mut.Unlock() - } - client.TokenID = tokenID - client.authResult = r - return nil -} - -// CopyTokenFrom safely copies the token from another ProviderClient into the -// this one. -func (client *ProviderClient) CopyTokenFrom(other *ProviderClient) { - if client.mut != nil { - client.mut.Lock() - defer client.mut.Unlock() - } - if other.mut != nil && other.mut != client.mut { - other.mut.RLock() - defer other.mut.RUnlock() - } - client.TokenID = other.TokenID - client.authResult = other.authResult -} - -// IsThrowaway safely reads the value of the client Throwaway field. -func (client *ProviderClient) IsThrowaway() bool { - if client.reauthmut != nil { - client.reauthmut.RLock() - defer client.reauthmut.RUnlock() - } - return client.Throwaway -} - -// SetThrowaway safely sets the value of the client Throwaway field. -func (client *ProviderClient) SetThrowaway(v bool) { - if client.reauthmut != nil { - client.reauthmut.Lock() - defer client.reauthmut.Unlock() - } - client.Throwaway = v -} - -// Reauthenticate calls client.ReauthFunc in a thread-safe way. If this is -// called because of a 401 response, the caller may pass the previous token. In -// this case, the reauthentication can be skipped if another thread has already -// reauthenticated in the meantime. If no previous token is known, an empty -// string should be passed instead to force unconditional reauthentication. -func (client *ProviderClient) Reauthenticate(ctx context.Context, previousToken string) error { - if client.ReauthFunc == nil { - return nil - } - - if client.reauthmut == nil { - return client.ReauthFunc(ctx) - } - - future := newReauthFuture() - - // Check if a Reauthenticate is in progress, or start one if not. - client.reauthmut.Lock() - ongoing := client.reauthmut.ongoing - if ongoing == nil { - client.reauthmut.ongoing = future - } - client.reauthmut.Unlock() - - // If Reauthenticate is running elsewhere, wait for its result. - if ongoing != nil { - return ongoing.Get() - } - - // Perform the actual reauthentication. - var err error - if previousToken == "" || client.TokenID == previousToken { - err = client.ReauthFunc(ctx) - } else { - err = nil - } - - // Mark Reauthenticate as finished. - client.reauthmut.Lock() - client.reauthmut.ongoing.Set(err) - client.reauthmut.ongoing = nil - client.reauthmut.Unlock() - - return err -} - -// RequestOpts customizes the behavior of the provider.Request() method. -type RequestOpts struct { - // JSONBody, if provided, will be encoded as JSON and used as the body of the HTTP request. The - // content type of the request will default to "application/json" unless overridden by MoreHeaders. - // It's an error to specify both a JSONBody and a RawBody. - JSONBody any - // RawBody contains an io.Reader that will be consumed by the request directly. No content-type - // will be set unless one is provided explicitly by MoreHeaders. - RawBody io.Reader - // JSONResponse, if provided, will be populated with the contents of the response body parsed as - // JSON. - JSONResponse any - // OkCodes contains a list of numeric HTTP status codes that should be interpreted as success. If - // the response has a different code, an error will be returned. - OkCodes []int - // MoreHeaders specifies additional HTTP headers to be provided on the request. - // MoreHeaders will be overridden by OmitHeaders - MoreHeaders map[string]string - // OmitHeaders specifies the HTTP headers which should be omitted. - // OmitHeaders will override MoreHeaders - OmitHeaders []string - // KeepResponseBody specifies whether to keep the HTTP response body. Usually used, when the HTTP - // response body is considered for further use. Valid when JSONResponse is nil. - KeepResponseBody bool -} - -// requestState contains temporary state for a single ProviderClient.Request() call. -type requestState struct { - // This flag indicates if we have reauthenticated during this request because of a 401 response. - // It ensures that we don't reauthenticate multiple times for a single request. If we - // reauthenticate, but keep getting 401 responses with the fresh token, reauthenticating some more - // will just get us into an infinite loop. - hasReauthenticated bool - // Retry-After backoff counter, increments during each backoff call - retries uint -} - -var applicationJSON = "application/json" - -// Request performs an HTTP request using the ProviderClient's -// current HTTPClient. An authentication header will automatically be provided. -func (client *ProviderClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error) { - return client.doRequest(ctx, method, url, options, &requestState{ - hasReauthenticated: false, - }) -} - -func (client *ProviderClient) doRequest(ctx context.Context, method, url string, options *RequestOpts, state *requestState) (*http.Response, error) { - var body io.Reader - var contentType *string - - // Derive the content body by either encoding an arbitrary object as JSON, or by taking a provided - // io.ReadSeeker as-is. Default the content-type to application/json. - if options.JSONBody != nil { - if options.RawBody != nil { - return nil, errors.New("please provide only one of JSONBody or RawBody to gophercloud.Request()") - } - - rendered, err := json.Marshal(options.JSONBody) - if err != nil { - return nil, err - } - - body = bytes.NewReader(rendered) - contentType = &applicationJSON - } - - // Return an error, when "KeepResponseBody" is true and "JSONResponse" is not nil - if options.KeepResponseBody && options.JSONResponse != nil { - return nil, errors.New("cannot use KeepResponseBody when JSONResponse is not nil") - } - - if options.RawBody != nil { - body = options.RawBody - } - - req, err := http.NewRequestWithContext(ctx, method, url, body) - if err != nil { - return nil, err - } - - // Populate the request headers. - // Apply options.MoreHeaders and options.OmitHeaders, to give the caller the chance to - // modify or omit any header. - if contentType != nil { - req.Header.Set("Content-Type", *contentType) - } - req.Header.Set("Accept", applicationJSON) - - // Set the User-Agent header - req.Header.Set("User-Agent", client.UserAgent.Join()) - - if options.MoreHeaders != nil { - for k, v := range options.MoreHeaders { - req.Header.Set(k, v) - } - } - - for _, v := range options.OmitHeaders { - req.Header.Del(v) - } - - // get latest token from client - for k, v := range client.AuthenticatedHeaders() { - req.Header.Set(k, v) - } - - prereqtok := req.Header.Get("X-Auth-Token") - - // Issue the request. - resp, err := client.HTTPClient.Do(req) - if err != nil { - if client.RetryFunc != nil { - var e error - state.retries = state.retries + 1 - e = client.RetryFunc(ctx, method, url, options, err, state.retries) - if e != nil { - return nil, e - } - - return client.doRequest(ctx, method, url, options, state) - } - return nil, err - } - - // Allow default OkCodes if none explicitly set - okc := options.OkCodes - if okc == nil { - okc = defaultOkCodes(method) - } - - // Check the response code against the acceptable codes - if !slices.Contains(okc, resp.StatusCode) { - body, _ := io.ReadAll(resp.Body) - resp.Body.Close() - respErr := ErrUnexpectedResponseCode{ - URL: url, - Method: method, - Expected: okc, - Actual: resp.StatusCode, - Body: body, - ResponseHeader: resp.Header, - } - - switch resp.StatusCode { - case http.StatusUnauthorized: - if client.ReauthFunc != nil && !state.hasReauthenticated { - err = client.Reauthenticate(ctx, prereqtok) - if err != nil { - e := &ErrUnableToReauthenticate{} - e.ErrOriginal = respErr - e.ErrReauth = err - return nil, e - } - if options.RawBody != nil { - if seeker, ok := options.RawBody.(io.Seeker); ok { - if _, err := seeker.Seek(0, 0); err != nil { - return nil, err - } - } - } - state.hasReauthenticated = true - resp, err = client.doRequest(ctx, method, url, options, state) - if err != nil { - switch e := err.(type) { - case *ErrUnexpectedResponseCode: - err := &ErrErrorAfterReauthentication{} - err.ErrOriginal = e - return nil, err - default: - err := &ErrErrorAfterReauthentication{} - err.ErrOriginal = e - return nil, err - } - } - return resp, nil - } - case http.StatusTooManyRequests, 498: - maxTries := client.MaxBackoffRetries - if maxTries == 0 { - maxTries = DefaultMaxBackoffRetries - } - - if f := client.RetryBackoffFunc; f != nil && state.retries < maxTries { - var e error - - state.retries = state.retries + 1 - e = f(ctx, &respErr, err, state.retries) - - if e != nil { - return resp, e - } - - return client.doRequest(ctx, method, url, options, state) - } - } - - if err == nil { - err = respErr - } - - if err != nil && client.RetryFunc != nil { - var e error - state.retries = state.retries + 1 - e = client.RetryFunc(ctx, method, url, options, err, state.retries) - if e != nil { - return resp, e - } - - return client.doRequest(ctx, method, url, options, state) - } - - return resp, err - } - - // Parse the response body as JSON, if requested to do so. - if options.JSONResponse != nil { - defer resp.Body.Close() - // Don't decode JSON when there is no content - if resp.StatusCode == http.StatusNoContent { - // read till EOF, otherwise the connection will be closed and cannot be reused - _, err = io.Copy(io.Discard, resp.Body) - return resp, err - } - if err := json.NewDecoder(resp.Body).Decode(options.JSONResponse); err != nil { - if client.RetryFunc != nil { - var e error - state.retries = state.retries + 1 - e = client.RetryFunc(ctx, method, url, options, err, state.retries) - if e != nil { - return resp, e - } - - return client.doRequest(ctx, method, url, options, state) - } - return nil, err - } - } - - // Close unused body to allow the HTTP connection to be reused - if !options.KeepResponseBody && options.JSONResponse == nil { - defer resp.Body.Close() - // read till EOF, otherwise the connection will be closed and cannot be reused - if _, err := io.Copy(io.Discard, resp.Body); err != nil { - return nil, err - } - } - - return resp, nil -} - -func defaultOkCodes(method string) []int { - switch method { - case "GET", "HEAD": - return []int{200} - case "POST": - return []int{201, 202} - case "PUT": - return []int{201, 202} - case "PATCH": - return []int{200, 202, 204} - case "DELETE": - return []int{202, 204} - } - - return []int{} -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/results.go b/vendor/github.com/gophercloud/gophercloud/v2/results.go deleted file mode 100644 index b12c15a02661..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/results.go +++ /dev/null @@ -1,483 +0,0 @@ -package gophercloud - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "reflect" - "strconv" - "time" -) - -/* -Result is an internal type to be used by individual resource packages, but its -methods will be available on a wide variety of user-facing embedding types. - -It acts as a base struct that other Result types, returned from request -functions, can embed for convenience. All Results capture basic information -from the HTTP transaction that was performed, including the response body, -HTTP headers, and any errors that happened. - -Generally, each Result type will have an Extract method that can be used to -further interpret the result's payload in a specific context. Extensions or -providers can then provide additional extraction functions to pull out -provider- or extension-specific information as well. -*/ -type Result struct { - // Body is the payload of the HTTP response from the server. In most cases, - // this will be the deserialized JSON structure. - Body any - - // StatusCode is the HTTP status code of the original response. Will be - // one of the OkCodes defined on the gophercloud.RequestOpts that was - // used in the request. - StatusCode int - - // Header contains the HTTP header structure from the original response. - Header http.Header - - // Err is an error that occurred during the operation. It's deferred until - // extraction to make it easier to chain the Extract call. - Err error -} - -// ExtractInto allows users to provide an object into which `Extract` will extract -// the `Result.Body`. This would be useful for OpenStack providers that have -// different fields in the response object than OpenStack proper. -func (r Result) ExtractInto(to any) error { - if r.Err != nil { - return r.Err - } - - if reader, ok := r.Body.(io.Reader); ok { - if readCloser, ok := reader.(io.Closer); ok { - defer readCloser.Close() - } - return json.NewDecoder(reader).Decode(to) - } - - b, err := json.Marshal(r.Body) - if err != nil { - return err - } - err = json.Unmarshal(b, to) - - return err -} - -func (r Result) extractIntoPtr(to any, label string) error { - if label == "" { - return r.ExtractInto(&to) - } - - var m map[string]any - err := r.ExtractInto(&m) - if err != nil { - return err - } - - b, err := json.Marshal(m[label]) - if err != nil { - return err - } - - toValue := reflect.ValueOf(to) - if toValue.Kind() == reflect.Ptr { - toValue = toValue.Elem() - } - - switch toValue.Kind() { - case reflect.Slice: - typeOfV := toValue.Type().Elem() - if typeOfV.Kind() == reflect.Struct { - if typeOfV.NumField() > 0 && typeOfV.Field(0).Anonymous { - newSlice := reflect.MakeSlice(reflect.SliceOf(typeOfV), 0, 0) - - if mSlice, ok := m[label].([]any); ok { - for _, v := range mSlice { - // For each iteration of the slice, we create a new struct. - // This is to work around a bug where elements of a slice - // are reused and not overwritten when the same copy of the - // struct is used: - // - // https://github.com/golang/go/issues/21092 - // https://github.com/golang/go/issues/24155 - // https://play.golang.org/p/NHo3ywlPZli - newType := reflect.New(typeOfV).Elem() - - b, err := json.Marshal(v) - if err != nil { - return err - } - - // This is needed for structs with an UnmarshalJSON method. - // Technically this is just unmarshalling the response into - // a struct that is never used, but it's good enough to - // trigger the UnmarshalJSON method. - for i := 0; i < newType.NumField(); i++ { - s := newType.Field(i).Addr().Interface() - - // Unmarshal is used rather than NewDecoder to also work - // around the above-mentioned bug. - err = json.Unmarshal(b, s) - if err != nil { - return err - } - } - - newSlice = reflect.Append(newSlice, newType) - } - } - - // "to" should now be properly modeled to receive the - // JSON response body and unmarshal into all the correct - // fields of the struct or composed extension struct - // at the end of this method. - toValue.Set(newSlice) - - // jtopjian: This was put into place to resolve the issue - // described at - // https://github.com/gophercloud/gophercloud/issues/1963 - // - // This probably isn't the best fix, but it appears to - // be resolving the issue, so I'm going to implement it - // for now. - // - // For future readers, this entire case statement could - // use a review. - return nil - } - } - case reflect.Struct: - typeOfV := toValue.Type() - if typeOfV.NumField() > 0 && typeOfV.Field(0).Anonymous { - for i := 0; i < toValue.NumField(); i++ { - toField := toValue.Field(i) - if toField.Kind() == reflect.Struct { - s := toField.Addr().Interface() - err = json.NewDecoder(bytes.NewReader(b)).Decode(s) - if err != nil { - return err - } - } - } - } - } - - err = json.Unmarshal(b, &to) - return err -} - -// ExtractIntoStructPtr will unmarshal the Result (r) into the provided -// any (to). -// -// NOTE: For internal use only -// -// `to` must be a pointer to an underlying struct type -// -// If provided, `label` will be filtered out of the response -// body prior to `r` being unmarshalled into `to`. -func (r Result) ExtractIntoStructPtr(to any, label string) error { - if r.Err != nil { - return r.Err - } - - if to == nil { - return fmt.Errorf("Expected pointer, got %T", to) - } - - t := reflect.TypeOf(to) - if k := t.Kind(); k != reflect.Ptr { - return fmt.Errorf("Expected pointer, got %v", k) - } - - if reflect.ValueOf(to).IsNil() { - return fmt.Errorf("Expected pointer, got %T", to) - } - - switch t.Elem().Kind() { - case reflect.Struct: - return r.extractIntoPtr(to, label) - default: - return fmt.Errorf("Expected pointer to struct, got: %v", t) - } -} - -// ExtractIntoSlicePtr will unmarshal the Result (r) into the provided -// any (to). -// -// NOTE: For internal use only -// -// `to` must be a pointer to an underlying slice type -// -// If provided, `label` will be filtered out of the response -// body prior to `r` being unmarshalled into `to`. -func (r Result) ExtractIntoSlicePtr(to any, label string) error { - if r.Err != nil { - return r.Err - } - - if to == nil { - return fmt.Errorf("Expected pointer, got %T", to) - } - - t := reflect.TypeOf(to) - if k := t.Kind(); k != reflect.Ptr { - return fmt.Errorf("Expected pointer, got %v", k) - } - - if reflect.ValueOf(to).IsNil() { - return fmt.Errorf("Expected pointer, got %T", to) - } - - switch t.Elem().Kind() { - case reflect.Slice: - return r.extractIntoPtr(to, label) - default: - return fmt.Errorf("Expected pointer to slice, got: %v", t) - } -} - -// PrettyPrintJSON creates a string containing the full response body as -// pretty-printed JSON. It's useful for capturing test fixtures and for -// debugging extraction bugs. If you include its output in an issue related to -// a buggy extraction function, we will all love you forever. -func (r Result) PrettyPrintJSON() string { - pretty, err := json.MarshalIndent(r.Body, "", " ") - if err != nil { - panic(err.Error()) - } - return string(pretty) -} - -// ErrResult is an internal type to be used by individual resource packages, but -// its methods will be available on a wide variety of user-facing embedding -// types. -// -// It represents results that only contain a potential error and -// nothing else. Usually, if the operation executed successfully, the Err field -// will be nil; otherwise it will be stocked with a relevant error. Use the -// ExtractErr method -// to cleanly pull it out. -type ErrResult struct { - Result -} - -// ExtractErr is a function that extracts error information, or nil, from a result. -func (r ErrResult) ExtractErr() error { - return r.Err -} - -/* -HeaderResult is an internal type to be used by individual resource packages, but -its methods will be available on a wide variety of user-facing embedding types. - -It represents a result that only contains an error (possibly nil) and an -http.Header. This is used, for example, by the objectstorage packages in -openstack, because most of the operations don't return response bodies, but do -have relevant information in headers. -*/ -type HeaderResult struct { - Result -} - -// ExtractInto allows users to provide an object into which `Extract` will -// extract the http.Header headers of the result. -func (r HeaderResult) ExtractInto(to any) error { - if r.Err != nil { - return r.Err - } - - tmpHeaderMap := map[string]string{} - for k, v := range r.Header { - if len(v) > 0 { - tmpHeaderMap[k] = v[0] - } - } - - b, err := json.Marshal(tmpHeaderMap) - if err != nil { - return err - } - err = json.Unmarshal(b, to) - - return err -} - -// RFC3339Milli describes a common time format used by some API responses. -const RFC3339Milli = "2006-01-02T15:04:05.999999Z" - -type JSONRFC3339Milli time.Time - -func (jt *JSONRFC3339Milli) UnmarshalJSON(data []byte) error { - b := bytes.NewBuffer(data) - dec := json.NewDecoder(b) - var s string - if err := dec.Decode(&s); err != nil { - return err - } - t, err := time.Parse(RFC3339Milli, s) - if err != nil { - return err - } - *jt = JSONRFC3339Milli(t) - return nil -} - -const RFC3339MilliNoZ = "2006-01-02T15:04:05.999999" - -type JSONRFC3339MilliNoZ time.Time - -func (jt *JSONRFC3339MilliNoZ) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - t, err := time.Parse(RFC3339MilliNoZ, s) - if err != nil { - return err - } - *jt = JSONRFC3339MilliNoZ(t) - return nil -} - -type JSONRFC1123 time.Time - -func (jt *JSONRFC1123) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - t, err := time.Parse(time.RFC1123, s) - if err != nil { - return err - } - *jt = JSONRFC1123(t) - return nil -} - -type JSONUnix time.Time - -func (jt *JSONUnix) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - unix, err := strconv.ParseInt(s, 10, 64) - if err != nil { - return err - } - t = time.Unix(unix, 0) - *jt = JSONUnix(t) - return nil -} - -// RFC3339NoZ is the time format used in Heat (Orchestration). -const RFC3339NoZ = "2006-01-02T15:04:05" - -type JSONRFC3339NoZ time.Time - -func (jt *JSONRFC3339NoZ) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - t, err := time.Parse(RFC3339NoZ, s) - if err != nil { - return err - } - *jt = JSONRFC3339NoZ(t) - return nil -} - -// RFC3339ZNoT is the time format used in Zun (Containers Service). -const RFC3339ZNoT = "2006-01-02 15:04:05-07:00" - -type JSONRFC3339ZNoT time.Time - -func (jt *JSONRFC3339ZNoT) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - t, err := time.Parse(RFC3339ZNoT, s) - if err != nil { - return err - } - *jt = JSONRFC3339ZNoT(t) - return nil -} - -// RFC3339ZNoTNoZ is another time format used in Zun (Containers Service). -const RFC3339ZNoTNoZ = "2006-01-02 15:04:05" - -type JSONRFC3339ZNoTNoZ time.Time - -func (jt *JSONRFC3339ZNoTNoZ) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - if s == "" { - return nil - } - t, err := time.Parse(RFC3339ZNoTNoZ, s) - if err != nil { - return err - } - *jt = JSONRFC3339ZNoTNoZ(t) - return nil -} - -/* -Link is an internal type to be used in packages of collection resources that are -paginated in a certain way. - -It's a response substructure common to many paginated collection results that is -used to point to related pages. Usually, the one we care about is the one with -Rel field set to "next". -*/ -type Link struct { - Href string `json:"href"` - Rel string `json:"rel"` -} - -/* -ExtractNextURL is an internal function useful for packages of collection -resources that are paginated in a certain way. - -It attempts to extract the "next" URL from slice of Link structs, or -"" if no such URL is present. -*/ -func ExtractNextURL(links []Link) (string, error) { - var url string - - for _, l := range links { - if l.Rel == "next" { - url = l.Href - } - } - - if url == "" { - return "", nil - } - - return url, nil -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/service_client.go b/vendor/github.com/gophercloud/gophercloud/v2/service_client.go deleted file mode 100644 index 015c3f233942..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/service_client.go +++ /dev/null @@ -1,171 +0,0 @@ -package gophercloud - -import ( - "context" - "io" - "net/http" - "strings" -) - -// ServiceClient stores details required to interact with a specific service API implemented by a provider. -// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient. -type ServiceClient struct { - // ProviderClient is a reference to the provider that implements this service. - *ProviderClient - - // Endpoint is the base URL of the service's API, acquired from a service catalog. - // It MUST end with a /. - Endpoint string - - // ResourceBase is the base URL shared by the resources within a service's API. It should include - // the API version and, like Endpoint, MUST end with a / if set. If not set, the Endpoint is used - // as-is, instead. - ResourceBase string - - // This is the service client type (e.g. compute, sharev2). - // NOTE: FOR INTERNAL USE ONLY. DO NOT SET. GOPHERCLOUD WILL SET THIS. - // It is only exported because it gets set in a different package. - Type string - - // The microversion of the service to use. Set this to use a particular microversion. - Microversion string - - // MoreHeaders allows users (or Gophercloud) to set service-wide headers on requests. Put another way, - // values set in this field will be set on all the HTTP requests the service client sends. - MoreHeaders map[string]string -} - -// ResourceBaseURL returns the base URL of any resources used by this service. It MUST end with a /. -func (client *ServiceClient) ResourceBaseURL() string { - if client.ResourceBase != "" { - return client.ResourceBase - } - return client.Endpoint -} - -// ServiceURL constructs a URL for a resource belonging to this provider. -func (client *ServiceClient) ServiceURL(parts ...string) string { - return client.ResourceBaseURL() + strings.Join(parts, "/") -} - -func (client *ServiceClient) initReqOpts(JSONBody any, JSONResponse any, opts *RequestOpts) { - if v, ok := (JSONBody).(io.Reader); ok { - opts.RawBody = v - } else if JSONBody != nil { - opts.JSONBody = JSONBody - } - - if JSONResponse != nil { - opts.JSONResponse = JSONResponse - } -} - -// Get calls `Request` with the "GET" HTTP verb. -func (client *ServiceClient) Get(ctx context.Context, url string, JSONResponse any, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(nil, JSONResponse, opts) - return client.Request(ctx, "GET", url, opts) -} - -// Post calls `Request` with the "POST" HTTP verb. -func (client *ServiceClient) Post(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request(ctx, "POST", url, opts) -} - -// Put calls `Request` with the "PUT" HTTP verb. -func (client *ServiceClient) Put(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request(ctx, "PUT", url, opts) -} - -// Patch calls `Request` with the "PATCH" HTTP verb. -func (client *ServiceClient) Patch(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request(ctx, "PATCH", url, opts) -} - -// Delete calls `Request` with the "DELETE" HTTP verb. -func (client *ServiceClient) Delete(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(nil, nil, opts) - return client.Request(ctx, "DELETE", url, opts) -} - -// Head calls `Request` with the "HEAD" HTTP verb. -func (client *ServiceClient) Head(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error) { - if opts == nil { - opts = new(RequestOpts) - } - client.initReqOpts(nil, nil, opts) - return client.Request(ctx, "HEAD", url, opts) -} - -func (client *ServiceClient) setMicroversionHeader(opts *RequestOpts) { - serviceType := client.Type - - switch client.Type { - case "compute": - opts.MoreHeaders["X-OpenStack-Nova-API-Version"] = client.Microversion - case "shared-file-system", "sharev2", "share": - opts.MoreHeaders["X-OpenStack-Manila-API-Version"] = client.Microversion - case "block-storage", "block-store", "volume", "volumev3": - opts.MoreHeaders["X-OpenStack-Volume-API-Version"] = client.Microversion - // cinder should accept block-storage but (as of Dalmatian) does not - serviceType = "volume" - case "baremetal": - opts.MoreHeaders["X-OpenStack-Ironic-API-Version"] = client.Microversion - case "baremetal-introspection": - opts.MoreHeaders["X-OpenStack-Ironic-Inspector-API-Version"] = client.Microversion - case "container-infrastructure-management", "container-infrastructure", "container-infra": - // magnum should accept container-infrastructure-management but (as of Epoxy) does not - serviceType = "container-infra" - } - - if client.Type != "" { - opts.MoreHeaders["OpenStack-API-Version"] = serviceType + " " + client.Microversion - } -} - -// Request carries out the HTTP operation for the service client -func (client *ServiceClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error) { - if options.MoreHeaders == nil { - options.MoreHeaders = make(map[string]string) - } - - if client.Microversion != "" { - client.setMicroversionHeader(options) - } - - if len(client.MoreHeaders) > 0 { - if options == nil { - options = new(RequestOpts) - } - - for k, v := range client.MoreHeaders { - options.MoreHeaders[k] = v - } - } - return client.ProviderClient.Request(ctx, method, url, options) -} - -// ParseResponse is a helper function to parse http.Response to constituents. -func ParseResponse(resp *http.Response, err error) (io.ReadCloser, http.Header, error) { - if resp != nil { - return resp.Body, resp.Header, err - } - return nil, nil, err -} diff --git a/vendor/github.com/gophercloud/gophercloud/v2/util.go b/vendor/github.com/gophercloud/gophercloud/v2/util.go deleted file mode 100644 index d11a723b1b3f..000000000000 --- a/vendor/github.com/gophercloud/gophercloud/v2/util.go +++ /dev/null @@ -1,106 +0,0 @@ -package gophercloud - -import ( - "context" - "net/url" - "path/filepath" - "reflect" - "strings" - "time" -) - -// NormalizePathURL is used to convert rawPath to a fqdn, using basePath as -// a reference in the filesystem, if necessary. basePath is assumed to contain -// either '.' when first used, or the file:// type fqdn of the parent resource. -// e.g. myFavScript.yaml => file://opt/lib/myFavScript.yaml -func NormalizePathURL(basePath, rawPath string) (string, error) { - u, err := url.Parse(rawPath) - if err != nil { - return "", err - } - // if a scheme is defined, it must be a fqdn already - if u.Scheme != "" { - return u.String(), nil - } - // if basePath is a url, then child resources are assumed to be relative to it - bu, err := url.Parse(basePath) - if err != nil { - return "", err - } - var basePathSys, absPathSys string - if bu.Scheme != "" { - basePathSys = filepath.FromSlash(bu.Path) - absPathSys = filepath.Join(basePathSys, rawPath) - bu.Path = filepath.ToSlash(absPathSys) - return bu.String(), nil - } - - absPathSys = filepath.Join(basePath, rawPath) - u.Path = filepath.ToSlash(absPathSys) - u.Scheme = "file" - return u.String(), nil -} - -// NormalizeURL is an internal function to be used by provider clients. -// -// It ensures that each endpoint URL has a closing `/`, as expected by -// ServiceClient's methods. -func NormalizeURL(url string) string { - if !strings.HasSuffix(url, "/") { - return url + "/" - } - return url -} - -// RemainingKeys will inspect a struct and compare it to a map. Any struct -// field that does not have a JSON tag that matches a key in the map or -// a matching lower-case field in the map will be returned as an extra. -// -// This is useful for determining the extra fields returned in response bodies -// for resources that can contain an arbitrary or dynamic number of fields. -func RemainingKeys(s any, m map[string]any) (extras map[string]any) { - extras = make(map[string]any) - for k, v := range m { - extras[k] = v - } - - valueOf := reflect.ValueOf(s) - typeOf := reflect.TypeOf(s) - for i := 0; i < valueOf.NumField(); i++ { - field := typeOf.Field(i) - - lowerField := strings.ToLower(field.Name) - delete(extras, lowerField) - - if tagValue := field.Tag.Get("json"); tagValue != "" && tagValue != "-" { - delete(extras, tagValue) - } - } - - return -} - -// WaitFor polls a predicate function, once per second, up to a context cancellation. -// This is useful to wait for a resource to transition to a certain state. -// Resource packages will wrap this in a more convenient function that's -// specific to a certain resource, but it can also be useful on its own. -func WaitFor(ctx context.Context, predicate func(context.Context) (bool, error)) error { - if done, err := predicate(ctx); done || err != nil { - return err - } - - ticker := time.NewTicker(1 * time.Second) - defer ticker.Stop() - - for { - select { - case <-ticker.C: - if done, err := predicate(ctx); done || err != nil { - return err - } - - case <-ctx.Done(): - return ctx.Err() - } - } -} diff --git a/vendor/github.com/openshift-online/ocm-common/pkg/resource/validations/kms_arn_regex_validation.go b/vendor/github.com/openshift-online/ocm-common/pkg/resource/validations/kms_arn_regex_validation.go deleted file mode 100644 index 8830dda6d54e..000000000000 --- a/vendor/github.com/openshift-online/ocm-common/pkg/resource/validations/kms_arn_regex_validation.go +++ /dev/null @@ -1,21 +0,0 @@ -package validations - -import ( - "fmt" - "regexp" -) - -var KmsArnRE = regexp.MustCompile( - `^arn:aws[\w-]*:kms:[\w-]+:\d{12}:key\/(mrk-[0-9a-f]{32}$|[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)`, -) - -func ValidateKMSKeyARN(kmsKeyARN *string) error { - if kmsKeyARN == nil || *kmsKeyARN == "" { - return nil - } - - if !KmsArnRE.MatchString(*kmsKeyARN) { - return fmt.Errorf("expected the kms-key-arn: %s to match %s", *kmsKeyARN, KmsArnRE) - } - return nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/LICENSE b/vendor/github.com/openshift/cluster-api-provider-agent/api/LICENSE deleted file mode 100644 index 261eeb9e9f8b..000000000000 --- a/vendor/github.com/openshift/cluster-api-provider-agent/api/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/conversion.go b/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/conversion.go deleted file mode 100644 index faa73318c7f1..000000000000 --- a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1alpha1/conversion.go +++ /dev/null @@ -1,6 +0,0 @@ -package v1alpha1 - -// Declare the types in this version as the Hub -func (*AgentCluster) Hub() {} -func (*AgentMachine) Hub() {} -func (*AgentMachineTemplate) Hub() {} diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_conversion.go b/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_conversion.go deleted file mode 100644 index fe2e92c12b9b..000000000000 --- a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_conversion.go +++ /dev/null @@ -1,64 +0,0 @@ -package v1beta1 - -import ( - "bytes" - "fmt" - - configv1 "github.com/openshift/api/config/v1" - "github.com/openshift/cluster-api-provider-agent/api/v1alpha1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer/json" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -var ( - localScheme = runtime.NewScheme() - serializer = json.NewSerializerWithOptions( - json.DefaultMetaFactory, localScheme, localScheme, - json.SerializerOptions{Strict: false}, - ) -) - -func init() { - v1alpha1.AddToScheme(localScheme) - configv1.AddToScheme(localScheme) - clientgoscheme.AddToScheme(localScheme) - AddToScheme(localScheme) -} - -func (e *AgentCluster) ConvertTo(rawDst conversion.Hub) error { - return serializationConvert(e, rawDst) -} -func (e *AgentCluster) ConvertFrom(rawSrc conversion.Hub) error { - return serializationConvert(rawSrc, e) -} -func (e *AgentMachine) ConvertTo(rawDst conversion.Hub) error { - return serializationConvert(e, rawDst) -} -func (e *AgentMachine) ConvertFrom(rawSrc conversion.Hub) error { - return serializationConvert(rawSrc, e) -} -func (e *AgentMachineTemplate) ConvertTo(rawDst conversion.Hub) error { - return serializationConvert(e, rawDst) -} -func (e *AgentMachineTemplate) ConvertFrom(rawSrc conversion.Hub) error { - return serializationConvert(rawSrc, e) -} -func serializationConvert(from runtime.Object, to runtime.Object) error { - b := &bytes.Buffer{} - from.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{}) - if err := serializer.Encode(from, b); err != nil { - return fmt.Errorf("cannot serialize %T: %w", from, err) - } - if _, _, err := serializer.Decode(b.Bytes(), nil, to); err != nil { - return fmt.Errorf("cannot decode %T: %w", to, err) - } - gvks, _, err := localScheme.ObjectKinds(to) - if err != nil || len(gvks) == 0 { - return fmt.Errorf("cannot get gvk for %T: %w", to, err) - } - to.GetObjectKind().SetGroupVersionKind(gvks[0]) - return nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_generated.deepcopy.go index c6f41a3ec729..c1f7b6b55d4f 100644 --- a/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/cluster-api-provider-agent/api/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright 2021. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ package v1beta1 import ( "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + runtime "k8s.io/apimachinery/pkg/runtime" corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" "sigs.k8s.io/cluster-api/errors" ) diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b.go b/vendor/golang.org/x/crypto/blake2b/blake2b.go deleted file mode 100644 index d2e98d4295bd..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2b.go +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 -// and the extendable output function (XOF) BLAKE2Xb. -// -// BLAKE2b is optimized for 64-bit platforms—including NEON-enabled ARMs—and -// produces digests of any size between 1 and 64 bytes. -// For a detailed specification of BLAKE2b see https://blake2.net/blake2.pdf -// and for BLAKE2Xb see https://blake2.net/blake2x.pdf -// -// If you aren't sure which function you need, use BLAKE2b (Sum512 or New512). -// If you need a secret-key MAC (message authentication code), use the New512 -// function with a non-nil key. -// -// BLAKE2X is a construction to compute hash values larger than 64 bytes. It -// can produce hash values between 0 and 4 GiB. -package blake2b - -import ( - "encoding/binary" - "errors" - "hash" -) - -const ( - // The blocksize of BLAKE2b in bytes. - BlockSize = 128 - // The hash size of BLAKE2b-512 in bytes. - Size = 64 - // The hash size of BLAKE2b-384 in bytes. - Size384 = 48 - // The hash size of BLAKE2b-256 in bytes. - Size256 = 32 -) - -var ( - useAVX2 bool - useAVX bool - useSSE4 bool -) - -var ( - errKeySize = errors.New("blake2b: invalid key size") - errHashSize = errors.New("blake2b: invalid hash size") -) - -var iv = [8]uint64{ - 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, - 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, -} - -// Sum512 returns the BLAKE2b-512 checksum of the data. -func Sum512(data []byte) [Size]byte { - var sum [Size]byte - checkSum(&sum, Size, data) - return sum -} - -// Sum384 returns the BLAKE2b-384 checksum of the data. -func Sum384(data []byte) [Size384]byte { - var sum [Size]byte - var sum384 [Size384]byte - checkSum(&sum, Size384, data) - copy(sum384[:], sum[:Size384]) - return sum384 -} - -// Sum256 returns the BLAKE2b-256 checksum of the data. -func Sum256(data []byte) [Size256]byte { - var sum [Size]byte - var sum256 [Size256]byte - checkSum(&sum, Size256, data) - copy(sum256[:], sum[:Size256]) - return sum256 -} - -// New512 returns a new hash.Hash computing the BLAKE2b-512 checksum. A non-nil -// key turns the hash into a MAC. The key must be between zero and 64 bytes long. -func New512(key []byte) (hash.Hash, error) { return newDigest(Size, key) } - -// New384 returns a new hash.Hash computing the BLAKE2b-384 checksum. A non-nil -// key turns the hash into a MAC. The key must be between zero and 64 bytes long. -func New384(key []byte) (hash.Hash, error) { return newDigest(Size384, key) } - -// New256 returns a new hash.Hash computing the BLAKE2b-256 checksum. A non-nil -// key turns the hash into a MAC. The key must be between zero and 64 bytes long. -func New256(key []byte) (hash.Hash, error) { return newDigest(Size256, key) } - -// New returns a new hash.Hash computing the BLAKE2b checksum with a custom length. -// A non-nil key turns the hash into a MAC. The key must be between zero and 64 bytes long. -// The hash size can be a value between 1 and 64 but it is highly recommended to use -// values equal or greater than: -// - 32 if BLAKE2b is used as a hash function (The key is zero bytes long). -// - 16 if BLAKE2b is used as a MAC function (The key is at least 16 bytes long). -// When the key is nil, the returned hash.Hash implements BinaryMarshaler -// and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash. -func New(size int, key []byte) (hash.Hash, error) { return newDigest(size, key) } - -func newDigest(hashSize int, key []byte) (*digest, error) { - if hashSize < 1 || hashSize > Size { - return nil, errHashSize - } - if len(key) > Size { - return nil, errKeySize - } - d := &digest{ - size: hashSize, - keyLen: len(key), - } - copy(d.key[:], key) - d.Reset() - return d, nil -} - -func checkSum(sum *[Size]byte, hashSize int, data []byte) { - h := iv - h[0] ^= uint64(hashSize) | (1 << 16) | (1 << 24) - var c [2]uint64 - - if length := len(data); length > BlockSize { - n := length &^ (BlockSize - 1) - if length == n { - n -= BlockSize - } - hashBlocks(&h, &c, 0, data[:n]) - data = data[n:] - } - - var block [BlockSize]byte - offset := copy(block[:], data) - remaining := uint64(BlockSize - offset) - if c[0] < remaining { - c[1]-- - } - c[0] -= remaining - - hashBlocks(&h, &c, 0xFFFFFFFFFFFFFFFF, block[:]) - - for i, v := range h[:(hashSize+7)/8] { - binary.LittleEndian.PutUint64(sum[8*i:], v) - } -} - -type digest struct { - h [8]uint64 - c [2]uint64 - size int - block [BlockSize]byte - offset int - - key [BlockSize]byte - keyLen int -} - -const ( - magic = "b2b" - marshaledSize = len(magic) + 8*8 + 2*8 + 1 + BlockSize + 1 -) - -func (d *digest) MarshalBinary() ([]byte, error) { - if d.keyLen != 0 { - return nil, errors.New("crypto/blake2b: cannot marshal MACs") - } - b := make([]byte, 0, marshaledSize) - b = append(b, magic...) - for i := 0; i < 8; i++ { - b = appendUint64(b, d.h[i]) - } - b = appendUint64(b, d.c[0]) - b = appendUint64(b, d.c[1]) - // Maximum value for size is 64 - b = append(b, byte(d.size)) - b = append(b, d.block[:]...) - b = append(b, byte(d.offset)) - return b, nil -} - -func (d *digest) UnmarshalBinary(b []byte) error { - if len(b) < len(magic) || string(b[:len(magic)]) != magic { - return errors.New("crypto/blake2b: invalid hash state identifier") - } - if len(b) != marshaledSize { - return errors.New("crypto/blake2b: invalid hash state size") - } - b = b[len(magic):] - for i := 0; i < 8; i++ { - b, d.h[i] = consumeUint64(b) - } - b, d.c[0] = consumeUint64(b) - b, d.c[1] = consumeUint64(b) - d.size = int(b[0]) - b = b[1:] - copy(d.block[:], b[:BlockSize]) - b = b[BlockSize:] - d.offset = int(b[0]) - return nil -} - -func (d *digest) BlockSize() int { return BlockSize } - -func (d *digest) Size() int { return d.size } - -func (d *digest) Reset() { - d.h = iv - d.h[0] ^= uint64(d.size) | (uint64(d.keyLen) << 8) | (1 << 16) | (1 << 24) - d.offset, d.c[0], d.c[1] = 0, 0, 0 - if d.keyLen > 0 { - d.block = d.key - d.offset = BlockSize - } -} - -func (d *digest) Write(p []byte) (n int, err error) { - n = len(p) - - if d.offset > 0 { - remaining := BlockSize - d.offset - if n <= remaining { - d.offset += copy(d.block[d.offset:], p) - return - } - copy(d.block[d.offset:], p[:remaining]) - hashBlocks(&d.h, &d.c, 0, d.block[:]) - d.offset = 0 - p = p[remaining:] - } - - if length := len(p); length > BlockSize { - nn := length &^ (BlockSize - 1) - if length == nn { - nn -= BlockSize - } - hashBlocks(&d.h, &d.c, 0, p[:nn]) - p = p[nn:] - } - - if len(p) > 0 { - d.offset += copy(d.block[:], p) - } - - return -} - -func (d *digest) Sum(sum []byte) []byte { - var hash [Size]byte - d.finalize(&hash) - return append(sum, hash[:d.size]...) -} - -func (d *digest) finalize(hash *[Size]byte) { - var block [BlockSize]byte - copy(block[:], d.block[:d.offset]) - remaining := uint64(BlockSize - d.offset) - - c := d.c - if c[0] < remaining { - c[1]-- - } - c[0] -= remaining - - h := d.h - hashBlocks(&h, &c, 0xFFFFFFFFFFFFFFFF, block[:]) - - for i, v := range h { - binary.LittleEndian.PutUint64(hash[8*i:], v) - } -} - -func appendUint64(b []byte, x uint64) []byte { - var a [8]byte - binary.BigEndian.PutUint64(a[:], x) - return append(b, a[:]...) -} - -func appendUint32(b []byte, x uint32) []byte { - var a [4]byte - binary.BigEndian.PutUint32(a[:], x) - return append(b, a[:]...) -} - -func consumeUint64(b []byte) ([]byte, uint64) { - x := binary.BigEndian.Uint64(b) - return b[8:], x -} - -func consumeUint32(b []byte) ([]byte, uint32) { - x := binary.BigEndian.Uint32(b) - return b[4:], x -} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go deleted file mode 100644 index 199c21d27aad..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build amd64 && gc && !purego - -package blake2b - -import "golang.org/x/sys/cpu" - -func init() { - useAVX2 = cpu.X86.HasAVX2 - useAVX = cpu.X86.HasAVX - useSSE4 = cpu.X86.HasSSE41 -} - -//go:noescape -func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) - -//go:noescape -func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) - -//go:noescape -func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) - -func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { - switch { - case useAVX2: - hashBlocksAVX2(h, c, flag, blocks) - case useAVX: - hashBlocksAVX(h, c, flag, blocks) - case useSSE4: - hashBlocksSSE4(h, c, flag, blocks) - default: - hashBlocksGeneric(h, c, flag, blocks) - } -} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s deleted file mode 100644 index f75162e039c1..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ /dev/null @@ -1,4559 +0,0 @@ -// Code generated by command: go run blake2bAVX2_amd64_asm.go -out ../../blake2bAVX2_amd64.s -pkg blake2b. DO NOT EDIT. - -//go:build amd64 && gc && !purego - -#include "textflag.h" - -// func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: AVX, AVX2 -TEXT ·hashBlocksAVX2(SB), NOSPLIT, $320-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, DX - ADDQ $+31, DX - ANDQ $-32, DX - MOVQ CX, 16(DX) - XORQ CX, CX - MOVQ CX, 24(DX) - VMOVDQU ·AVX2_c40<>+0(SB), Y4 - VMOVDQU ·AVX2_c48<>+0(SB), Y5 - VMOVDQU (AX), Y8 - VMOVDQU 32(AX), Y9 - VMOVDQU ·AVX2_iv0<>+0(SB), Y6 - VMOVDQU ·AVX2_iv1<>+0(SB), Y7 - MOVQ (BX), R8 - MOVQ 8(BX), R9 - MOVQ R9, 8(DX) - -loop: - ADDQ $0x80, R8 - MOVQ R8, (DX) - CMPQ R8, $0x80 - JGE noinc - INCQ R9 - MOVQ R9, 8(DX) - -noinc: - VMOVDQA Y8, Y0 - VMOVDQA Y9, Y1 - VMOVDQA Y6, Y2 - VPXOR (DX), Y7, Y3 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x26 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x28 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x38 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x70 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VMOVDQA Y12, 32(DX) - VMOVDQA Y13, 64(DX) - VMOVDQA Y14, 96(DX) - VMOVDQA Y15, 128(DX) - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x48 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - VPSHUFD $0x4e, (SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x28 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VMOVDQA Y12, 160(DX) - VMOVDQA Y13, 192(DX) - VMOVDQA Y14, 224(DX) - VMOVDQA Y15, 256(DX) - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x28 - VMOVDQU 88(SI), X12 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x2e - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x58 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x70 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x1e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x2e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x78 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x60 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x1e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x08 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x36 - VPSHUFD $0x4e, 64(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x30 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x58 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x18 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x48 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x10 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x3e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x1e - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x18 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x40 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x08 - VMOVDQU 96(SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x50 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x10 - VMOVDQU 32(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x38 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x08 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y12, Y12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x10 - VPSHUFD $0x4e, 40(SI), X11 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x20 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y13, Y13 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x18 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x5e - BYTE $0x68 - BYTE $0x01 - VINSERTI128 $0x01, X11, Y14, Y14 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x5e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0xa1 - BYTE $0x22 - BYTE $0x1e - BYTE $0x01 - VINSERTI128 $0x01, X11, Y15, Y15 - VPADDQ Y12, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y13, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ Y14, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ Y15, Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPADDQ 32(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 64(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ 96(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 128(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPADDQ 160(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 192(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x93 - VPADDQ 224(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFD $-79, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPSHUFB Y4, Y1, Y1 - VPADDQ 256(DX), Y0, Y0 - VPADDQ Y1, Y0, Y0 - VPXOR Y0, Y3, Y3 - VPSHUFB Y5, Y3, Y3 - VPADDQ Y3, Y2, Y2 - VPXOR Y2, Y1, Y1 - VPADDQ Y1, Y1, Y10 - VPSRLQ $0x3f, Y1, Y1 - VPXOR Y10, Y1, Y1 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xdb - BYTE $0x39 - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xd2 - BYTE $0x4e - BYTE $0xc4 - BYTE $0xe3 - BYTE $0xfd - BYTE $0x00 - BYTE $0xc9 - BYTE $0x93 - VPXOR Y0, Y8, Y8 - VPXOR Y1, Y9, Y9 - VPXOR Y2, Y8, Y8 - VPXOR Y3, Y9, Y9 - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - MOVQ R8, (BX) - MOVQ R9, 8(BX) - VMOVDQU Y8, (AX) - VMOVDQU Y9, 32(AX) - VZEROUPPER - RET - -DATA ·AVX2_c40<>+0(SB)/8, $0x0201000706050403 -DATA ·AVX2_c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -DATA ·AVX2_c40<>+16(SB)/8, $0x0201000706050403 -DATA ·AVX2_c40<>+24(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·AVX2_c40<>(SB), RODATA|NOPTR, $32 - -DATA ·AVX2_c48<>+0(SB)/8, $0x0100070605040302 -DATA ·AVX2_c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -DATA ·AVX2_c48<>+16(SB)/8, $0x0100070605040302 -DATA ·AVX2_c48<>+24(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·AVX2_c48<>(SB), RODATA|NOPTR, $32 - -DATA ·AVX2_iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·AVX2_iv0<>+8(SB)/8, $0xbb67ae8584caa73b -DATA ·AVX2_iv0<>+16(SB)/8, $0x3c6ef372fe94f82b -DATA ·AVX2_iv0<>+24(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·AVX2_iv0<>(SB), RODATA|NOPTR, $32 - -DATA ·AVX2_iv1<>+0(SB)/8, $0x510e527fade682d1 -DATA ·AVX2_iv1<>+8(SB)/8, $0x9b05688c2b3e6c1f -DATA ·AVX2_iv1<>+16(SB)/8, $0x1f83d9abfb41bd6b -DATA ·AVX2_iv1<>+24(SB)/8, $0x5be0cd19137e2179 -GLOBL ·AVX2_iv1<>(SB), RODATA|NOPTR, $32 - -// func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: AVX, SSE2 -TEXT ·hashBlocksAVX(SB), NOSPLIT, $288-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $0x0f, R10 - ANDQ $-16, R10 - VMOVDQU ·AVX_c40<>+0(SB), X0 - VMOVDQU ·AVX_c48<>+0(SB), X1 - VMOVDQA X0, X8 - VMOVDQA X1, X9 - VMOVDQU ·AVX_iv3<>+0(SB), X0 - VMOVDQA X0, (R10) - XORQ CX, (R10) - VMOVDQU (AX), X10 - VMOVDQU 16(AX), X11 - VMOVDQU 32(AX), X2 - VMOVDQU 48(AX), X3 - MOVQ (BX), R8 - MOVQ 8(BX), R9 - -loop: - ADDQ $0x80, R8 - CMPQ R8, $0x80 - JGE noinc - INCQ R9 - -noinc: - BYTE $0xc4 - BYTE $0x41 - BYTE $0xf9 - BYTE $0x6e - BYTE $0xf8 - BYTE $0xc4 - BYTE $0x43 - BYTE $0x81 - BYTE $0x22 - BYTE $0xf9 - BYTE $0x01 - VMOVDQA X10, X0 - VMOVDQA X11, X1 - VMOVDQU ·AVX_iv0<>+0(SB), X4 - VMOVDQU ·AVX_iv1<>+0(SB), X5 - VMOVDQU ·AVX_iv2<>+0(SB), X6 - VPXOR X15, X6, X6 - VMOVDQA (R10), X7 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x26 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x28 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x38 - BYTE $0x01 - VMOVDQA X12, 16(R10) - VMOVDQA X13, 32(R10) - VMOVDQA X14, 48(R10) - VMOVDQA X15, 64(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x78 - BYTE $0x01 - VMOVDQA X12, 80(R10) - VMOVDQA X13, 96(R10) - VMOVDQA X14, 112(R10) - VMOVDQA X15, 128(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x78 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x68 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x30 - BYTE $0x01 - VMOVDQA X12, 144(R10) - VMOVDQA X13, 160(R10) - VMOVDQA X14, 176(R10) - VMOVDQA X15, 192(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPSHUFD $0x4e, (SI), X12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x38 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 - VMOVDQA X12, 208(R10) - VMOVDQA X13, 224(R10) - VMOVDQA X14, 240(R10) - VMOVDQA X15, 256(R10) - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VMOVDQU 88(SI), X12 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x40 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x10 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x36 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x68 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x20 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x60 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x70 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x3e - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x40 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x48 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x36 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x20 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x78 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x30 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x08 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x40 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x58 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x60 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x68 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x2e - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x58 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x18 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x20 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x78 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x70 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x28 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x48 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x70 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x28 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x68 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ (SI), X12 - VPSHUFD $0x4e, 64(SI), X13 - MOVQ 56(SI), X14 - MOVQ 16(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x30 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x58 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x68 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x60 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x58 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x08 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x38 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x18 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x48 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ 40(SI), X12 - MOVQ 64(SI), X13 - MOVQ (SI), X14 - MOVQ 48(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x78 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x10 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x50 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - MOVQ 48(SI), X12 - MOVQ 88(SI), X13 - MOVQ 120(SI), X14 - MOVQ 24(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x2e - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x40 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VMOVDQU 96(SI), X12 - MOVQ 8(SI), X13 - MOVQ 16(SI), X14 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x50 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x38 - BYTE $0x01 - VMOVDQU 32(SI), X15 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x66 - BYTE $0x50 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x6e - BYTE $0x38 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x76 - BYTE $0x10 - BYTE $0xc5 - BYTE $0x7a - BYTE $0x7e - BYTE $0x7e - BYTE $0x30 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x40 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x08 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x20 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x7e - BYTE $0x28 - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - MOVQ 120(SI), X12 - MOVQ 24(SI), X13 - MOVQ 88(SI), X14 - MOVQ 96(SI), X15 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x99 - BYTE $0x22 - BYTE $0x66 - BYTE $0x48 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x91 - BYTE $0x22 - BYTE $0x6e - BYTE $0x68 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x89 - BYTE $0x22 - BYTE $0x76 - BYTE $0x70 - BYTE $0x01 - BYTE $0xc4 - BYTE $0x63 - BYTE $0x81 - BYTE $0x22 - BYTE $0x3e - BYTE $0x01 - VPADDQ X12, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X13, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ X14, X0, X0 - VPADDQ X2, X0, X0 - VPADDQ X15, X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VPADDQ 16(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 32(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 48(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 64(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPADDQ 80(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 96(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 112(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 128(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VPADDQ 144(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 160(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 176(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 192(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X6, X13 - VMOVDQA X2, X14 - VMOVDQA X4, X6 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x11 - BYTE $0x6c - BYTE $0xfd - VMOVDQA X5, X4 - VMOVDQA X6, X5 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xff - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x69 - BYTE $0x6d - BYTE $0xd7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xdf - VPADDQ 208(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 224(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFD $-79, X6, X6 - VPSHUFD $-79, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPSHUFB X8, X2, X2 - VPSHUFB X8, X3, X3 - VPADDQ 240(R10), X0, X0 - VPADDQ X2, X0, X0 - VPADDQ 256(R10), X1, X1 - VPADDQ X3, X1, X1 - VPXOR X0, X6, X6 - VPXOR X1, X7, X7 - VPSHUFB X9, X6, X6 - VPSHUFB X9, X7, X7 - VPADDQ X6, X4, X4 - VPADDQ X7, X5, X5 - VPXOR X4, X2, X2 - VPXOR X5, X3, X3 - VPADDQ X2, X2, X15 - VPSRLQ $0x3f, X2, X2 - VPXOR X15, X2, X2 - VPADDQ X3, X3, X15 - VPSRLQ $0x3f, X3, X3 - VPXOR X15, X3, X3 - VMOVDQA X2, X13 - VMOVDQA X4, X14 - BYTE $0xc5 - BYTE $0x69 - BYTE $0x6c - BYTE $0xfa - VMOVDQA X5, X4 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x61 - BYTE $0x6d - BYTE $0xd7 - VMOVDQA X14, X5 - BYTE $0xc5 - BYTE $0x61 - BYTE $0x6c - BYTE $0xfb - VMOVDQA X6, X14 - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x11 - BYTE $0x6d - BYTE $0xdf - BYTE $0xc5 - BYTE $0x41 - BYTE $0x6c - BYTE $0xff - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x49 - BYTE $0x6d - BYTE $0xf7 - BYTE $0xc4 - BYTE $0x41 - BYTE $0x09 - BYTE $0x6c - BYTE $0xfe - BYTE $0xc4 - BYTE $0xc1 - BYTE $0x41 - BYTE $0x6d - BYTE $0xff - VMOVDQU 32(AX), X14 - VMOVDQU 48(AX), X15 - VPXOR X0, X10, X10 - VPXOR X1, X11, X11 - VPXOR X2, X14, X14 - VPXOR X3, X15, X15 - VPXOR X4, X10, X10 - VPXOR X5, X11, X11 - VPXOR X6, X14, X2 - VPXOR X7, X15, X3 - VMOVDQU X2, 32(AX) - VMOVDQU X3, 48(AX) - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - VMOVDQU X10, (AX) - VMOVDQU X11, 16(AX) - MOVQ R8, (BX) - MOVQ R9, 8(BX) - VZEROUPPER - RET - -DATA ·AVX_c40<>+0(SB)/8, $0x0201000706050403 -DATA ·AVX_c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·AVX_c40<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_c48<>+0(SB)/8, $0x0100070605040302 -DATA ·AVX_c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·AVX_c48<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv3<>+0(SB)/8, $0x1f83d9abfb41bd6b -DATA ·AVX_iv3<>+8(SB)/8, $0x5be0cd19137e2179 -GLOBL ·AVX_iv3<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·AVX_iv0<>+8(SB)/8, $0xbb67ae8584caa73b -GLOBL ·AVX_iv0<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv1<>+0(SB)/8, $0x3c6ef372fe94f82b -DATA ·AVX_iv1<>+8(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·AVX_iv1<>(SB), RODATA|NOPTR, $16 - -DATA ·AVX_iv2<>+0(SB)/8, $0x510e527fade682d1 -DATA ·AVX_iv2<>+8(SB)/8, $0x9b05688c2b3e6c1f -GLOBL ·AVX_iv2<>(SB), RODATA|NOPTR, $16 diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s deleted file mode 100644 index 9a0ce2124462..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s +++ /dev/null @@ -1,1441 +0,0 @@ -// Code generated by command: go run blake2b_amd64_asm.go -out ../../blake2b_amd64.s -pkg blake2b. DO NOT EDIT. - -//go:build amd64 && gc && !purego - -#include "textflag.h" - -// func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) -// Requires: SSE2, SSE4.1, SSSE3 -TEXT ·hashBlocksSSE4(SB), NOSPLIT, $288-48 - MOVQ h+0(FP), AX - MOVQ c+8(FP), BX - MOVQ flag+16(FP), CX - MOVQ blocks_base+24(FP), SI - MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $0x0f, R10 - ANDQ $-16, R10 - MOVOU ·iv3<>+0(SB), X0 - MOVO X0, (R10) - XORQ CX, (R10) - MOVOU ·c40<>+0(SB), X13 - MOVOU ·c48<>+0(SB), X14 - MOVOU (AX), X12 - MOVOU 16(AX), X15 - MOVQ (BX), R8 - MOVQ 8(BX), R9 - -loop: - ADDQ $0x80, R8 - CMPQ R8, $0x80 - JGE noinc - INCQ R9 - -noinc: - MOVQ R8, X8 - PINSRQ $0x01, R9, X8 - MOVO X12, X0 - MOVO X15, X1 - MOVOU 32(AX), X2 - MOVOU 48(AX), X3 - MOVOU ·iv0<>+0(SB), X4 - MOVOU ·iv1<>+0(SB), X5 - MOVOU ·iv2<>+0(SB), X6 - PXOR X8, X6 - MOVO (R10), X7 - MOVQ (SI), X8 - PINSRQ $0x01, 16(SI), X8 - MOVQ 32(SI), X9 - PINSRQ $0x01, 48(SI), X9 - MOVQ 8(SI), X10 - PINSRQ $0x01, 24(SI), X10 - MOVQ 40(SI), X11 - PINSRQ $0x01, 56(SI), X11 - MOVO X8, 16(R10) - MOVO X9, 32(R10) - MOVO X10, 48(R10) - MOVO X11, 64(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 64(SI), X8 - PINSRQ $0x01, 80(SI), X8 - MOVQ 96(SI), X9 - PINSRQ $0x01, 112(SI), X9 - MOVQ 72(SI), X10 - PINSRQ $0x01, 88(SI), X10 - MOVQ 104(SI), X11 - PINSRQ $0x01, 120(SI), X11 - MOVO X8, 80(R10) - MOVO X9, 96(R10) - MOVO X10, 112(R10) - MOVO X11, 128(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 112(SI), X8 - PINSRQ $0x01, 32(SI), X8 - MOVQ 72(SI), X9 - PINSRQ $0x01, 104(SI), X9 - MOVQ 80(SI), X10 - PINSRQ $0x01, 64(SI), X10 - MOVQ 120(SI), X11 - PINSRQ $0x01, 48(SI), X11 - MOVO X8, 144(R10) - MOVO X9, 160(R10) - MOVO X10, 176(R10) - MOVO X11, 192(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 8(SI), X8 - PINSRQ $0x01, (SI), X8 - MOVQ 88(SI), X9 - PINSRQ $0x01, 40(SI), X9 - MOVQ 96(SI), X10 - PINSRQ $0x01, 16(SI), X10 - MOVQ 56(SI), X11 - PINSRQ $0x01, 24(SI), X11 - MOVO X8, 208(R10) - MOVO X9, 224(R10) - MOVO X10, 240(R10) - MOVO X11, 256(R10) - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 88(SI), X8 - PINSRQ $0x01, 96(SI), X8 - MOVQ 40(SI), X9 - PINSRQ $0x01, 120(SI), X9 - MOVQ 64(SI), X10 - PINSRQ $0x01, (SI), X10 - MOVQ 16(SI), X11 - PINSRQ $0x01, 104(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 80(SI), X8 - PINSRQ $0x01, 24(SI), X8 - MOVQ 56(SI), X9 - PINSRQ $0x01, 72(SI), X9 - MOVQ 112(SI), X10 - PINSRQ $0x01, 48(SI), X10 - MOVQ 8(SI), X11 - PINSRQ $0x01, 32(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 56(SI), X8 - PINSRQ $0x01, 24(SI), X8 - MOVQ 104(SI), X9 - PINSRQ $0x01, 88(SI), X9 - MOVQ 72(SI), X10 - PINSRQ $0x01, 8(SI), X10 - MOVQ 96(SI), X11 - PINSRQ $0x01, 112(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 16(SI), X8 - PINSRQ $0x01, 40(SI), X8 - MOVQ 32(SI), X9 - PINSRQ $0x01, 120(SI), X9 - MOVQ 48(SI), X10 - PINSRQ $0x01, 80(SI), X10 - MOVQ (SI), X11 - PINSRQ $0x01, 64(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 72(SI), X8 - PINSRQ $0x01, 40(SI), X8 - MOVQ 16(SI), X9 - PINSRQ $0x01, 80(SI), X9 - MOVQ (SI), X10 - PINSRQ $0x01, 56(SI), X10 - MOVQ 32(SI), X11 - PINSRQ $0x01, 120(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 112(SI), X8 - PINSRQ $0x01, 88(SI), X8 - MOVQ 48(SI), X9 - PINSRQ $0x01, 24(SI), X9 - MOVQ 8(SI), X10 - PINSRQ $0x01, 96(SI), X10 - MOVQ 64(SI), X11 - PINSRQ $0x01, 104(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 16(SI), X8 - PINSRQ $0x01, 48(SI), X8 - MOVQ (SI), X9 - PINSRQ $0x01, 64(SI), X9 - MOVQ 96(SI), X10 - PINSRQ $0x01, 80(SI), X10 - MOVQ 88(SI), X11 - PINSRQ $0x01, 24(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 32(SI), X8 - PINSRQ $0x01, 56(SI), X8 - MOVQ 120(SI), X9 - PINSRQ $0x01, 8(SI), X9 - MOVQ 104(SI), X10 - PINSRQ $0x01, 40(SI), X10 - MOVQ 112(SI), X11 - PINSRQ $0x01, 72(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 96(SI), X8 - PINSRQ $0x01, 8(SI), X8 - MOVQ 112(SI), X9 - PINSRQ $0x01, 32(SI), X9 - MOVQ 40(SI), X10 - PINSRQ $0x01, 120(SI), X10 - MOVQ 104(SI), X11 - PINSRQ $0x01, 80(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ (SI), X8 - PINSRQ $0x01, 48(SI), X8 - MOVQ 72(SI), X9 - PINSRQ $0x01, 64(SI), X9 - MOVQ 56(SI), X10 - PINSRQ $0x01, 24(SI), X10 - MOVQ 16(SI), X11 - PINSRQ $0x01, 88(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 104(SI), X8 - PINSRQ $0x01, 56(SI), X8 - MOVQ 96(SI), X9 - PINSRQ $0x01, 24(SI), X9 - MOVQ 88(SI), X10 - PINSRQ $0x01, 112(SI), X10 - MOVQ 8(SI), X11 - PINSRQ $0x01, 72(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 40(SI), X8 - PINSRQ $0x01, 120(SI), X8 - MOVQ 64(SI), X9 - PINSRQ $0x01, 16(SI), X9 - MOVQ (SI), X10 - PINSRQ $0x01, 32(SI), X10 - MOVQ 48(SI), X11 - PINSRQ $0x01, 80(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 48(SI), X8 - PINSRQ $0x01, 112(SI), X8 - MOVQ 88(SI), X9 - PINSRQ $0x01, (SI), X9 - MOVQ 120(SI), X10 - PINSRQ $0x01, 72(SI), X10 - MOVQ 24(SI), X11 - PINSRQ $0x01, 64(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 96(SI), X8 - PINSRQ $0x01, 104(SI), X8 - MOVQ 8(SI), X9 - PINSRQ $0x01, 80(SI), X9 - MOVQ 16(SI), X10 - PINSRQ $0x01, 56(SI), X10 - MOVQ 32(SI), X11 - PINSRQ $0x01, 40(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVQ 80(SI), X8 - PINSRQ $0x01, 64(SI), X8 - MOVQ 56(SI), X9 - PINSRQ $0x01, 8(SI), X9 - MOVQ 16(SI), X10 - PINSRQ $0x01, 32(SI), X10 - MOVQ 48(SI), X11 - PINSRQ $0x01, 40(SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - MOVQ 120(SI), X8 - PINSRQ $0x01, 72(SI), X8 - MOVQ 24(SI), X9 - PINSRQ $0x01, 104(SI), X9 - MOVQ 88(SI), X10 - PINSRQ $0x01, 112(SI), X10 - MOVQ 96(SI), X11 - PINSRQ $0x01, (SI), X11 - PADDQ X8, X0 - PADDQ X9, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ X10, X0 - PADDQ X11, X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - PADDQ 16(R10), X0 - PADDQ 32(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 48(R10), X0 - PADDQ 64(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - PADDQ 80(R10), X0 - PADDQ 96(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 112(R10), X0 - PADDQ 128(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - PADDQ 144(R10), X0 - PADDQ 160(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 176(R10), X0 - PADDQ 192(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X6, X8 - PUNPCKLQDQ X6, X9 - PUNPCKHQDQ X7, X6 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X7, X9 - MOVO X8, X7 - MOVO X2, X8 - PUNPCKHQDQ X9, X7 - PUNPCKLQDQ X3, X9 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X3 - PADDQ 208(R10), X0 - PADDQ 224(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFD $0xb1, X6, X6 - PSHUFD $0xb1, X7, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - PSHUFB X13, X2 - PSHUFB X13, X3 - PADDQ 240(R10), X0 - PADDQ 256(R10), X1 - PADDQ X2, X0 - PADDQ X3, X1 - PXOR X0, X6 - PXOR X1, X7 - PSHUFB X14, X6 - PSHUFB X14, X7 - PADDQ X6, X4 - PADDQ X7, X5 - PXOR X4, X2 - PXOR X5, X3 - MOVOU X2, X11 - PADDQ X2, X11 - PSRLQ $0x3f, X2 - PXOR X11, X2 - MOVOU X3, X11 - PADDQ X3, X11 - PSRLQ $0x3f, X3 - PXOR X11, X3 - MOVO X4, X8 - MOVO X5, X4 - MOVO X8, X5 - MOVO X2, X8 - PUNPCKLQDQ X2, X9 - PUNPCKHQDQ X3, X2 - PUNPCKHQDQ X9, X2 - PUNPCKLQDQ X3, X9 - MOVO X8, X3 - MOVO X6, X8 - PUNPCKHQDQ X9, X3 - PUNPCKLQDQ X7, X9 - PUNPCKHQDQ X9, X6 - PUNPCKLQDQ X8, X9 - PUNPCKHQDQ X9, X7 - MOVOU 32(AX), X10 - MOVOU 48(AX), X11 - PXOR X0, X12 - PXOR X1, X15 - PXOR X2, X10 - PXOR X3, X11 - PXOR X4, X12 - PXOR X5, X15 - PXOR X6, X10 - PXOR X7, X11 - MOVOU X10, 32(AX) - MOVOU X11, 48(AX) - LEAQ 128(SI), SI - SUBQ $0x80, DI - JNE loop - MOVOU X12, (AX) - MOVOU X15, 16(AX) - MOVQ R8, (BX) - MOVQ R9, 8(BX) - RET - -DATA ·iv3<>+0(SB)/8, $0x1f83d9abfb41bd6b -DATA ·iv3<>+8(SB)/8, $0x5be0cd19137e2179 -GLOBL ·iv3<>(SB), RODATA|NOPTR, $16 - -DATA ·c40<>+0(SB)/8, $0x0201000706050403 -DATA ·c40<>+8(SB)/8, $0x0a09080f0e0d0c0b -GLOBL ·c40<>(SB), RODATA|NOPTR, $16 - -DATA ·c48<>+0(SB)/8, $0x0100070605040302 -DATA ·c48<>+8(SB)/8, $0x09080f0e0d0c0b0a -GLOBL ·c48<>(SB), RODATA|NOPTR, $16 - -DATA ·iv0<>+0(SB)/8, $0x6a09e667f3bcc908 -DATA ·iv0<>+8(SB)/8, $0xbb67ae8584caa73b -GLOBL ·iv0<>(SB), RODATA|NOPTR, $16 - -DATA ·iv1<>+0(SB)/8, $0x3c6ef372fe94f82b -DATA ·iv1<>+8(SB)/8, $0xa54ff53a5f1d36f1 -GLOBL ·iv1<>(SB), RODATA|NOPTR, $16 - -DATA ·iv2<>+0(SB)/8, $0x510e527fade682d1 -DATA ·iv2<>+8(SB)/8, $0x9b05688c2b3e6c1f -GLOBL ·iv2<>(SB), RODATA|NOPTR, $16 diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go b/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go deleted file mode 100644 index 3168a8aa3c83..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_generic.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blake2b - -import ( - "encoding/binary" - "math/bits" -) - -// the precomputed values for BLAKE2b -// there are 12 16-byte arrays - one for each round -// the entries are calculated from the sigma constants. -var precomputed = [12][16]byte{ - {0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15}, - {14, 4, 9, 13, 10, 8, 15, 6, 1, 0, 11, 5, 12, 2, 7, 3}, - {11, 12, 5, 15, 8, 0, 2, 13, 10, 3, 7, 9, 14, 6, 1, 4}, - {7, 3, 13, 11, 9, 1, 12, 14, 2, 5, 4, 15, 6, 10, 0, 8}, - {9, 5, 2, 10, 0, 7, 4, 15, 14, 11, 6, 3, 1, 12, 8, 13}, - {2, 6, 0, 8, 12, 10, 11, 3, 4, 7, 15, 1, 13, 5, 14, 9}, - {12, 1, 14, 4, 5, 15, 13, 10, 0, 6, 9, 8, 7, 3, 2, 11}, - {13, 7, 12, 3, 11, 14, 1, 9, 5, 15, 8, 2, 0, 4, 6, 10}, - {6, 14, 11, 0, 15, 9, 3, 8, 12, 13, 1, 10, 2, 7, 4, 5}, - {10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0}, - {0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15}, // equal to the first - {14, 4, 9, 13, 10, 8, 15, 6, 1, 0, 11, 5, 12, 2, 7, 3}, // equal to the second -} - -func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { - var m [16]uint64 - c0, c1 := c[0], c[1] - - for i := 0; i < len(blocks); { - c0 += BlockSize - if c0 < BlockSize { - c1++ - } - - v0, v1, v2, v3, v4, v5, v6, v7 := h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7] - v8, v9, v10, v11, v12, v13, v14, v15 := iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7] - v12 ^= c0 - v13 ^= c1 - v14 ^= flag - - for j := range m { - m[j] = binary.LittleEndian.Uint64(blocks[i:]) - i += 8 - } - - for j := range precomputed { - s := &(precomputed[j]) - - v0 += m[s[0]] - v0 += v4 - v12 ^= v0 - v12 = bits.RotateLeft64(v12, -32) - v8 += v12 - v4 ^= v8 - v4 = bits.RotateLeft64(v4, -24) - v1 += m[s[1]] - v1 += v5 - v13 ^= v1 - v13 = bits.RotateLeft64(v13, -32) - v9 += v13 - v5 ^= v9 - v5 = bits.RotateLeft64(v5, -24) - v2 += m[s[2]] - v2 += v6 - v14 ^= v2 - v14 = bits.RotateLeft64(v14, -32) - v10 += v14 - v6 ^= v10 - v6 = bits.RotateLeft64(v6, -24) - v3 += m[s[3]] - v3 += v7 - v15 ^= v3 - v15 = bits.RotateLeft64(v15, -32) - v11 += v15 - v7 ^= v11 - v7 = bits.RotateLeft64(v7, -24) - - v0 += m[s[4]] - v0 += v4 - v12 ^= v0 - v12 = bits.RotateLeft64(v12, -16) - v8 += v12 - v4 ^= v8 - v4 = bits.RotateLeft64(v4, -63) - v1 += m[s[5]] - v1 += v5 - v13 ^= v1 - v13 = bits.RotateLeft64(v13, -16) - v9 += v13 - v5 ^= v9 - v5 = bits.RotateLeft64(v5, -63) - v2 += m[s[6]] - v2 += v6 - v14 ^= v2 - v14 = bits.RotateLeft64(v14, -16) - v10 += v14 - v6 ^= v10 - v6 = bits.RotateLeft64(v6, -63) - v3 += m[s[7]] - v3 += v7 - v15 ^= v3 - v15 = bits.RotateLeft64(v15, -16) - v11 += v15 - v7 ^= v11 - v7 = bits.RotateLeft64(v7, -63) - - v0 += m[s[8]] - v0 += v5 - v15 ^= v0 - v15 = bits.RotateLeft64(v15, -32) - v10 += v15 - v5 ^= v10 - v5 = bits.RotateLeft64(v5, -24) - v1 += m[s[9]] - v1 += v6 - v12 ^= v1 - v12 = bits.RotateLeft64(v12, -32) - v11 += v12 - v6 ^= v11 - v6 = bits.RotateLeft64(v6, -24) - v2 += m[s[10]] - v2 += v7 - v13 ^= v2 - v13 = bits.RotateLeft64(v13, -32) - v8 += v13 - v7 ^= v8 - v7 = bits.RotateLeft64(v7, -24) - v3 += m[s[11]] - v3 += v4 - v14 ^= v3 - v14 = bits.RotateLeft64(v14, -32) - v9 += v14 - v4 ^= v9 - v4 = bits.RotateLeft64(v4, -24) - - v0 += m[s[12]] - v0 += v5 - v15 ^= v0 - v15 = bits.RotateLeft64(v15, -16) - v10 += v15 - v5 ^= v10 - v5 = bits.RotateLeft64(v5, -63) - v1 += m[s[13]] - v1 += v6 - v12 ^= v1 - v12 = bits.RotateLeft64(v12, -16) - v11 += v12 - v6 ^= v11 - v6 = bits.RotateLeft64(v6, -63) - v2 += m[s[14]] - v2 += v7 - v13 ^= v2 - v13 = bits.RotateLeft64(v13, -16) - v8 += v13 - v7 ^= v8 - v7 = bits.RotateLeft64(v7, -63) - v3 += m[s[15]] - v3 += v4 - v14 ^= v3 - v14 = bits.RotateLeft64(v14, -16) - v9 += v14 - v4 ^= v9 - v4 = bits.RotateLeft64(v4, -63) - - } - - h[0] ^= v0 ^ v8 - h[1] ^= v1 ^ v9 - h[2] ^= v2 ^ v10 - h[3] ^= v3 ^ v11 - h[4] ^= v4 ^ v12 - h[5] ^= v5 ^ v13 - h[6] ^= v6 ^ v14 - h[7] ^= v7 ^ v15 - } - c[0], c[1] = c0, c1 -} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go deleted file mode 100644 index 6e28668cd198..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !amd64 || purego || !gc - -package blake2b - -func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { - hashBlocksGeneric(h, c, flag, blocks) -} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2x.go b/vendor/golang.org/x/crypto/blake2b/blake2x.go deleted file mode 100644 index 7692bb346014..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2x.go +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blake2b - -import ( - "encoding/binary" - "errors" - "io" -) - -// XOF defines the interface to hash functions that -// support arbitrary-length output. -// -// New callers should prefer the standard library [hash.XOF]. -type XOF interface { - // Write absorbs more data into the hash's state. It panics if called - // after Read. - io.Writer - - // Read reads more output from the hash. It returns io.EOF if the limit - // has been reached. - io.Reader - - // Clone returns a copy of the XOF in its current state. - Clone() XOF - - // Reset resets the XOF to its initial state. - Reset() -} - -// OutputLengthUnknown can be used as the size argument to NewXOF to indicate -// the length of the output is not known in advance. -const OutputLengthUnknown = 0 - -// magicUnknownOutputLength is a magic value for the output size that indicates -// an unknown number of output bytes. -const magicUnknownOutputLength = (1 << 32) - 1 - -// maxOutputLength is the absolute maximum number of bytes to produce when the -// number of output bytes is unknown. -const maxOutputLength = (1 << 32) * 64 - -// NewXOF creates a new variable-output-length hash. The hash either produce a -// known number of bytes (1 <= size < 2**32-1), or an unknown number of bytes -// (size == OutputLengthUnknown). In the latter case, an absolute limit of -// 256GiB applies. -// -// A non-nil key turns the hash into a MAC. The key must between -// zero and 32 bytes long. -// -// The result can be safely interface-upgraded to [hash.XOF]. -func NewXOF(size uint32, key []byte) (XOF, error) { - if len(key) > Size { - return nil, errKeySize - } - if size == magicUnknownOutputLength { - // 2^32-1 indicates an unknown number of bytes and thus isn't a - // valid length. - return nil, errors.New("blake2b: XOF length too large") - } - if size == OutputLengthUnknown { - size = magicUnknownOutputLength - } - x := &xof{ - d: digest{ - size: Size, - keyLen: len(key), - }, - length: size, - } - copy(x.d.key[:], key) - x.Reset() - return x, nil -} - -type xof struct { - d digest - length uint32 - remaining uint64 - cfg, root, block [Size]byte - offset int - nodeOffset uint32 - readMode bool -} - -func (x *xof) Write(p []byte) (n int, err error) { - if x.readMode { - panic("blake2b: write to XOF after read") - } - return x.d.Write(p) -} - -func (x *xof) Clone() XOF { - clone := *x - return &clone -} - -func (x *xof) BlockSize() int { - return x.d.BlockSize() -} - -func (x *xof) Reset() { - x.cfg[0] = byte(Size) - binary.LittleEndian.PutUint32(x.cfg[4:], uint32(Size)) // leaf length - binary.LittleEndian.PutUint32(x.cfg[12:], x.length) // XOF length - x.cfg[17] = byte(Size) // inner hash size - - x.d.Reset() - x.d.h[1] ^= uint64(x.length) << 32 - - x.remaining = uint64(x.length) - if x.remaining == magicUnknownOutputLength { - x.remaining = maxOutputLength - } - x.offset, x.nodeOffset = 0, 0 - x.readMode = false -} - -func (x *xof) Read(p []byte) (n int, err error) { - if !x.readMode { - x.d.finalize(&x.root) - x.readMode = true - } - - if x.remaining == 0 { - return 0, io.EOF - } - - n = len(p) - if uint64(n) > x.remaining { - n = int(x.remaining) - p = p[:n] - } - - if x.offset > 0 { - blockRemaining := Size - x.offset - if n < blockRemaining { - x.offset += copy(p, x.block[x.offset:]) - x.remaining -= uint64(n) - return - } - copy(p, x.block[x.offset:]) - p = p[blockRemaining:] - x.offset = 0 - x.remaining -= uint64(blockRemaining) - } - - for len(p) >= Size { - binary.LittleEndian.PutUint32(x.cfg[8:], x.nodeOffset) - x.nodeOffset++ - - x.d.initConfig(&x.cfg) - x.d.Write(x.root[:]) - x.d.finalize(&x.block) - - copy(p, x.block[:]) - p = p[Size:] - x.remaining -= uint64(Size) - } - - if todo := len(p); todo > 0 { - if x.remaining < uint64(Size) { - x.cfg[0] = byte(x.remaining) - } - binary.LittleEndian.PutUint32(x.cfg[8:], x.nodeOffset) - x.nodeOffset++ - - x.d.initConfig(&x.cfg) - x.d.Write(x.root[:]) - x.d.finalize(&x.block) - - x.offset = copy(p, x.block[:todo]) - x.remaining -= uint64(todo) - } - return -} - -func (d *digest) initConfig(cfg *[Size]byte) { - d.offset, d.c[0], d.c[1] = 0, 0, 0 - for i := range d.h { - d.h[i] = iv[i] ^ binary.LittleEndian.Uint64(cfg[i*8:]) - } -} diff --git a/vendor/golang.org/x/crypto/blake2b/go125.go b/vendor/golang.org/x/crypto/blake2b/go125.go deleted file mode 100644 index 67e990b7e169..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/go125.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.25 - -package blake2b - -import "hash" - -var _ hash.XOF = (*xof)(nil) diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go deleted file mode 100644 index 54e446e1d2ce..000000000000 --- a/vendor/golang.org/x/crypto/blake2b/register.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blake2b - -import ( - "crypto" - "hash" -) - -func init() { - newHash256 := func() hash.Hash { - h, _ := New256(nil) - return h - } - newHash384 := func() hash.Hash { - h, _ := New384(nil) - return h - } - - newHash512 := func() hash.Hash { - h, _ := New512(nil) - return h - } - - crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) - crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) - crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) -} diff --git a/vendor/k8s.io/utils/strings/slices/slices.go b/vendor/k8s.io/utils/strings/slices/slices.go deleted file mode 100644 index 35657a7fcdcd..000000000000 --- a/vendor/k8s.io/utils/strings/slices/slices.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package slices defines various functions useful with slices of string type. -// The goal is to be as close as possible to -// https://github.com/golang/go/issues/45955. Ideal would be if we can just -// replace "stringslices" if the "slices" package becomes standard. -package slices - -import goslices "slices" - -// Equal reports whether two slices are equal: the same length and all -// elements equal. If the lengths are different, Equal returns false. -// Otherwise, the elements are compared in index order, and the -// comparison stops at the first unequal pair. -// -// Deprecated: use stdlib slices.Equal instead. -var Equal = goslices.Equal[[]string] - -// Filter appends to d each element e of s for which keep(e) returns true. -// It returns the modified d. d may be s[:0], in which case the kept -// elements will be stored in the same slice. -// if the slices overlap in some other way, the results are unspecified. -// To create a new slice with the filtered results, pass nil for d. -// -// Deprecated: use stdlib slices.DeleteFunc instead. -func Filter(d, s []string, keep func(string) bool) []string { - for _, n := range s { - if keep(n) { - d = append(d, n) - } - } - return d -} - -// Contains reports whether v is present in s. -// -// Deprecated: use stdlib slices.Contains instead. -var Contains = goslices.Contains[[]string] - -// Index returns the index of the first occurrence of v in s, or -1 if -// not present. -// -// Deprecated: use stdlib slices.Index instead. -var Index = goslices.Index[[]string] - -// Clone returns a new clone of s. -// -// Deprecated: use stdlib slices.Clone instead. -var Clone = goslices.Clone[[]string] diff --git a/vendor/modules.txt b/vendor/modules.txt index 5c8b8c880d96..685ad448470e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -70,9 +70,6 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/uuid # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 v2.2.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2 -# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 -## explicit; go 1.18 -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns @@ -304,9 +301,6 @@ github.com/armon/go-socks5 # github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 ## explicit; go 1.13 github.com/asaskevich/govalidator -# github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 -## explicit; go 1.13 -github.com/asaskevich/govalidator/v11 # github.com/aws/aws-sdk-go-v2 v1.41.5 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/aws @@ -379,11 +373,6 @@ github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4 github.com/aws/aws-sdk-go-v2/service/ec2 github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ec2/types -# github.com/aws/aws-sdk-go-v2/service/eks v1.77.0 -## explicit; go 1.23 -github.com/aws/aws-sdk-go-v2/service/eks -github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints -github.com/aws/aws-sdk-go-v2/service/eks/types # github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.29.6 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing @@ -856,9 +845,6 @@ github.com/googleapis/gax-go/v2/callctx github.com/googleapis/gax-go/v2/internal github.com/googleapis/gax-go/v2/internallog github.com/googleapis/gax-go/v2/internallog/internal -# github.com/gophercloud/gophercloud/v2 v2.10.0 -## explicit; go 1.22 -github.com/gophercloud/gophercloud/v2 # github.com/gorilla/mux v1.8.1 ## explicit; go 1.20 github.com/gorilla/mux @@ -914,6 +900,8 @@ github.com/leodido/go-urn/scim/schema # github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de ## explicit github.com/liggitt/tabwriter +# github.com/mattn/go-colorable v0.1.14 +## explicit; go 1.18 # github.com/mitchellh/go-wordwrap v1.0.1 ## explicit; go 1.14 github.com/mitchellh/go-wordwrap @@ -1000,9 +988,6 @@ github.com/opencontainers/image-spec/specs-go/v1 ## explicit; go 1.19 github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/pkg/pwalkdir -# github.com/openshift-online/ocm-common v0.0.31 -## explicit; go 1.21 -github.com/openshift-online/ocm-common/pkg/resource/validations # github.com/openshift/api v0.0.0-20260416105050-3c6b218b8a80 ## explicit; go 1.25.0 github.com/openshift/api @@ -1109,9 +1094,8 @@ github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1 github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning/ibmcloud github.com/openshift/cloud-credential-operator/pkg/ibmcloud -# github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1 -## explicit; go 1.25 -github.com/openshift/cluster-api-provider-agent/api/v1alpha1 +# github.com/openshift/cluster-api-provider-agent/api v0.0.0-20260120122324-898e638ec7d1 => ./pkg/capi/agent +## explicit; go 1.25.7 github.com/openshift/cluster-api-provider-agent/api/v1beta1 # github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20241204142113-43631b045675 ## explicit; go 1.22.0 @@ -1445,7 +1429,6 @@ go.yaml.in/yaml/v3 # golang.org/x/crypto v0.51.0 ## explicit; go 1.25.0 golang.org/x/crypto/bcrypt -golang.org/x/crypto/blake2b golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -2427,6 +2410,8 @@ k8s.io/client-go/util/workqueue # k8s.io/cloud-provider v0.35.0 ## explicit; go 1.25.0 k8s.io/cloud-provider/api +# k8s.io/cluster-bootstrap v0.34.3 +## explicit; go 1.24.0 # k8s.io/component-base v0.35.1 ## explicit; go 1.25.0 k8s.io/component-base/cli @@ -2550,7 +2535,6 @@ k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/set -k8s.io/utils/strings/slices k8s.io/utils/trace # kubevirt.io/api v1.8.2 ## explicit; go 1.24.0 @@ -2579,9 +2563,7 @@ sigs.k8s.io/cluster-api/api/core/v1beta1 sigs.k8s.io/cluster-api/api/core/v1beta2 sigs.k8s.io/cluster-api/api/ipam/v1beta1 sigs.k8s.io/cluster-api/api/ipam/v1beta2 -sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3 sigs.k8s.io/cluster-api/errors -sigs.k8s.io/cluster-api/feature sigs.k8s.io/cluster-api/util sigs.k8s.io/cluster-api/util/annotations sigs.k8s.io/cluster-api/util/conditions @@ -2589,38 +2571,23 @@ sigs.k8s.io/cluster-api/util/conditions/deprecated/v1beta1 sigs.k8s.io/cluster-api/util/conversion sigs.k8s.io/cluster-api/util/labels/format sigs.k8s.io/cluster-api/util/patch -sigs.k8s.io/cluster-api/util/topology -# sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0 -## explicit; go 1.24.0 -sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1 +# sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.0 => ./pkg/capi/aws +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2 -sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2 -sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1 -sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2 -sigs.k8s.io/cluster-api-provider-aws/v2/feature -sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1 -sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks -sigs.k8s.io/cluster-api-provider-aws/v2/pkg/hash -# sigs.k8s.io/cluster-api-provider-azure v1.22.0 -## explicit; go 1.24.6 +# sigs.k8s.io/cluster-api-provider-azure v1.22.0 => ./pkg/capi/azure +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-azure/api/v1beta1 -sigs.k8s.io/cluster-api-provider-azure/feature -sigs.k8s.io/cluster-api-provider-azure/util/azure -sigs.k8s.io/cluster-api-provider-azure/util/ssh -sigs.k8s.io/cluster-api-provider-azure/util/versions -sigs.k8s.io/cluster-api-provider-azure/util/webhook -# sigs.k8s.io/cluster-api-provider-gcp v1.11.0 -## explicit; go 1.24.0 +# sigs.k8s.io/cluster-api-provider-gcp v1.11.0 => ./pkg/capi/gcp +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1 -# sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 -## explicit; go 1.24.0 -sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1 +# sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 => ./pkg/capi/ibmcloud +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2 -# sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1 -## explicit; go 1.24.0 +# sigs.k8s.io/cluster-api-provider-kubevirt v0.11.1 => ./pkg/capi/kubevirt +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1 -# sigs.k8s.io/cluster-api-provider-openstack v0.13.3 -## explicit; go 1.24.0 +# sigs.k8s.io/cluster-api-provider-openstack v0.13.3 => ./pkg/capi/openstack +## explicit; go 1.25.7 sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1 sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors @@ -2801,6 +2768,13 @@ sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/kyaml # github.com/openshift/hypershift/api => ./api +# github.com/openshift/cluster-api-provider-agent/api => ./pkg/capi/agent +# sigs.k8s.io/cluster-api-provider-aws/v2 => ./pkg/capi/aws +# sigs.k8s.io/cluster-api-provider-azure => ./pkg/capi/azure +# sigs.k8s.io/cluster-api-provider-gcp => ./pkg/capi/gcp +# sigs.k8s.io/cluster-api-provider-ibmcloud => ./pkg/capi/ibmcloud +# sigs.k8s.io/cluster-api-provider-kubevirt => ./pkg/capi/kubevirt +# sigs.k8s.io/cluster-api-provider-openstack => ./pkg/capi/openstack # github.com/k-orc/openstack-resource-controller => sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20250113192833-e4f56a2b4f32 # github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.5.2 # github.com/aws/karpenter-provider-aws => github.com/openshift/aws-karpenter-provider-aws v0.0.0-20260311064431-f0be9c72e5bf diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/LICENSE deleted file mode 100644 index 261eeb9e9f8b..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awscluster_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awscluster_conversion.go deleted file mode 100644 index 805d60856edc..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awscluster_conversion.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -// ConvertTo converts the v1beta1 AWSCluster receiver to a v1beta2 AWSCluster. -func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSCluster) - - if err := Convert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(src, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &infrav1.AWSCluster{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.ControlPlaneLoadBalancer != nil { - if dst.Spec.ControlPlaneLoadBalancer == nil { - dst.Spec.ControlPlaneLoadBalancer = &infrav1.AWSLoadBalancerSpec{} - } - restoreControlPlaneLoadBalancer(restored.Spec.ControlPlaneLoadBalancer, dst.Spec.ControlPlaneLoadBalancer) - } - restoreControlPlaneLoadBalancerStatus(&restored.Status.Network.APIServerELB, &dst.Status.Network.APIServerELB) - - if restored.Spec.SecondaryControlPlaneLoadBalancer != nil { - if dst.Spec.SecondaryControlPlaneLoadBalancer == nil { - dst.Spec.SecondaryControlPlaneLoadBalancer = &infrav1.AWSLoadBalancerSpec{} - } - restoreControlPlaneLoadBalancer(restored.Spec.SecondaryControlPlaneLoadBalancer, dst.Spec.SecondaryControlPlaneLoadBalancer) - } - restoreControlPlaneLoadBalancerStatus(&restored.Status.Network.SecondaryAPIServerELB, &dst.Status.Network.SecondaryAPIServerELB) - - dst.Spec.S3Bucket = restored.Spec.S3Bucket - if restored.Status.Bastion != nil { - dst.Status.Bastion.InstanceMetadataOptions = restored.Status.Bastion.InstanceMetadataOptions - dst.Status.Bastion.PlacementGroupName = restored.Status.Bastion.PlacementGroupName - dst.Status.Bastion.PlacementGroupPartition = restored.Status.Bastion.PlacementGroupPartition - dst.Status.Bastion.PrivateDNSName = restored.Status.Bastion.PrivateDNSName - dst.Status.Bastion.PublicIPOnLaunch = restored.Status.Bastion.PublicIPOnLaunch - dst.Status.Bastion.NetworkInterfaceType = restored.Status.Bastion.NetworkInterfaceType - dst.Status.Bastion.CapacityReservationID = restored.Status.Bastion.CapacityReservationID - dst.Status.Bastion.MarketType = restored.Status.Bastion.MarketType - dst.Status.Bastion.HostAffinity = restored.Status.Bastion.HostAffinity - dst.Status.Bastion.HostID = restored.Status.Bastion.HostID - dst.Status.Bastion.CapacityReservationPreference = restored.Status.Bastion.CapacityReservationPreference - dst.Status.Bastion.CPUOptions = restored.Status.Bastion.CPUOptions - if restored.Status.Bastion.DynamicHostAllocation != nil { - dst.Status.Bastion.DynamicHostAllocation = restored.Status.Bastion.DynamicHostAllocation - } - } - dst.Spec.Partition = restored.Spec.Partition - - for role, sg := range restored.Status.Network.SecurityGroups { - dst.Status.Network.SecurityGroups[role] = sg - } - dst.Status.Network.NatGatewaysIPs = restored.Status.Network.NatGatewaysIPs - - if restored.Spec.NetworkSpec.VPC.IPAMPool != nil { - if dst.Spec.NetworkSpec.VPC.IPAMPool == nil { - dst.Spec.NetworkSpec.VPC.IPAMPool = &infrav1.IPAMPool{} - } - - restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPAMPool, dst.Spec.NetworkSpec.VPC.IPAMPool) - } - - if restored.Spec.NetworkSpec.VPC.IsIPv6Enabled() && restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool != nil { - if dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool == nil { - dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool = &infrav1.IPAMPool{} - } - - restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool, dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool) - } - - dst.Spec.NetworkSpec.AdditionalControlPlaneIngressRules = restored.Spec.NetworkSpec.AdditionalControlPlaneIngressRules - dst.Spec.NetworkSpec.AdditionalNodeIngressRules = restored.Spec.NetworkSpec.AdditionalNodeIngressRules - dst.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks = restored.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks - - if restored.Spec.NetworkSpec.VPC.IPAMPool != nil { - if dst.Spec.NetworkSpec.VPC.IPAMPool == nil { - dst.Spec.NetworkSpec.VPC.IPAMPool = &infrav1.IPAMPool{} - } - - restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPAMPool, dst.Spec.NetworkSpec.VPC.IPAMPool) - } - - if restored.Spec.NetworkSpec.VPC.IsIPv6Enabled() && restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool != nil { - if dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool == nil { - dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool = &infrav1.IPAMPool{} - } - - restoreIPAMPool(restored.Spec.NetworkSpec.VPC.IPv6.IPAMPool, dst.Spec.NetworkSpec.VPC.IPv6.IPAMPool) - } - - dst.Spec.NetworkSpec.VPC.EmptyRoutesDefaultVPCSecurityGroup = restored.Spec.NetworkSpec.VPC.EmptyRoutesDefaultVPCSecurityGroup - dst.Spec.NetworkSpec.VPC.PrivateDNSHostnameTypeOnLaunch = restored.Spec.NetworkSpec.VPC.PrivateDNSHostnameTypeOnLaunch - dst.Spec.NetworkSpec.VPC.CarrierGatewayID = restored.Spec.NetworkSpec.VPC.CarrierGatewayID - dst.Spec.NetworkSpec.VPC.SubnetSchema = restored.Spec.NetworkSpec.VPC.SubnetSchema - dst.Spec.NetworkSpec.VPC.SecondaryCidrBlocks = restored.Spec.NetworkSpec.VPC.SecondaryCidrBlocks - - if restored.Spec.NetworkSpec.VPC.ElasticIPPool != nil { - if dst.Spec.NetworkSpec.VPC.ElasticIPPool == nil { - dst.Spec.NetworkSpec.VPC.ElasticIPPool = &infrav1.ElasticIPPool{} - } - if restored.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4Pool != nil { - dst.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4Pool = restored.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4Pool - } - if restored.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4PoolFallBackOrder != nil { - dst.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4PoolFallBackOrder = restored.Spec.NetworkSpec.VPC.ElasticIPPool.PublicIpv4PoolFallBackOrder - } - } - - // Restore SubnetSpec.ResourceID, SubnetSpec.ParentZoneName, and SubnetSpec.ZoneType fields, if any. - for _, subnet := range restored.Spec.NetworkSpec.Subnets { - for i, dstSubnet := range dst.Spec.NetworkSpec.Subnets { - if dstSubnet.ID == subnet.ID { - if len(subnet.ResourceID) > 0 { - dstSubnet.ResourceID = subnet.ResourceID - } - if subnet.ParentZoneName != nil { - dstSubnet.ParentZoneName = subnet.ParentZoneName - } - if subnet.ZoneType != nil { - dstSubnet.ZoneType = subnet.ZoneType - } - dstSubnet.DeepCopyInto(&dst.Spec.NetworkSpec.Subnets[i]) - } - } - } - - return nil -} - -// restoreControlPlaneLoadBalancerStatus manually restores the control plane loadbalancer status data. -// Assumes restored and dst are non-nil. -func restoreControlPlaneLoadBalancerStatus(restored, dst *infrav1.LoadBalancer) { - dst.ARN = restored.ARN - dst.LoadBalancerType = restored.LoadBalancerType - dst.ELBAttributes = restored.ELBAttributes - dst.ELBListeners = restored.ELBListeners - dst.Name = restored.Name - dst.DNSName = restored.DNSName - dst.Scheme = restored.Scheme - dst.SubnetIDs = restored.SubnetIDs - dst.SecurityGroupIDs = restored.SecurityGroupIDs - dst.HealthCheck = restored.HealthCheck - dst.ClassicElbAttributes = restored.ClassicElbAttributes - dst.Tags = restored.Tags - dst.ClassicELBListeners = restored.ClassicELBListeners - dst.AvailabilityZones = restored.AvailabilityZones -} - -// restoreIPAMPool manually restores the ipam pool data. -// Assumes restored and dst are non-nil. -func restoreIPAMPool(restored, dst *infrav1.IPAMPool) { - dst.ID = restored.ID - dst.Name = restored.Name - dst.NetmaskLength = restored.NetmaskLength -} - -// restoreControlPlaneLoadBalancer manually restores the control plane loadbalancer data. -// Assumes restored and dst are non-nil. -func restoreControlPlaneLoadBalancer(restored, dst *infrav1.AWSLoadBalancerSpec) { - dst.Name = restored.Name - dst.HealthCheckProtocol = restored.HealthCheckProtocol - dst.HealthCheck = restored.HealthCheck - dst.LoadBalancerType = restored.LoadBalancerType - dst.DisableHostsRewrite = restored.DisableHostsRewrite - dst.PreserveClientIP = restored.PreserveClientIP - dst.IngressRules = restored.IngressRules - dst.AdditionalListeners = restored.AdditionalListeners - dst.AdditionalSecurityGroups = restored.AdditionalSecurityGroups - dst.Scheme = restored.Scheme - dst.CrossZoneLoadBalancing = restored.CrossZoneLoadBalancing - dst.Subnets = restored.Subnets -} - -// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1beta1 AWSCluster. -func (r *AWSCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSCluster) - - if err := Convert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - - return nil -} - -// ConvertTo converts the v1beta1 AWSClusterList receiver to a v1beta2 AWSClusterList. -func (src *AWSClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterList) - - return Convert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterList receiver to a v1beta1 AWSClusterList. -func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterList) - - return Convert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(src, r, nil) -} - -func Convert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(in *infrav1.SubnetSpec, out *SubnetSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsclustertemplate_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsclustertemplate_conversion.go deleted file mode 100644 index eeb4a4318efc..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsclustertemplate_conversion.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -// ConvertTo converts the v1beta1 AWSClusterTemplate receiver to a v1beta2 AWSClusterTemplate. -func (r *AWSClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterTemplate) - - if err := Convert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.AWSClusterTemplate{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - - return nil -} - -// ConvertFrom converts the v1beta2 AWSClusterTemplate receiver to a v1beta1 AWSClusterTemplate. -func (r *AWSClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterTemplate) - - if err := Convert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - - return nil -} - -// ConvertTo converts the v1beta1 AWSClusterTemplateList receiver to a v1beta2 AWSClusterTemplateList. -func (r *AWSClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterTemplateList) - - if err := Convert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList(r, dst, nil); err != nil { - return err - } - - return nil -} - -// ConvertFrom converts the v1beta2 AWSClusterTemplateList receiver to a v1beta1 AWSClusterTemplateList. -func (r *AWSClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterTemplateList) - - if err := Convert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(src, r, nil); err != nil { - return err - } - - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsidentity_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsidentity_conversion.go deleted file mode 100644 index 47e4ea1e594f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsidentity_conversion.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" -) - -// ConvertTo converts the v1beta1 AWSClusterControllerIdentity receiver to a v1beta2 AWSClusterControllerIdentity. -func (src *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterControllerIdentity) - return Convert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterControllerIdentity to a v1beta1 AWSClusterControllerIdentity. -func (dst *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterControllerIdentity) - - return Convert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSClusterControllerIdentityList receiver to a v1beta2 AWSClusterControllerIdentityList. -func (src *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterControllerIdentityList) - return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterControllerIdentityList to a v1beta1 AWSClusterControllerIdentityList. -func (dst *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterControllerIdentityList) - - return Convert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSClusterRoleIdentity receiver to a v1beta2 AWSClusterRoleIdentity. -func (src *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterRoleIdentity) - return Convert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterRoleIdentity to a v1beta1 AWSClusterRoleIdentity. -func (dst *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterRoleIdentity) - - return Convert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSClusterRoleIdentityList receiver to a v1beta2 AWSClusterRoleIdentityList. -func (src *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterRoleIdentityList) - return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterRoleIdentityList to a v1beta1 AWSClusterRoleIdentityList. -func (dst *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterRoleIdentityList) - - return Convert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSClusterStaticIdentity receiver to a v1beta2 AWSClusterStaticIdentity. -func (src *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterStaticIdentity) - return Convert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterStaticIdentity to a v1beta1 AWSClusterStaticIdentity. -func (dst *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterStaticIdentity) - - return Convert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSClusterStaticIdentityList receiver to a v1beta2 AWSClusterStaticIdentityList. -func (src *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSClusterStaticIdentityList) - return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSClusterStaticIdentityList to a v1beta1 AWSClusterStaticIdentityList. -func (dst *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSClusterStaticIdentityList) - - return Convert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(src, dst, nil) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachine_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachine_conversion.go deleted file mode 100644 index 6e87547918cb..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/awsmachine_conversion.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -// ConvertTo converts the v1beta1 AWSMachine receiver to a v1beta2 AWSMachine. -func (src *AWSMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSMachine) - if err := Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.AWSMachine{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Ignition = restored.Spec.Ignition - dst.Spec.InstanceMetadataOptions = restored.Spec.InstanceMetadataOptions - dst.Spec.PlacementGroupName = restored.Spec.PlacementGroupName - dst.Spec.PlacementGroupPartition = restored.Spec.PlacementGroupPartition - dst.Spec.PrivateDNSName = restored.Spec.PrivateDNSName - dst.Spec.SecurityGroupOverrides = restored.Spec.SecurityGroupOverrides - dst.Spec.CapacityReservationID = restored.Spec.CapacityReservationID - dst.Spec.MarketType = restored.Spec.MarketType - dst.Spec.HostID = restored.Spec.HostID - dst.Spec.HostAffinity = restored.Spec.HostAffinity - dst.Spec.CapacityReservationPreference = restored.Spec.CapacityReservationPreference - dst.Spec.NetworkInterfaceType = restored.Spec.NetworkInterfaceType - dst.Spec.CPUOptions = restored.Spec.CPUOptions - if restored.Spec.DynamicHostAllocation != nil { - dst.Spec.DynamicHostAllocation = restored.Spec.DynamicHostAllocation - } - if restored.Spec.ElasticIPPool != nil { - if dst.Spec.ElasticIPPool == nil { - dst.Spec.ElasticIPPool = &infrav1.ElasticIPPool{} - } - if restored.Spec.ElasticIPPool.PublicIpv4Pool != nil { - dst.Spec.ElasticIPPool.PublicIpv4Pool = restored.Spec.ElasticIPPool.PublicIpv4Pool - } - if restored.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder != nil { - dst.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder = restored.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder - } - } - - dst.Status.DedicatedHost = restored.Status.DedicatedHost - return nil -} - -// ConvertFrom converts the v1beta2 AWSMachine to a v1beta1 AWSMachine. -func (dst *AWSMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSMachine) - - if err := Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata. - return utilconversion.MarshalData(src, dst) -} - -// ConvertTo converts the v1beta1 AWSMachineList receiver to a v1beta2 AWSMachineList. -func (src *AWSMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSMachineList) - return Convert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSMachineList to a v1beta1 AWSMachineList. -func (dst *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSMachineList) - - return Convert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(src, dst, nil) -} - -// ConvertTo converts the v1beta1 AWSMachineTemplate receiver to a v1beta2 AWSMachineTemplate. -func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSMachineTemplate) - - if err := Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.AWSMachineTemplate{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - dst.Spec.Template.Spec.Ignition = restored.Spec.Template.Spec.Ignition - dst.Spec.Template.Spec.InstanceMetadataOptions = restored.Spec.Template.Spec.InstanceMetadataOptions - dst.Spec.Template.Spec.PlacementGroupName = restored.Spec.Template.Spec.PlacementGroupName - dst.Spec.Template.Spec.PlacementGroupPartition = restored.Spec.Template.Spec.PlacementGroupPartition - dst.Spec.Template.Spec.PrivateDNSName = restored.Spec.Template.Spec.PrivateDNSName - dst.Spec.Template.Spec.SecurityGroupOverrides = restored.Spec.Template.Spec.SecurityGroupOverrides - dst.Spec.Template.Spec.CapacityReservationID = restored.Spec.Template.Spec.CapacityReservationID - dst.Spec.Template.Spec.MarketType = restored.Spec.Template.Spec.MarketType - dst.Spec.Template.Spec.HostID = restored.Spec.Template.Spec.HostID - dst.Spec.Template.Spec.HostAffinity = restored.Spec.Template.Spec.HostAffinity - dst.Spec.Template.Spec.CapacityReservationPreference = restored.Spec.Template.Spec.CapacityReservationPreference - dst.Spec.Template.Spec.NetworkInterfaceType = restored.Spec.Template.Spec.NetworkInterfaceType - dst.Spec.Template.Spec.CPUOptions = restored.Spec.Template.Spec.CPUOptions - if restored.Spec.Template.Spec.DynamicHostAllocation != nil { - dst.Spec.Template.Spec.DynamicHostAllocation = restored.Spec.Template.Spec.DynamicHostAllocation - } - if restored.Spec.Template.Spec.ElasticIPPool != nil { - if dst.Spec.Template.Spec.ElasticIPPool == nil { - dst.Spec.Template.Spec.ElasticIPPool = &infrav1.ElasticIPPool{} - } - if restored.Spec.Template.Spec.ElasticIPPool.PublicIpv4Pool != nil { - dst.Spec.Template.Spec.ElasticIPPool.PublicIpv4Pool = restored.Spec.Template.Spec.ElasticIPPool.PublicIpv4Pool - } - if restored.Spec.Template.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder != nil { - dst.Spec.Template.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder = restored.Spec.Template.Spec.ElasticIPPool.PublicIpv4PoolFallBackOrder - } - } - - // Restore Status fields that don't exist in v1beta1. - dst.Status.NodeInfo = restored.Status.NodeInfo - dst.Status.Conditions = restored.Status.Conditions - - return nil -} - -// ConvertFrom converts the v1beta2 AWSCluster receiver to a v1beta1 AWSCluster. -func (r *AWSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSMachineTemplate) - - if err := Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - - return nil -} - -// ConvertTo converts the v1beta1 AWSMachineTemplateList receiver to a v1beta2 AWSMachineTemplateList. -func (src *AWSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.AWSMachineTemplateList) - return Convert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSMachineTemplateList to a v1beta1 AWSMachineTemplateList. -func (dst *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.AWSMachineTemplateList) - - return Convert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(src, dst, nil) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/conversion.go deleted file mode 100644 index a2a895bfd18e..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/conversion.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "unsafe" - - "k8s.io/apimachinery/pkg/conversion" - - "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" -) - -func Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *v1beta2.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in, out, s) -} - -func Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in *AWSResourceReference, out *v1beta2.AWSResourceReference, s conversion.Scope) error { - return autoConvert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in, out, s) -} - -func Convert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(in *AWSMachineSpec, out *v1beta2.AWSMachineSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(in, out, s) -} - -func Convert_v1beta2_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *v1beta2.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in, out, s) -} - -func Convert_v1beta2_NetworkStatus_To_v1beta1_NetworkStatus(in *v1beta2.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { - return autoConvert_v1beta2_NetworkStatus_To_v1beta1_NetworkStatus(in, out, s) -} - -func Convert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *v1beta2.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in, out, s) -} - -func Convert_v1beta2_Instance_To_v1beta1_Instance(in *v1beta2.Instance, out *Instance, s conversion.Scope) error { - return autoConvert_v1beta2_Instance_To_v1beta1_Instance(in, out, s) -} - -func Convert_v1beta1_ClassicELB_To_v1beta2_LoadBalancer(in *ClassicELB, out *v1beta2.LoadBalancer, s conversion.Scope) error { - out.Name = in.Name - out.DNSName = in.DNSName - out.Scheme = v1beta2.ELBScheme(in.Scheme) - out.HealthCheck = (*v1beta2.ClassicELBHealthCheck)(in.HealthCheck) - out.AvailabilityZones = in.AvailabilityZones - out.ClassicElbAttributes = (v1beta2.ClassicELBAttributes)(in.Attributes) - out.ClassicELBListeners = *(*[]v1beta2.ClassicELBListener)(unsafe.Pointer(&in.Listeners)) - out.SecurityGroupIDs = in.SecurityGroupIDs - out.Tags = in.Tags - out.SubnetIDs = in.SubnetIDs - return nil -} - -func Convert_v1beta2_LoadBalancer_To_v1beta1_ClassicELB(in *v1beta2.LoadBalancer, out *ClassicELB, s conversion.Scope) error { - out.Name = in.Name - out.DNSName = in.DNSName - out.Scheme = ClassicELBScheme(in.Scheme) - out.HealthCheck = (*ClassicELBHealthCheck)(in.HealthCheck) - out.AvailabilityZones = in.AvailabilityZones - out.Attributes = (ClassicELBAttributes)(in.ClassicElbAttributes) - out.Listeners = *(*[]ClassicELBListener)(unsafe.Pointer(&in.ClassicELBListeners)) - out.SecurityGroupIDs = in.SecurityGroupIDs - out.Tags = in.Tags - out.SubnetIDs = in.SubnetIDs - return nil -} - -func Convert_v1beta2_IngressRule_To_v1beta1_IngressRule(in *v1beta2.IngressRule, out *IngressRule, s conversion.Scope) error { - return autoConvert_v1beta2_IngressRule_To_v1beta1_IngressRule(in, out, s) -} - -func Convert_v1beta2_VPCSpec_To_v1beta1_VPCSpec(in *v1beta2.VPCSpec, out *VPCSpec, s conversion.Scope) error { - return autoConvert_v1beta2_VPCSpec_To_v1beta1_VPCSpec(in, out, s) -} - -func Convert_v1beta2_IPv6_To_v1beta1_IPv6(in *v1beta2.IPv6, out *IPv6, s conversion.Scope) error { - return autoConvert_v1beta2_IPv6_To_v1beta1_IPv6(in, out, s) -} - -func Convert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(in *v1beta2.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { - return autoConvert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s) -} - -func Convert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(in *v1beta2.S3Bucket, out *S3Bucket, s conversion.Scope) error { - return autoConvert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(in, out, s) -} - -func Convert_v1beta2_Ignition_To_v1beta1_Ignition(in *v1beta2.Ignition, out *Ignition, s conversion.Scope) error { - return autoConvert_v1beta2_Ignition_To_v1beta1_Ignition(in, out, s) -} - -func Convert_v1beta2_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *v1beta2.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { - // Note: DedicatedHostID is not present in v1beta1, so it will be dropped during conversion - return autoConvert_v1beta2_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in, out, s) -} - -func Convert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatus(in *v1beta2.AWSMachineTemplateStatus, out *AWSMachineTemplateStatus, s conversion.Scope) error { - // NodeInfo and Conditions fields are ignored (dropped) as they don't exist in v1beta1 - return autoConvert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatus(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/s3bucket.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/s3bucket.go deleted file mode 100644 index 111cdc98f185..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/s3bucket.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - "net" - - "k8s.io/apimachinery/pkg/util/validation/field" - - "sigs.k8s.io/cluster-api-provider-aws/v2/feature" -) - -// Validate validates S3Bucket fields. -func (b *S3Bucket) Validate() []*field.Error { - var errs field.ErrorList - - if b == nil { - return errs - } - - if b.Name == "" { - errs = append(errs, field.Required(field.NewPath("spec", "s3Bucket", "name"), "can't be empty")) - } - - // Feature gate is not enabled but ignition is enabled then send a forbidden error. - if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) { - errs = append(errs, field.Forbidden(field.NewPath("spec", "s3Bucket"), - "can be set only if the BootstrapFormatIgnition feature gate is enabled")) - } - - if b.ControlPlaneIAMInstanceProfile == "" { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", "controlPlaneIAMInstanceProfiles"), "can't be empty")) - } - - if len(b.NodesIAMInstanceProfiles) == 0 { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", "nodesIAMInstanceProfiles"), "can't be empty")) - } - - for i, iamInstanceProfile := range b.NodesIAMInstanceProfiles { - if iamInstanceProfile == "" { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", fmt.Sprintf("nodesIAMInstanceProfiles[%d]", i)), "can't be empty")) - } - } - - if b.Name != "" { - errs = append(errs, validateS3BucketName(b.Name)...) - } - - return errs -} - -// Validation rules taken from https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html. -func validateS3BucketName(name string) []*field.Error { - var errs field.ErrorList - - path := field.NewPath("spec", "s3Bucket", "name") - - if net.ParseIP(name) != nil { - errs = append(errs, field.Invalid(path, name, "must not be formatted as an IP address (for example, 192.168.5.4)")) - } - - return errs -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.conversion.go deleted file mode 100644 index 44f2227f384d..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,2364 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - time "time" - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - v1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AMIReference)(nil), (*v1beta2.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AMIReference_To_v1beta2_AMIReference(a.(*AMIReference), b.(*v1beta2.AMIReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AMIReference)(nil), (*AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AMIReference_To_v1beta1_AMIReference(a.(*v1beta2.AMIReference), b.(*AMIReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSCluster)(nil), (*v1beta2.AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(a.(*AWSCluster), b.(*v1beta2.AWSCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSCluster)(nil), (*AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(a.(*v1beta2.AWSCluster), b.(*AWSCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentity)(nil), (*v1beta2.AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity(a.(*AWSClusterControllerIdentity), b.(*v1beta2.AWSClusterControllerIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterControllerIdentity)(nil), (*AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(a.(*v1beta2.AWSClusterControllerIdentity), b.(*AWSClusterControllerIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentityList)(nil), (*v1beta2.AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList(a.(*AWSClusterControllerIdentityList), b.(*v1beta2.AWSClusterControllerIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterControllerIdentityList)(nil), (*AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(a.(*v1beta2.AWSClusterControllerIdentityList), b.(*AWSClusterControllerIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentitySpec)(nil), (*v1beta2.AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec(a.(*AWSClusterControllerIdentitySpec), b.(*v1beta2.AWSClusterControllerIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterControllerIdentitySpec)(nil), (*AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(a.(*v1beta2.AWSClusterControllerIdentitySpec), b.(*AWSClusterControllerIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterIdentitySpec)(nil), (*v1beta2.AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(a.(*AWSClusterIdentitySpec), b.(*v1beta2.AWSClusterIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterIdentitySpec)(nil), (*AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(a.(*v1beta2.AWSClusterIdentitySpec), b.(*AWSClusterIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterList)(nil), (*v1beta2.AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList(a.(*AWSClusterList), b.(*v1beta2.AWSClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterList)(nil), (*AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(a.(*v1beta2.AWSClusterList), b.(*AWSClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentity)(nil), (*v1beta2.AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity(a.(*AWSClusterRoleIdentity), b.(*v1beta2.AWSClusterRoleIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterRoleIdentity)(nil), (*AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(a.(*v1beta2.AWSClusterRoleIdentity), b.(*AWSClusterRoleIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentityList)(nil), (*v1beta2.AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList(a.(*AWSClusterRoleIdentityList), b.(*v1beta2.AWSClusterRoleIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterRoleIdentityList)(nil), (*AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(a.(*v1beta2.AWSClusterRoleIdentityList), b.(*AWSClusterRoleIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentitySpec)(nil), (*v1beta2.AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec(a.(*AWSClusterRoleIdentitySpec), b.(*v1beta2.AWSClusterRoleIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterRoleIdentitySpec)(nil), (*AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(a.(*v1beta2.AWSClusterRoleIdentitySpec), b.(*AWSClusterRoleIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterSpec)(nil), (*v1beta2.AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(a.(*AWSClusterSpec), b.(*v1beta2.AWSClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentity)(nil), (*v1beta2.AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity(a.(*AWSClusterStaticIdentity), b.(*v1beta2.AWSClusterStaticIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterStaticIdentity)(nil), (*AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(a.(*v1beta2.AWSClusterStaticIdentity), b.(*AWSClusterStaticIdentity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentityList)(nil), (*v1beta2.AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList(a.(*AWSClusterStaticIdentityList), b.(*v1beta2.AWSClusterStaticIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterStaticIdentityList)(nil), (*AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(a.(*v1beta2.AWSClusterStaticIdentityList), b.(*AWSClusterStaticIdentityList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentitySpec)(nil), (*v1beta2.AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec(a.(*AWSClusterStaticIdentitySpec), b.(*v1beta2.AWSClusterStaticIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterStaticIdentitySpec)(nil), (*AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(a.(*v1beta2.AWSClusterStaticIdentitySpec), b.(*AWSClusterStaticIdentitySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterStatus)(nil), (*v1beta2.AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus(a.(*AWSClusterStatus), b.(*v1beta2.AWSClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterStatus)(nil), (*AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus(a.(*v1beta2.AWSClusterStatus), b.(*AWSClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterTemplate)(nil), (*v1beta2.AWSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(a.(*AWSClusterTemplate), b.(*v1beta2.AWSClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterTemplate)(nil), (*AWSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(a.(*v1beta2.AWSClusterTemplate), b.(*AWSClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateList)(nil), (*v1beta2.AWSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList(a.(*AWSClusterTemplateList), b.(*v1beta2.AWSClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterTemplateList)(nil), (*AWSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(a.(*v1beta2.AWSClusterTemplateList), b.(*AWSClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateResource)(nil), (*v1beta2.AWSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource(a.(*AWSClusterTemplateResource), b.(*v1beta2.AWSClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterTemplateResource)(nil), (*AWSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(a.(*v1beta2.AWSClusterTemplateResource), b.(*AWSClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateSpec)(nil), (*v1beta2.AWSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec(a.(*AWSClusterTemplateSpec), b.(*v1beta2.AWSClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSClusterTemplateSpec)(nil), (*AWSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(a.(*v1beta2.AWSClusterTemplateSpec), b.(*AWSClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSIdentityReference)(nil), (*v1beta2.AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSIdentityReference_To_v1beta2_AWSIdentityReference(a.(*AWSIdentityReference), b.(*v1beta2.AWSIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSIdentityReference)(nil), (*AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSIdentityReference_To_v1beta1_AWSIdentityReference(a.(*v1beta2.AWSIdentityReference), b.(*AWSIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSLoadBalancerSpec)(nil), (*v1beta2.AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec(a.(*AWSLoadBalancerSpec), b.(*v1beta2.AWSLoadBalancerSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachine)(nil), (*v1beta2.AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(a.(*AWSMachine), b.(*v1beta2.AWSMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachine)(nil), (*AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(a.(*v1beta2.AWSMachine), b.(*AWSMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineList)(nil), (*v1beta2.AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(a.(*AWSMachineList), b.(*v1beta2.AWSMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachineList)(nil), (*AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(a.(*v1beta2.AWSMachineList), b.(*AWSMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineStatus)(nil), (*v1beta2.AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus(a.(*AWSMachineStatus), b.(*v1beta2.AWSMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplate)(nil), (*v1beta2.AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(a.(*AWSMachineTemplate), b.(*v1beta2.AWSMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachineTemplate)(nil), (*AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(a.(*v1beta2.AWSMachineTemplate), b.(*AWSMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateList)(nil), (*v1beta2.AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(a.(*AWSMachineTemplateList), b.(*v1beta2.AWSMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachineTemplateList)(nil), (*AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(a.(*v1beta2.AWSMachineTemplateList), b.(*AWSMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateResource)(nil), (*v1beta2.AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource(a.(*AWSMachineTemplateResource), b.(*v1beta2.AWSMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachineTemplateResource)(nil), (*AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(a.(*v1beta2.AWSMachineTemplateResource), b.(*AWSMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateSpec)(nil), (*v1beta2.AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec(a.(*AWSMachineTemplateSpec), b.(*v1beta2.AWSMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachineTemplateSpec)(nil), (*AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(a.(*v1beta2.AWSMachineTemplateSpec), b.(*AWSMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateStatus)(nil), (*v1beta2.AWSMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus(a.(*AWSMachineTemplateStatus), b.(*v1beta2.AWSMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(a.(*v1beta2.AWSResourceReference), b.(*AWSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSRoleSpec)(nil), (*v1beta2.AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec(a.(*AWSRoleSpec), b.(*v1beta2.AWSRoleSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSRoleSpec)(nil), (*AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec(a.(*v1beta2.AWSRoleSpec), b.(*AWSRoleSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AllowedNamespaces)(nil), (*v1beta2.AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AllowedNamespaces_To_v1beta2_AllowedNamespaces(a.(*AllowedNamespaces), b.(*v1beta2.AllowedNamespaces), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AllowedNamespaces)(nil), (*AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AllowedNamespaces_To_v1beta1_AllowedNamespaces(a.(*v1beta2.AllowedNamespaces), b.(*AllowedNamespaces), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1beta2.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Bastion_To_v1beta2_Bastion(a.(*Bastion), b.(*v1beta2.Bastion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Bastion_To_v1beta1_Bastion(a.(*v1beta2.Bastion), b.(*Bastion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1beta2.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BuildParams_To_v1beta2_BuildParams(a.(*BuildParams), b.(*v1beta2.BuildParams), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_BuildParams_To_v1beta1_BuildParams(a.(*v1beta2.BuildParams), b.(*BuildParams), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CNIIngressRule)(nil), (*v1beta2.CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CNIIngressRule_To_v1beta2_CNIIngressRule(a.(*CNIIngressRule), b.(*v1beta2.CNIIngressRule), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.CNIIngressRule)(nil), (*CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_CNIIngressRule_To_v1beta1_CNIIngressRule(a.(*v1beta2.CNIIngressRule), b.(*CNIIngressRule), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CNISpec)(nil), (*v1beta2.CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CNISpec_To_v1beta2_CNISpec(a.(*CNISpec), b.(*v1beta2.CNISpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.CNISpec)(nil), (*CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_CNISpec_To_v1beta1_CNISpec(a.(*v1beta2.CNISpec), b.(*CNISpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClassicELBAttributes)(nil), (*v1beta2.ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClassicELBAttributes_To_v1beta2_ClassicELBAttributes(a.(*ClassicELBAttributes), b.(*v1beta2.ClassicELBAttributes), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.ClassicELBAttributes)(nil), (*ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(a.(*v1beta2.ClassicELBAttributes), b.(*ClassicELBAttributes), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClassicELBHealthCheck)(nil), (*v1beta2.ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClassicELBHealthCheck_To_v1beta2_ClassicELBHealthCheck(a.(*ClassicELBHealthCheck), b.(*v1beta2.ClassicELBHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.ClassicELBHealthCheck)(nil), (*ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(a.(*v1beta2.ClassicELBHealthCheck), b.(*ClassicELBHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClassicELBListener)(nil), (*v1beta2.ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClassicELBListener_To_v1beta2_ClassicELBListener(a.(*ClassicELBListener), b.(*v1beta2.ClassicELBListener), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.ClassicELBListener)(nil), (*ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_ClassicELBListener_To_v1beta1_ClassicELBListener(a.(*v1beta2.ClassicELBListener), b.(*ClassicELBListener), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CloudInit)(nil), (*v1beta2.CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CloudInit_To_v1beta2_CloudInit(a.(*CloudInit), b.(*v1beta2.CloudInit), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.CloudInit)(nil), (*CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_CloudInit_To_v1beta1_CloudInit(a.(*v1beta2.CloudInit), b.(*CloudInit), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta2.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Filter_To_v1beta2_Filter(a.(*Filter), b.(*v1beta2.Filter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Filter_To_v1beta1_Filter(a.(*v1beta2.Filter), b.(*Filter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPv6)(nil), (*v1beta2.IPv6)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPv6_To_v1beta2_IPv6(a.(*IPv6), b.(*v1beta2.IPv6), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Ignition)(nil), (*v1beta2.Ignition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Ignition_To_v1beta2_Ignition(a.(*Ignition), b.(*v1beta2.Ignition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IngressRule)(nil), (*v1beta2.IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IngressRule_To_v1beta2_IngressRule(a.(*IngressRule), b.(*v1beta2.IngressRule), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1beta2.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Instance_To_v1beta2_Instance(a.(*Instance), b.(*v1beta2.Instance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1beta2.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec(a.(*NetworkSpec), b.(*v1beta2.NetworkSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1beta2.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus(a.(*NetworkStatus), b.(*v1beta2.NetworkStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RouteTable)(nil), (*v1beta2.RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RouteTable_To_v1beta2_RouteTable(a.(*RouteTable), b.(*v1beta2.RouteTable), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.RouteTable)(nil), (*RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_RouteTable_To_v1beta1_RouteTable(a.(*v1beta2.RouteTable), b.(*RouteTable), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*S3Bucket)(nil), (*v1beta2.S3Bucket)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_S3Bucket_To_v1beta2_S3Bucket(a.(*S3Bucket), b.(*v1beta2.S3Bucket), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1beta2.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup(a.(*SecurityGroup), b.(*v1beta2.SecurityGroup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup(a.(*v1beta2.SecurityGroup), b.(*SecurityGroup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SpotMarketOptions)(nil), (*v1beta2.SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SpotMarketOptions_To_v1beta2_SpotMarketOptions(a.(*SpotMarketOptions), b.(*v1beta2.SpotMarketOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.SpotMarketOptions)(nil), (*SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_SpotMarketOptions_To_v1beta1_SpotMarketOptions(a.(*v1beta2.SpotMarketOptions), b.(*SpotMarketOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1beta2.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec(a.(*SubnetSpec), b.(*v1beta2.SubnetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VPCSpec)(nil), (*v1beta2.VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VPCSpec_To_v1beta2_VPCSpec(a.(*VPCSpec), b.(*v1beta2.VPCSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Volume)(nil), (*v1beta2.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Volume_To_v1beta2_Volume(a.(*Volume), b.(*v1beta2.Volume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Volume_To_v1beta1_Volume(a.(*v1beta2.Volume), b.(*Volume), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*AWSMachineSpec)(nil), (*v1beta2.AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(a.(*AWSMachineSpec), b.(*v1beta2.AWSMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*AWSResourceReference)(nil), (*v1beta2.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(a.(*AWSResourceReference), b.(*v1beta2.AWSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*ClassicELB)(nil), (*v1beta2.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClassicELB_To_v1beta2_LoadBalancer(a.(*ClassicELB), b.(*v1beta2.LoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(a.(*v1beta2.AWSClusterSpec), b.(*AWSClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSLoadBalancerSpec)(nil), (*AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(a.(*v1beta2.AWSLoadBalancerSpec), b.(*AWSLoadBalancerSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSMachineSpec)(nil), (*AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(a.(*v1beta2.AWSMachineSpec), b.(*AWSMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSMachineStatus)(nil), (*AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineStatus_To_v1beta1_AWSMachineStatus(a.(*v1beta2.AWSMachineStatus), b.(*AWSMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSMachineTemplateStatus)(nil), (*AWSMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatus(a.(*v1beta2.AWSMachineTemplateStatus), b.(*AWSMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IPv6)(nil), (*IPv6)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IPv6_To_v1beta1_IPv6(a.(*v1beta2.IPv6), b.(*IPv6), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.Ignition)(nil), (*Ignition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Ignition_To_v1beta1_Ignition(a.(*v1beta2.Ignition), b.(*Ignition), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IngressRule)(nil), (*IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IngressRule_To_v1beta1_IngressRule(a.(*v1beta2.IngressRule), b.(*IngressRule), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Instance_To_v1beta1_Instance(a.(*v1beta2.Instance), b.(*Instance), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.LoadBalancer)(nil), (*ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_LoadBalancer_To_v1beta1_ClassicELB(a.(*v1beta2.LoadBalancer), b.(*ClassicELB), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(a.(*v1beta2.NetworkSpec), b.(*NetworkSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_NetworkStatus_To_v1beta1_NetworkStatus(a.(*v1beta2.NetworkStatus), b.(*NetworkStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.S3Bucket)(nil), (*S3Bucket)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(a.(*v1beta2.S3Bucket), b.(*S3Bucket), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(a.(*v1beta2.SubnetSpec), b.(*SubnetSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.VPCSpec)(nil), (*VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPCSpec_To_v1beta1_VPCSpec(a.(*v1beta2.VPCSpec), b.(*VPCSpec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_AMIReference_To_v1beta2_AMIReference(in *AMIReference, out *v1beta2.AMIReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.EKSOptimizedLookupType = (*v1beta2.EKSAMILookupType)(unsafe.Pointer(in.EKSOptimizedLookupType)) - return nil -} - -// Convert_v1beta1_AMIReference_To_v1beta2_AMIReference is an autogenerated conversion function. -func Convert_v1beta1_AMIReference_To_v1beta2_AMIReference(in *AMIReference, out *v1beta2.AMIReference, s conversion.Scope) error { - return autoConvert_v1beta1_AMIReference_To_v1beta2_AMIReference(in, out, s) -} - -func autoConvert_v1beta2_AMIReference_To_v1beta1_AMIReference(in *v1beta2.AMIReference, out *AMIReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.EKSOptimizedLookupType = (*EKSAMILookupType)(unsafe.Pointer(in.EKSOptimizedLookupType)) - return nil -} - -// Convert_v1beta2_AMIReference_To_v1beta1_AMIReference is an autogenerated conversion function. -func Convert_v1beta2_AMIReference_To_v1beta1_AMIReference(in *v1beta2.AMIReference, out *AMIReference, s conversion.Scope) error { - return autoConvert_v1beta2_AMIReference_To_v1beta1_AMIReference(in, out, s) -} - -func autoConvert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(in *AWSCluster, out *v1beta2.AWSCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSCluster_To_v1beta2_AWSCluster is an autogenerated conversion function. -func Convert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(in *AWSCluster, out *v1beta2.AWSCluster, s conversion.Scope) error { - return autoConvert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(in, out, s) -} - -func autoConvert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(in *v1beta2.AWSCluster, out *AWSCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSCluster_To_v1beta1_AWSCluster is an autogenerated conversion function. -func Convert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(in *v1beta2.AWSCluster, out *AWSCluster, s conversion.Scope) error { - return autoConvert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta2.AWSClusterControllerIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta2.AWSClusterControllerIdentity, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1beta2_AWSClusterControllerIdentity(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *v1beta2.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *v1beta2.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta2.AWSClusterControllerIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta2.AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta2.AWSClusterControllerIdentityList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1beta2_AWSClusterControllerIdentityList(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *v1beta2.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *v1beta2.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta2.AWSClusterControllerIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta2.AWSClusterControllerIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1beta2_AWSClusterControllerIdentitySpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *v1beta2.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *v1beta2.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta2.AWSClusterIdentitySpec, s conversion.Scope) error { - out.AllowedNamespaces = (*v1beta2.AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) - return nil -} - -// Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta2.AWSClusterIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *v1beta2.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { - out.AllowedNamespaces = (*AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) - return nil -} - -// Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *v1beta2.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList(in *AWSClusterList, out *v1beta2.AWSClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSCluster_To_v1beta2_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList(in *AWSClusterList, out *v1beta2.AWSClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterList_To_v1beta2_AWSClusterList(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(in *v1beta2.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSCluster_To_v1beta1_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(in *v1beta2.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterList_To_v1beta1_AWSClusterList(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta2.AWSClusterRoleIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta2.AWSClusterRoleIdentity, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1beta2_AWSClusterRoleIdentity(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *v1beta2.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *v1beta2.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta2.AWSClusterRoleIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta2.AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta2.AWSClusterRoleIdentityList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1beta2_AWSClusterRoleIdentityList(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *v1beta2.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *v1beta2.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta2.AWSClusterRoleIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { - return err - } - out.ExternalID = in.ExternalID - out.SourceIdentityRef = (*v1beta2.AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) - return nil -} - -// Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta2.AWSClusterRoleIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1beta2_AWSClusterRoleIdentitySpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *v1beta2.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { - return err - } - out.ExternalID = in.ExternalID - out.SourceIdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) - return nil -} - -// Convert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *v1beta2.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(in *AWSClusterSpec, out *v1beta2.AWSClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { - return err - } - out.Region = in.Region - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - out.AdditionalTags = *(*v1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - if in.ControlPlaneLoadBalancer != nil { - in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer - *out = new(v1beta2.AWSLoadBalancerSpec) - if err := Convert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneLoadBalancer = nil - } - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1beta1_Bastion_To_v1beta2_Bastion(&in.Bastion, &out.Bastion, s); err != nil { - return err - } - out.IdentityRef = (*v1beta2.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) - if in.S3Bucket != nil { - in, out := &in.S3Bucket, &out.S3Bucket - *out = new(v1beta2.S3Bucket) - if err := Convert_v1beta1_S3Bucket_To_v1beta2_S3Bucket(*in, *out, s); err != nil { - return err - } - } else { - out.S3Bucket = nil - } - return nil -} - -// Convert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(in *AWSClusterSpec, out *v1beta2.AWSClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *v1beta2.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { - return err - } - out.Region = in.Region - // WARNING: in.Partition requires manual conversion: does not exist in peer-type - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) - if in.ControlPlaneLoadBalancer != nil { - in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer - *out = new(AWSLoadBalancerSpec) - if err := Convert_v1beta2_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneLoadBalancer = nil - } - // WARNING: in.SecondaryControlPlaneLoadBalancer requires manual conversion: does not exist in peer-type - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1beta2_Bastion_To_v1beta1_Bastion(&in.Bastion, &out.Bastion, s); err != nil { - return err - } - out.IdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) - if in.S3Bucket != nil { - in, out := &in.S3Bucket, &out.S3Bucket - *out = new(S3Bucket) - if err := Convert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(*in, *out, s); err != nil { - return err - } - } else { - out.S3Bucket = nil - } - return nil -} - -func autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta2.AWSClusterStaticIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta2.AWSClusterStaticIdentity, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1beta2_AWSClusterStaticIdentity(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *v1beta2.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *v1beta2.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta2.AWSClusterStaticIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta2.AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta2.AWSClusterStaticIdentityList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1beta2_AWSClusterStaticIdentityList(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *v1beta2.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *v1beta2.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1beta2.AWSClusterStaticIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1beta2_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - out.SecretRef = in.SecretRef - return nil -} - -// Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1beta2.AWSClusterStaticIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1beta2_AWSClusterStaticIdentitySpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *v1beta2.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { - if err := Convert_v1beta2_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { - return err - } - out.SecretRef = in.SecretRef - return nil -} - -// Convert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *v1beta2.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus(in *AWSClusterStatus, out *v1beta2.AWSClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - if err := Convert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus(&in.Network, &out.Network, s); err != nil { - return err - } - out.FailureDomains = *(*corev1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(v1beta2.Instance) - if err := Convert_v1beta1_Instance_To_v1beta2_Instance(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus(in *AWSClusterStatus, out *v1beta2.AWSClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterStatus_To_v1beta2_AWSClusterStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *v1beta2.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - if err := Convert_v1beta2_NetworkStatus_To_v1beta1_NetworkStatus(&in.Network, &out.Network, s); err != nil { - return err - } - out.FailureDomains = *(*corev1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Instance) - if err := Convert_v1beta2_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *v1beta2.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(in *AWSClusterTemplate, out *v1beta2.AWSClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(in *AWSClusterTemplate, out *v1beta2.AWSClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in *v1beta2.AWSClusterTemplate, out *AWSClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in *v1beta2.AWSClusterTemplate, out *AWSClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList(in *AWSClusterTemplateList, out *v1beta2.AWSClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSClusterTemplate_To_v1beta2_AWSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList(in *AWSClusterTemplateList, out *v1beta2.AWSClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterTemplateList_To_v1beta2_AWSClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in *v1beta2.AWSClusterTemplateList, out *AWSClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in *v1beta2.AWSClusterTemplateList, out *AWSClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource(in *AWSClusterTemplateResource, out *v1beta2.AWSClusterTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSClusterSpec_To_v1beta2_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource(in *AWSClusterTemplateResource, out *v1beta2.AWSClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in *v1beta2.AWSClusterTemplateResource, out *AWSClusterTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in *v1beta2.AWSClusterTemplateResource, out *AWSClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec(in *AWSClusterTemplateSpec, out *v1beta2.AWSClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_AWSClusterTemplateResource_To_v1beta2_AWSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec(in *AWSClusterTemplateSpec, out *v1beta2.AWSClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSClusterTemplateSpec_To_v1beta2_AWSClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in *v1beta2.AWSClusterTemplateSpec, out *AWSClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta2_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in *v1beta2.AWSClusterTemplateSpec, out *AWSClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_AWSIdentityReference_To_v1beta2_AWSIdentityReference(in *AWSIdentityReference, out *v1beta2.AWSIdentityReference, s conversion.Scope) error { - out.Name = in.Name - out.Kind = v1beta2.AWSIdentityKind(in.Kind) - return nil -} - -// Convert_v1beta1_AWSIdentityReference_To_v1beta2_AWSIdentityReference is an autogenerated conversion function. -func Convert_v1beta1_AWSIdentityReference_To_v1beta2_AWSIdentityReference(in *AWSIdentityReference, out *v1beta2.AWSIdentityReference, s conversion.Scope) error { - return autoConvert_v1beta1_AWSIdentityReference_To_v1beta2_AWSIdentityReference(in, out, s) -} - -func autoConvert_v1beta2_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *v1beta2.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { - out.Name = in.Name - out.Kind = AWSIdentityKind(in.Kind) - return nil -} - -// Convert_v1beta2_AWSIdentityReference_To_v1beta1_AWSIdentityReference is an autogenerated conversion function. -func Convert_v1beta2_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *v1beta2.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { - return autoConvert_v1beta2_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in, out, s) -} - -func autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta2.AWSLoadBalancerSpec, s conversion.Scope) error { - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Scheme = (*v1beta2.ELBScheme)(unsafe.Pointer(in.Scheme)) - out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing - out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) - out.HealthCheckProtocol = (*v1beta2.ELBProtocol)(unsafe.Pointer(in.HealthCheckProtocol)) - out.AdditionalSecurityGroups = *(*[]string)(unsafe.Pointer(&in.AdditionalSecurityGroups)) - return nil -} - -// Convert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta2.AWSLoadBalancerSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1beta2_AWSLoadBalancerSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *v1beta2.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Scheme = (*ClassicELBScheme)(unsafe.Pointer(in.Scheme)) - out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing - out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) - out.HealthCheckProtocol = (*ClassicELBProtocol)(unsafe.Pointer(in.HealthCheckProtocol)) - // WARNING: in.HealthCheck requires manual conversion: does not exist in peer-type - out.AdditionalSecurityGroups = *(*[]string)(unsafe.Pointer(&in.AdditionalSecurityGroups)) - // WARNING: in.AdditionalListeners requires manual conversion: does not exist in peer-type - // WARNING: in.IngressRules requires manual conversion: does not exist in peer-type - // WARNING: in.LoadBalancerType requires manual conversion: does not exist in peer-type - // WARNING: in.DisableHostsRewrite requires manual conversion: does not exist in peer-type - // WARNING: in.PreserveClientIP requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(in *AWSMachine, out *v1beta2.AWSMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine is an autogenerated conversion function. -func Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(in *AWSMachine, out *v1beta2.AWSMachine, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(in, out, s) -} - -func autoConvert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(in *v1beta2.AWSMachine, out *AWSMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSMachineStatus_To_v1beta1_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine is an autogenerated conversion function. -func Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(in *v1beta2.AWSMachine, out *AWSMachine, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(in *AWSMachineList, out *v1beta2.AWSMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(in *AWSMachineList, out *v1beta2.AWSMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(in *v1beta2.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList is an autogenerated conversion function. -func Convert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(in *v1beta2.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(in *AWSMachineSpec, out *v1beta2.AWSMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - if err := Convert_v1beta1_AMIReference_To_v1beta2_AMIReference(&in.AMI, &out.AMI, s); err != nil { - return err - } - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - out.InstanceType = in.InstanceType - out.AdditionalTags = *(*v1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.IAMInstanceProfile = in.IAMInstanceProfile - out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) - if in.AdditionalSecurityGroups != nil { - in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]v1beta2.AWSResourceReference, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AdditionalSecurityGroups = nil - } - // WARNING: in.FailureDomain requires manual conversion: does not exist in peer-type - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(v1beta2.AWSResourceReference) - if err := Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(*in, *out, s); err != nil { - return err - } - } else { - out.Subnet = nil - } - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.RootVolume = (*v1beta2.Volume)(unsafe.Pointer(in.RootVolume)) - out.NonRootVolumes = *(*[]v1beta2.Volume)(unsafe.Pointer(&in.NonRootVolumes)) - out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) - out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) - if err := Convert_v1beta1_CloudInit_To_v1beta2_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { - return err - } - if in.Ignition != nil { - in, out := &in.Ignition, &out.Ignition - *out = new(v1beta2.Ignition) - if err := Convert_v1beta1_Ignition_To_v1beta2_Ignition(*in, *out, s); err != nil { - return err - } - } else { - out.Ignition = nil - } - out.SpotMarketOptions = (*v1beta2.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - out.Tenancy = in.Tenancy - return nil -} - -func autoConvert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *v1beta2.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - // WARNING: in.InstanceMetadataOptions requires manual conversion: does not exist in peer-type - if err := Convert_v1beta2_AMIReference_To_v1beta1_AMIReference(&in.AMI, &out.AMI, s); err != nil { - return err - } - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - out.InstanceType = in.InstanceType - // WARNING: in.CPUOptions requires manual conversion: does not exist in peer-type - out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.IAMInstanceProfile = in.IAMInstanceProfile - out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) - // WARNING: in.ElasticIPPool requires manual conversion: does not exist in peer-type - if in.AdditionalSecurityGroups != nil { - in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]AWSResourceReference, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.AdditionalSecurityGroups = nil - } - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(AWSResourceReference) - if err := Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(*in, *out, s); err != nil { - return err - } - } else { - out.Subnet = nil - } - // WARNING: in.SecurityGroupOverrides requires manual conversion: does not exist in peer-type - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.RootVolume = (*Volume)(unsafe.Pointer(in.RootVolume)) - out.NonRootVolumes = *(*[]Volume)(unsafe.Pointer(&in.NonRootVolumes)) - out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) - // WARNING: in.NetworkInterfaceType requires manual conversion: does not exist in peer-type - out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) - if err := Convert_v1beta2_CloudInit_To_v1beta1_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { - return err - } - if in.Ignition != nil { - in, out := &in.Ignition, &out.Ignition - *out = new(Ignition) - if err := Convert_v1beta2_Ignition_To_v1beta1_Ignition(*in, *out, s); err != nil { - return err - } - } else { - out.Ignition = nil - } - out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - // WARNING: in.PlacementGroupName requires manual conversion: does not exist in peer-type - // WARNING: in.PlacementGroupPartition requires manual conversion: does not exist in peer-type - out.Tenancy = in.Tenancy - // WARNING: in.PrivateDNSName requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationID requires manual conversion: does not exist in peer-type - // WARNING: in.MarketType requires manual conversion: does not exist in peer-type - // WARNING: in.HostID requires manual conversion: does not exist in peer-type - // WARNING: in.HostAffinity requires manual conversion: does not exist in peer-type - // WARNING: in.DynamicHostAllocation requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationPreference requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus(in *AWSMachineStatus, out *v1beta2.AWSMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Interruptible = in.Interruptible - out.Addresses = *(*[]corev1beta1.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*v1beta2.InstanceState)(unsafe.Pointer(in.InstanceState)) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus(in *AWSMachineStatus, out *v1beta2.AWSMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineStatus_To_v1beta2_AWSMachineStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *v1beta2.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Interruptible = in.Interruptible - out.Addresses = *(*[]corev1beta1.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*InstanceState)(unsafe.Pointer(in.InstanceState)) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - // WARNING: in.DedicatedHost requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta2.AWSMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta2.AWSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *v1beta2.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate is an autogenerated conversion function. -func Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *v1beta2.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta2.AWSMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta2.AWSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *v1beta2.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *v1beta2.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta2.AWSMachineTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta2.AWSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *v1beta2.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *v1beta2.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta2.AWSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_AWSMachineTemplateResource_To_v1beta2_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta2.AWSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1beta2_AWSMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *v1beta2.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta2_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *v1beta2.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus(in *AWSMachineTemplateStatus, out *v1beta2.AWSMachineTemplateStatus, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - return nil -} - -// Convert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus(in *AWSMachineTemplateStatus, out *v1beta2.AWSMachineTemplateStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachineTemplateStatus_To_v1beta2_AWSMachineTemplateStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatus(in *v1beta2.AWSMachineTemplateStatus, out *AWSMachineTemplateStatus, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - // WARNING: in.NodeInfo requires manual conversion: does not exist in peer-type - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in *AWSResourceReference, out *v1beta2.AWSResourceReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - // WARNING: in.ARN requires manual conversion: does not exist in peer-type - out.Filters = *(*[]v1beta2.Filter)(unsafe.Pointer(&in.Filters)) - return nil -} - -func autoConvert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(in *v1beta2.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.Filters = *(*[]Filter)(unsafe.Pointer(&in.Filters)) - return nil -} - -// Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference is an autogenerated conversion function. -func Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(in *v1beta2.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { - return autoConvert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(in, out, s) -} - -func autoConvert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec(in *AWSRoleSpec, out *v1beta2.AWSRoleSpec, s conversion.Scope) error { - out.RoleArn = in.RoleArn - out.SessionName = in.SessionName - out.DurationSeconds = in.DurationSeconds - out.InlinePolicy = in.InlinePolicy - out.PolicyARNs = *(*[]string)(unsafe.Pointer(&in.PolicyARNs)) - return nil -} - -// Convert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec(in *AWSRoleSpec, out *v1beta2.AWSRoleSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSRoleSpec_To_v1beta2_AWSRoleSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *v1beta2.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { - out.RoleArn = in.RoleArn - out.SessionName = in.SessionName - out.DurationSeconds = in.DurationSeconds - out.InlinePolicy = in.InlinePolicy - out.PolicyARNs = *(*[]string)(unsafe.Pointer(&in.PolicyARNs)) - return nil -} - -// Convert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec is an autogenerated conversion function. -func Convert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *v1beta2.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { - return autoConvert_v1beta2_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in, out, s) -} - -func autoConvert_v1beta1_AllowedNamespaces_To_v1beta2_AllowedNamespaces(in *AllowedNamespaces, out *v1beta2.AllowedNamespaces, s conversion.Scope) error { - out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) - out.Selector = in.Selector - return nil -} - -// Convert_v1beta1_AllowedNamespaces_To_v1beta2_AllowedNamespaces is an autogenerated conversion function. -func Convert_v1beta1_AllowedNamespaces_To_v1beta2_AllowedNamespaces(in *AllowedNamespaces, out *v1beta2.AllowedNamespaces, s conversion.Scope) error { - return autoConvert_v1beta1_AllowedNamespaces_To_v1beta2_AllowedNamespaces(in, out, s) -} - -func autoConvert_v1beta2_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *v1beta2.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { - out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) - out.Selector = in.Selector - return nil -} - -// Convert_v1beta2_AllowedNamespaces_To_v1beta1_AllowedNamespaces is an autogenerated conversion function. -func Convert_v1beta2_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *v1beta2.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { - return autoConvert_v1beta2_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in, out, s) -} - -func autoConvert_v1beta1_Bastion_To_v1beta2_Bastion(in *Bastion, out *v1beta2.Bastion, s conversion.Scope) error { - out.Enabled = in.Enabled - out.DisableIngressRules = in.DisableIngressRules - out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) - out.InstanceType = in.InstanceType - out.AMI = in.AMI - return nil -} - -// Convert_v1beta1_Bastion_To_v1beta2_Bastion is an autogenerated conversion function. -func Convert_v1beta1_Bastion_To_v1beta2_Bastion(in *Bastion, out *v1beta2.Bastion, s conversion.Scope) error { - return autoConvert_v1beta1_Bastion_To_v1beta2_Bastion(in, out, s) -} - -func autoConvert_v1beta2_Bastion_To_v1beta1_Bastion(in *v1beta2.Bastion, out *Bastion, s conversion.Scope) error { - out.Enabled = in.Enabled - out.DisableIngressRules = in.DisableIngressRules - out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) - out.InstanceType = in.InstanceType - out.AMI = in.AMI - return nil -} - -// Convert_v1beta2_Bastion_To_v1beta1_Bastion is an autogenerated conversion function. -func Convert_v1beta2_Bastion_To_v1beta1_Bastion(in *v1beta2.Bastion, out *Bastion, s conversion.Scope) error { - return autoConvert_v1beta2_Bastion_To_v1beta1_Bastion(in, out, s) -} - -func autoConvert_v1beta1_BuildParams_To_v1beta2_BuildParams(in *BuildParams, out *v1beta2.BuildParams, s conversion.Scope) error { - out.Lifecycle = v1beta2.ResourceLifecycle(in.Lifecycle) - out.ClusterName = in.ClusterName - out.ResourceID = in.ResourceID - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Role = (*string)(unsafe.Pointer(in.Role)) - out.Additional = *(*v1beta2.Tags)(unsafe.Pointer(&in.Additional)) - return nil -} - -// Convert_v1beta1_BuildParams_To_v1beta2_BuildParams is an autogenerated conversion function. -func Convert_v1beta1_BuildParams_To_v1beta2_BuildParams(in *BuildParams, out *v1beta2.BuildParams, s conversion.Scope) error { - return autoConvert_v1beta1_BuildParams_To_v1beta2_BuildParams(in, out, s) -} - -func autoConvert_v1beta2_BuildParams_To_v1beta1_BuildParams(in *v1beta2.BuildParams, out *BuildParams, s conversion.Scope) error { - out.Lifecycle = ResourceLifecycle(in.Lifecycle) - out.ClusterName = in.ClusterName - out.ResourceID = in.ResourceID - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Role = (*string)(unsafe.Pointer(in.Role)) - out.Additional = *(*Tags)(unsafe.Pointer(&in.Additional)) - return nil -} - -// Convert_v1beta2_BuildParams_To_v1beta1_BuildParams is an autogenerated conversion function. -func Convert_v1beta2_BuildParams_To_v1beta1_BuildParams(in *v1beta2.BuildParams, out *BuildParams, s conversion.Scope) error { - return autoConvert_v1beta2_BuildParams_To_v1beta1_BuildParams(in, out, s) -} - -func autoConvert_v1beta1_CNIIngressRule_To_v1beta2_CNIIngressRule(in *CNIIngressRule, out *v1beta2.CNIIngressRule, s conversion.Scope) error { - out.Description = in.Description - out.Protocol = v1beta2.SecurityGroupProtocol(in.Protocol) - out.FromPort = in.FromPort - out.ToPort = in.ToPort - return nil -} - -// Convert_v1beta1_CNIIngressRule_To_v1beta2_CNIIngressRule is an autogenerated conversion function. -func Convert_v1beta1_CNIIngressRule_To_v1beta2_CNIIngressRule(in *CNIIngressRule, out *v1beta2.CNIIngressRule, s conversion.Scope) error { - return autoConvert_v1beta1_CNIIngressRule_To_v1beta2_CNIIngressRule(in, out, s) -} - -func autoConvert_v1beta2_CNIIngressRule_To_v1beta1_CNIIngressRule(in *v1beta2.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { - out.Description = in.Description - out.Protocol = SecurityGroupProtocol(in.Protocol) - out.FromPort = in.FromPort - out.ToPort = in.ToPort - return nil -} - -// Convert_v1beta2_CNIIngressRule_To_v1beta1_CNIIngressRule is an autogenerated conversion function. -func Convert_v1beta2_CNIIngressRule_To_v1beta1_CNIIngressRule(in *v1beta2.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { - return autoConvert_v1beta2_CNIIngressRule_To_v1beta1_CNIIngressRule(in, out, s) -} - -func autoConvert_v1beta1_CNISpec_To_v1beta2_CNISpec(in *CNISpec, out *v1beta2.CNISpec, s conversion.Scope) error { - out.CNIIngressRules = *(*v1beta2.CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) - return nil -} - -// Convert_v1beta1_CNISpec_To_v1beta2_CNISpec is an autogenerated conversion function. -func Convert_v1beta1_CNISpec_To_v1beta2_CNISpec(in *CNISpec, out *v1beta2.CNISpec, s conversion.Scope) error { - return autoConvert_v1beta1_CNISpec_To_v1beta2_CNISpec(in, out, s) -} - -func autoConvert_v1beta2_CNISpec_To_v1beta1_CNISpec(in *v1beta2.CNISpec, out *CNISpec, s conversion.Scope) error { - out.CNIIngressRules = *(*CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) - return nil -} - -// Convert_v1beta2_CNISpec_To_v1beta1_CNISpec is an autogenerated conversion function. -func Convert_v1beta2_CNISpec_To_v1beta1_CNISpec(in *v1beta2.CNISpec, out *CNISpec, s conversion.Scope) error { - return autoConvert_v1beta2_CNISpec_To_v1beta1_CNISpec(in, out, s) -} - -func autoConvert_v1beta1_ClassicELBAttributes_To_v1beta2_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta2.ClassicELBAttributes, s conversion.Scope) error { - out.IdleTimeout = time.Duration(in.IdleTimeout) - out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing - return nil -} - -// Convert_v1beta1_ClassicELBAttributes_To_v1beta2_ClassicELBAttributes is an autogenerated conversion function. -func Convert_v1beta1_ClassicELBAttributes_To_v1beta2_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta2.ClassicELBAttributes, s conversion.Scope) error { - return autoConvert_v1beta1_ClassicELBAttributes_To_v1beta2_ClassicELBAttributes(in, out, s) -} - -func autoConvert_v1beta2_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *v1beta2.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { - out.IdleTimeout = time.Duration(in.IdleTimeout) - out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing - return nil -} - -// Convert_v1beta2_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes is an autogenerated conversion function. -func Convert_v1beta2_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *v1beta2.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { - return autoConvert_v1beta2_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in, out, s) -} - -func autoConvert_v1beta1_ClassicELBHealthCheck_To_v1beta2_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta2.ClassicELBHealthCheck, s conversion.Scope) error { - out.Target = in.Target - out.Interval = time.Duration(in.Interval) - out.Timeout = time.Duration(in.Timeout) - out.HealthyThreshold = in.HealthyThreshold - out.UnhealthyThreshold = in.UnhealthyThreshold - return nil -} - -// Convert_v1beta1_ClassicELBHealthCheck_To_v1beta2_ClassicELBHealthCheck is an autogenerated conversion function. -func Convert_v1beta1_ClassicELBHealthCheck_To_v1beta2_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta2.ClassicELBHealthCheck, s conversion.Scope) error { - return autoConvert_v1beta1_ClassicELBHealthCheck_To_v1beta2_ClassicELBHealthCheck(in, out, s) -} - -func autoConvert_v1beta2_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *v1beta2.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { - out.Target = in.Target - out.Interval = time.Duration(in.Interval) - out.Timeout = time.Duration(in.Timeout) - out.HealthyThreshold = in.HealthyThreshold - out.UnhealthyThreshold = in.UnhealthyThreshold - return nil -} - -// Convert_v1beta2_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck is an autogenerated conversion function. -func Convert_v1beta2_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *v1beta2.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { - return autoConvert_v1beta2_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in, out, s) -} - -func autoConvert_v1beta1_ClassicELBListener_To_v1beta2_ClassicELBListener(in *ClassicELBListener, out *v1beta2.ClassicELBListener, s conversion.Scope) error { - out.Protocol = v1beta2.ELBProtocol(in.Protocol) - out.Port = in.Port - out.InstanceProtocol = v1beta2.ELBProtocol(in.InstanceProtocol) - out.InstancePort = in.InstancePort - return nil -} - -// Convert_v1beta1_ClassicELBListener_To_v1beta2_ClassicELBListener is an autogenerated conversion function. -func Convert_v1beta1_ClassicELBListener_To_v1beta2_ClassicELBListener(in *ClassicELBListener, out *v1beta2.ClassicELBListener, s conversion.Scope) error { - return autoConvert_v1beta1_ClassicELBListener_To_v1beta2_ClassicELBListener(in, out, s) -} - -func autoConvert_v1beta2_ClassicELBListener_To_v1beta1_ClassicELBListener(in *v1beta2.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { - out.Protocol = ClassicELBProtocol(in.Protocol) - out.Port = in.Port - out.InstanceProtocol = ClassicELBProtocol(in.InstanceProtocol) - out.InstancePort = in.InstancePort - return nil -} - -// Convert_v1beta2_ClassicELBListener_To_v1beta1_ClassicELBListener is an autogenerated conversion function. -func Convert_v1beta2_ClassicELBListener_To_v1beta1_ClassicELBListener(in *v1beta2.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { - return autoConvert_v1beta2_ClassicELBListener_To_v1beta1_ClassicELBListener(in, out, s) -} - -func autoConvert_v1beta1_CloudInit_To_v1beta2_CloudInit(in *CloudInit, out *v1beta2.CloudInit, s conversion.Scope) error { - out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager - out.SecretCount = in.SecretCount - out.SecretPrefix = in.SecretPrefix - out.SecureSecretsBackend = v1beta2.SecretBackend(in.SecureSecretsBackend) - return nil -} - -// Convert_v1beta1_CloudInit_To_v1beta2_CloudInit is an autogenerated conversion function. -func Convert_v1beta1_CloudInit_To_v1beta2_CloudInit(in *CloudInit, out *v1beta2.CloudInit, s conversion.Scope) error { - return autoConvert_v1beta1_CloudInit_To_v1beta2_CloudInit(in, out, s) -} - -func autoConvert_v1beta2_CloudInit_To_v1beta1_CloudInit(in *v1beta2.CloudInit, out *CloudInit, s conversion.Scope) error { - out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager - out.SecretCount = in.SecretCount - out.SecretPrefix = in.SecretPrefix - out.SecureSecretsBackend = SecretBackend(in.SecureSecretsBackend) - return nil -} - -// Convert_v1beta2_CloudInit_To_v1beta1_CloudInit is an autogenerated conversion function. -func Convert_v1beta2_CloudInit_To_v1beta1_CloudInit(in *v1beta2.CloudInit, out *CloudInit, s conversion.Scope) error { - return autoConvert_v1beta2_CloudInit_To_v1beta1_CloudInit(in, out, s) -} - -func autoConvert_v1beta1_Filter_To_v1beta2_Filter(in *Filter, out *v1beta2.Filter, s conversion.Scope) error { - out.Name = in.Name - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_v1beta1_Filter_To_v1beta2_Filter is an autogenerated conversion function. -func Convert_v1beta1_Filter_To_v1beta2_Filter(in *Filter, out *v1beta2.Filter, s conversion.Scope) error { - return autoConvert_v1beta1_Filter_To_v1beta2_Filter(in, out, s) -} - -func autoConvert_v1beta2_Filter_To_v1beta1_Filter(in *v1beta2.Filter, out *Filter, s conversion.Scope) error { - out.Name = in.Name - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_v1beta2_Filter_To_v1beta1_Filter is an autogenerated conversion function. -func Convert_v1beta2_Filter_To_v1beta1_Filter(in *v1beta2.Filter, out *Filter, s conversion.Scope) error { - return autoConvert_v1beta2_Filter_To_v1beta1_Filter(in, out, s) -} - -func autoConvert_v1beta1_IPv6_To_v1beta2_IPv6(in *IPv6, out *v1beta2.IPv6, s conversion.Scope) error { - out.CidrBlock = in.CidrBlock - out.PoolID = in.PoolID - out.EgressOnlyInternetGatewayID = (*string)(unsafe.Pointer(in.EgressOnlyInternetGatewayID)) - return nil -} - -// Convert_v1beta1_IPv6_To_v1beta2_IPv6 is an autogenerated conversion function. -func Convert_v1beta1_IPv6_To_v1beta2_IPv6(in *IPv6, out *v1beta2.IPv6, s conversion.Scope) error { - return autoConvert_v1beta1_IPv6_To_v1beta2_IPv6(in, out, s) -} - -func autoConvert_v1beta2_IPv6_To_v1beta1_IPv6(in *v1beta2.IPv6, out *IPv6, s conversion.Scope) error { - out.CidrBlock = in.CidrBlock - out.PoolID = in.PoolID - out.EgressOnlyInternetGatewayID = (*string)(unsafe.Pointer(in.EgressOnlyInternetGatewayID)) - // WARNING: in.IPAMPool requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_Ignition_To_v1beta2_Ignition(in *Ignition, out *v1beta2.Ignition, s conversion.Scope) error { - out.Version = in.Version - return nil -} - -// Convert_v1beta1_Ignition_To_v1beta2_Ignition is an autogenerated conversion function. -func Convert_v1beta1_Ignition_To_v1beta2_Ignition(in *Ignition, out *v1beta2.Ignition, s conversion.Scope) error { - return autoConvert_v1beta1_Ignition_To_v1beta2_Ignition(in, out, s) -} - -func autoConvert_v1beta2_Ignition_To_v1beta1_Ignition(in *v1beta2.Ignition, out *Ignition, s conversion.Scope) error { - out.Version = in.Version - // WARNING: in.StorageType requires manual conversion: does not exist in peer-type - // WARNING: in.Proxy requires manual conversion: does not exist in peer-type - // WARNING: in.TLS requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IngressRule_To_v1beta2_IngressRule(in *IngressRule, out *v1beta2.IngressRule, s conversion.Scope) error { - out.Description = in.Description - out.Protocol = v1beta2.SecurityGroupProtocol(in.Protocol) - out.FromPort = in.FromPort - out.ToPort = in.ToPort - out.CidrBlocks = *(*[]string)(unsafe.Pointer(&in.CidrBlocks)) - out.IPv6CidrBlocks = *(*[]string)(unsafe.Pointer(&in.IPv6CidrBlocks)) - out.SourceSecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroupIDs)) - return nil -} - -// Convert_v1beta1_IngressRule_To_v1beta2_IngressRule is an autogenerated conversion function. -func Convert_v1beta1_IngressRule_To_v1beta2_IngressRule(in *IngressRule, out *v1beta2.IngressRule, s conversion.Scope) error { - return autoConvert_v1beta1_IngressRule_To_v1beta2_IngressRule(in, out, s) -} - -func autoConvert_v1beta2_IngressRule_To_v1beta1_IngressRule(in *v1beta2.IngressRule, out *IngressRule, s conversion.Scope) error { - out.Description = in.Description - out.Protocol = SecurityGroupProtocol(in.Protocol) - out.FromPort = in.FromPort - out.ToPort = in.ToPort - out.CidrBlocks = *(*[]string)(unsafe.Pointer(&in.CidrBlocks)) - out.IPv6CidrBlocks = *(*[]string)(unsafe.Pointer(&in.IPv6CidrBlocks)) - out.SourceSecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroupIDs)) - // WARNING: in.SourceSecurityGroupRoles requires manual conversion: does not exist in peer-type - // WARNING: in.NatGatewaysIPsSource requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_Instance_To_v1beta2_Instance(in *Instance, out *v1beta2.Instance, s conversion.Scope) error { - out.ID = in.ID - out.State = v1beta2.InstanceState(in.State) - out.Type = in.Type - out.SubnetID = in.SubnetID - out.ImageID = in.ImageID - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) - out.UserData = (*string)(unsafe.Pointer(in.UserData)) - out.IAMProfile = in.IAMProfile - out.Addresses = *(*[]corev1beta1.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) - out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) - out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) - out.EBSOptimized = (*bool)(unsafe.Pointer(in.EBSOptimized)) - out.RootVolume = (*v1beta2.Volume)(unsafe.Pointer(in.RootVolume)) - out.NonRootVolumes = *(*[]v1beta2.Volume)(unsafe.Pointer(&in.NonRootVolumes)) - out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.AvailabilityZone = in.AvailabilityZone - out.SpotMarketOptions = (*v1beta2.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - out.Tenancy = in.Tenancy - out.VolumeIDs = *(*[]string)(unsafe.Pointer(&in.VolumeIDs)) - return nil -} - -// Convert_v1beta1_Instance_To_v1beta2_Instance is an autogenerated conversion function. -func Convert_v1beta1_Instance_To_v1beta2_Instance(in *Instance, out *v1beta2.Instance, s conversion.Scope) error { - return autoConvert_v1beta1_Instance_To_v1beta2_Instance(in, out, s) -} - -func autoConvert_v1beta2_Instance_To_v1beta1_Instance(in *v1beta2.Instance, out *Instance, s conversion.Scope) error { - out.ID = in.ID - out.State = InstanceState(in.State) - out.Type = in.Type - out.SubnetID = in.SubnetID - out.ImageID = in.ImageID - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) - out.UserData = (*string)(unsafe.Pointer(in.UserData)) - out.IAMProfile = in.IAMProfile - out.Addresses = *(*[]corev1beta1.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) - out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) - out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) - out.EBSOptimized = (*bool)(unsafe.Pointer(in.EBSOptimized)) - out.RootVolume = (*Volume)(unsafe.Pointer(in.RootVolume)) - out.NonRootVolumes = *(*[]Volume)(unsafe.Pointer(&in.NonRootVolumes)) - out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) - // WARNING: in.NetworkInterfaceType requires manual conversion: does not exist in peer-type - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.AvailabilityZone = in.AvailabilityZone - out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - // WARNING: in.PlacementGroupName requires manual conversion: does not exist in peer-type - // WARNING: in.PlacementGroupPartition requires manual conversion: does not exist in peer-type - out.Tenancy = in.Tenancy - out.VolumeIDs = *(*[]string)(unsafe.Pointer(&in.VolumeIDs)) - // WARNING: in.InstanceMetadataOptions requires manual conversion: does not exist in peer-type - // WARNING: in.PrivateDNSName requires manual conversion: does not exist in peer-type - // WARNING: in.PublicIPOnLaunch requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationID requires manual conversion: does not exist in peer-type - // WARNING: in.MarketType requires manual conversion: does not exist in peer-type - // WARNING: in.HostAffinity requires manual conversion: does not exist in peer-type - // WARNING: in.HostID requires manual conversion: does not exist in peer-type - // WARNING: in.DynamicHostAllocation requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationPreference requires manual conversion: does not exist in peer-type - // WARNING: in.CPUOptions requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec(in *NetworkSpec, out *v1beta2.NetworkSpec, s conversion.Scope) error { - if err := Convert_v1beta1_VPCSpec_To_v1beta2_VPCSpec(&in.VPC, &out.VPC, s); err != nil { - return err - } - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make(v1beta2.Subnets, len(*in)) - for i := range *in { - if err := Convert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subnets = nil - } - out.CNI = (*v1beta2.CNISpec)(unsafe.Pointer(in.CNI)) - out.SecurityGroupOverrides = *(*map[v1beta2.SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) - return nil -} - -// Convert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec is an autogenerated conversion function. -func Convert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec(in *NetworkSpec, out *v1beta2.NetworkSpec, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkSpec_To_v1beta2_NetworkSpec(in, out, s) -} - -func autoConvert_v1beta2_NetworkSpec_To_v1beta1_NetworkSpec(in *v1beta2.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { - if err := Convert_v1beta2_VPCSpec_To_v1beta1_VPCSpec(&in.VPC, &out.VPC, s); err != nil { - return err - } - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make(Subnets, len(*in)) - for i := range *in { - if err := Convert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subnets = nil - } - out.CNI = (*CNISpec)(unsafe.Pointer(in.CNI)) - out.SecurityGroupOverrides = *(*map[SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) - // WARNING: in.AdditionalControlPlaneIngressRules requires manual conversion: does not exist in peer-type - // WARNING: in.AdditionalNodeIngressRules requires manual conversion: does not exist in peer-type - // WARNING: in.NodePortIngressRuleCidrBlocks requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus(in *NetworkStatus, out *v1beta2.NetworkStatus, s conversion.Scope) error { - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make(map[v1beta2.SecurityGroupRole]v1beta2.SecurityGroup, len(*in)) - for key, val := range *in { - newVal := new(v1beta2.SecurityGroup) - if err := Convert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup(&val, newVal, s); err != nil { - return err - } - (*out)[v1beta2.SecurityGroupRole(key)] = *newVal - } - } else { - out.SecurityGroups = nil - } - if err := Convert_v1beta1_ClassicELB_To_v1beta2_LoadBalancer(&in.APIServerELB, &out.APIServerELB, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus is an autogenerated conversion function. -func Convert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus(in *NetworkStatus, out *v1beta2.NetworkStatus, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkStatus_To_v1beta2_NetworkStatus(in, out, s) -} - -func autoConvert_v1beta2_NetworkStatus_To_v1beta1_NetworkStatus(in *v1beta2.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make(map[SecurityGroupRole]SecurityGroup, len(*in)) - for key, val := range *in { - newVal := new(SecurityGroup) - if err := Convert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup(&val, newVal, s); err != nil { - return err - } - (*out)[SecurityGroupRole(key)] = *newVal - } - } else { - out.SecurityGroups = nil - } - if err := Convert_v1beta2_LoadBalancer_To_v1beta1_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { - return err - } - // WARNING: in.SecondaryAPIServerELB requires manual conversion: does not exist in peer-type - // WARNING: in.NatGatewaysIPs requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_RouteTable_To_v1beta2_RouteTable(in *RouteTable, out *v1beta2.RouteTable, s conversion.Scope) error { - out.ID = in.ID - return nil -} - -// Convert_v1beta1_RouteTable_To_v1beta2_RouteTable is an autogenerated conversion function. -func Convert_v1beta1_RouteTable_To_v1beta2_RouteTable(in *RouteTable, out *v1beta2.RouteTable, s conversion.Scope) error { - return autoConvert_v1beta1_RouteTable_To_v1beta2_RouteTable(in, out, s) -} - -func autoConvert_v1beta2_RouteTable_To_v1beta1_RouteTable(in *v1beta2.RouteTable, out *RouteTable, s conversion.Scope) error { - out.ID = in.ID - return nil -} - -// Convert_v1beta2_RouteTable_To_v1beta1_RouteTable is an autogenerated conversion function. -func Convert_v1beta2_RouteTable_To_v1beta1_RouteTable(in *v1beta2.RouteTable, out *RouteTable, s conversion.Scope) error { - return autoConvert_v1beta2_RouteTable_To_v1beta1_RouteTable(in, out, s) -} - -func autoConvert_v1beta1_S3Bucket_To_v1beta2_S3Bucket(in *S3Bucket, out *v1beta2.S3Bucket, s conversion.Scope) error { - out.ControlPlaneIAMInstanceProfile = in.ControlPlaneIAMInstanceProfile - out.NodesIAMInstanceProfiles = *(*[]string)(unsafe.Pointer(&in.NodesIAMInstanceProfiles)) - out.Name = in.Name - return nil -} - -// Convert_v1beta1_S3Bucket_To_v1beta2_S3Bucket is an autogenerated conversion function. -func Convert_v1beta1_S3Bucket_To_v1beta2_S3Bucket(in *S3Bucket, out *v1beta2.S3Bucket, s conversion.Scope) error { - return autoConvert_v1beta1_S3Bucket_To_v1beta2_S3Bucket(in, out, s) -} - -func autoConvert_v1beta2_S3Bucket_To_v1beta1_S3Bucket(in *v1beta2.S3Bucket, out *S3Bucket, s conversion.Scope) error { - out.ControlPlaneIAMInstanceProfile = in.ControlPlaneIAMInstanceProfile - out.NodesIAMInstanceProfiles = *(*[]string)(unsafe.Pointer(&in.NodesIAMInstanceProfiles)) - // WARNING: in.PresignedURLDuration requires manual conversion: does not exist in peer-type - out.Name = in.Name - // WARNING: in.BestEffortDeleteObjects requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup(in *SecurityGroup, out *v1beta2.SecurityGroup, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - if in.IngressRules != nil { - in, out := &in.IngressRules, &out.IngressRules - *out = make(v1beta2.IngressRules, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IngressRule_To_v1beta2_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.IngressRules = nil - } - out.Tags = *(*v1beta2.Tags)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup is an autogenerated conversion function. -func Convert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup(in *SecurityGroup, out *v1beta2.SecurityGroup, s conversion.Scope) error { - return autoConvert_v1beta1_SecurityGroup_To_v1beta2_SecurityGroup(in, out, s) -} - -func autoConvert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup(in *v1beta2.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - if in.IngressRules != nil { - in, out := &in.IngressRules, &out.IngressRules - *out = make(IngressRules, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IngressRule_To_v1beta1_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.IngressRules = nil - } - out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup is an autogenerated conversion function. -func Convert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup(in *v1beta2.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - return autoConvert_v1beta2_SecurityGroup_To_v1beta1_SecurityGroup(in, out, s) -} - -func autoConvert_v1beta1_SpotMarketOptions_To_v1beta2_SpotMarketOptions(in *SpotMarketOptions, out *v1beta2.SpotMarketOptions, s conversion.Scope) error { - out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) - return nil -} - -// Convert_v1beta1_SpotMarketOptions_To_v1beta2_SpotMarketOptions is an autogenerated conversion function. -func Convert_v1beta1_SpotMarketOptions_To_v1beta2_SpotMarketOptions(in *SpotMarketOptions, out *v1beta2.SpotMarketOptions, s conversion.Scope) error { - return autoConvert_v1beta1_SpotMarketOptions_To_v1beta2_SpotMarketOptions(in, out, s) -} - -func autoConvert_v1beta2_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *v1beta2.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { - out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) - return nil -} - -// Convert_v1beta2_SpotMarketOptions_To_v1beta1_SpotMarketOptions is an autogenerated conversion function. -func Convert_v1beta2_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *v1beta2.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { - return autoConvert_v1beta2_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in, out, s) -} - -func autoConvert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec(in *SubnetSpec, out *v1beta2.SubnetSpec, s conversion.Scope) error { - out.ID = in.ID - out.CidrBlock = in.CidrBlock - out.IPv6CidrBlock = in.IPv6CidrBlock - out.AvailabilityZone = in.AvailabilityZone - out.IsPublic = in.IsPublic - out.IsIPv6 = in.IsIPv6 - out.RouteTableID = (*string)(unsafe.Pointer(in.RouteTableID)) - out.NatGatewayID = (*string)(unsafe.Pointer(in.NatGatewayID)) - out.Tags = *(*v1beta2.Tags)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec is an autogenerated conversion function. -func Convert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec(in *SubnetSpec, out *v1beta2.SubnetSpec, s conversion.Scope) error { - return autoConvert_v1beta1_SubnetSpec_To_v1beta2_SubnetSpec(in, out, s) -} - -func autoConvert_v1beta2_SubnetSpec_To_v1beta1_SubnetSpec(in *v1beta2.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { - out.ID = in.ID - // WARNING: in.ResourceID requires manual conversion: does not exist in peer-type - out.CidrBlock = in.CidrBlock - out.IPv6CidrBlock = in.IPv6CidrBlock - out.AvailabilityZone = in.AvailabilityZone - out.IsPublic = in.IsPublic - out.IsIPv6 = in.IsIPv6 - out.RouteTableID = (*string)(unsafe.Pointer(in.RouteTableID)) - out.NatGatewayID = (*string)(unsafe.Pointer(in.NatGatewayID)) - out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) - // WARNING: in.ZoneType requires manual conversion: does not exist in peer-type - // WARNING: in.ParentZoneName requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_VPCSpec_To_v1beta2_VPCSpec(in *VPCSpec, out *v1beta2.VPCSpec, s conversion.Scope) error { - out.ID = in.ID - out.CidrBlock = in.CidrBlock - if in.IPv6 != nil { - in, out := &in.IPv6, &out.IPv6 - *out = new(v1beta2.IPv6) - if err := Convert_v1beta1_IPv6_To_v1beta2_IPv6(*in, *out, s); err != nil { - return err - } - } else { - out.IPv6 = nil - } - out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) - out.Tags = *(*v1beta2.Tags)(unsafe.Pointer(&in.Tags)) - out.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) - out.AvailabilityZoneSelection = (*v1beta2.AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) - return nil -} - -// Convert_v1beta1_VPCSpec_To_v1beta2_VPCSpec is an autogenerated conversion function. -func Convert_v1beta1_VPCSpec_To_v1beta2_VPCSpec(in *VPCSpec, out *v1beta2.VPCSpec, s conversion.Scope) error { - return autoConvert_v1beta1_VPCSpec_To_v1beta2_VPCSpec(in, out, s) -} - -func autoConvert_v1beta2_VPCSpec_To_v1beta1_VPCSpec(in *v1beta2.VPCSpec, out *VPCSpec, s conversion.Scope) error { - out.ID = in.ID - out.CidrBlock = in.CidrBlock - // WARNING: in.SecondaryCidrBlocks requires manual conversion: does not exist in peer-type - // WARNING: in.IPAMPool requires manual conversion: does not exist in peer-type - if in.IPv6 != nil { - in, out := &in.IPv6, &out.IPv6 - *out = new(IPv6) - if err := Convert_v1beta2_IPv6_To_v1beta1_IPv6(*in, *out, s); err != nil { - return err - } - } else { - out.IPv6 = nil - } - out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) - // WARNING: in.CarrierGatewayID requires manual conversion: does not exist in peer-type - out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) - out.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) - out.AvailabilityZoneSelection = (*AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) - // WARNING: in.EmptyRoutesDefaultVPCSecurityGroup requires manual conversion: does not exist in peer-type - // WARNING: in.PrivateDNSHostnameTypeOnLaunch requires manual conversion: does not exist in peer-type - // WARNING: in.ElasticIPPool requires manual conversion: does not exist in peer-type - // WARNING: in.SubnetSchema requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_Volume_To_v1beta2_Volume(in *Volume, out *v1beta2.Volume, s conversion.Scope) error { - out.DeviceName = in.DeviceName - out.Size = in.Size - out.Type = v1beta2.VolumeType(in.Type) - out.IOPS = in.IOPS - out.Throughput = (*int64)(unsafe.Pointer(in.Throughput)) - out.Encrypted = (*bool)(unsafe.Pointer(in.Encrypted)) - out.EncryptionKey = in.EncryptionKey - return nil -} - -// Convert_v1beta1_Volume_To_v1beta2_Volume is an autogenerated conversion function. -func Convert_v1beta1_Volume_To_v1beta2_Volume(in *Volume, out *v1beta2.Volume, s conversion.Scope) error { - return autoConvert_v1beta1_Volume_To_v1beta2_Volume(in, out, s) -} - -func autoConvert_v1beta2_Volume_To_v1beta1_Volume(in *v1beta2.Volume, out *Volume, s conversion.Scope) error { - out.DeviceName = in.DeviceName - out.Size = in.Size - out.Type = VolumeType(in.Type) - out.IOPS = in.IOPS - out.Throughput = (*int64)(unsafe.Pointer(in.Throughput)) - out.Encrypted = (*bool)(unsafe.Pointer(in.Encrypted)) - out.EncryptionKey = in.EncryptionKey - return nil -} - -// Convert_v1beta2_Volume_To_v1beta1_Volume is an autogenerated conversion function. -func Convert_v1beta2_Volume_To_v1beta1_Volume(in *v1beta2.Volume, out *Volume, s conversion.Scope) error { - return autoConvert_v1beta2_Volume_To_v1beta1_Volume(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awscluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awscluster_webhook.go deleted file mode 100644 index ddef7446bf11..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awscluster_webhook.go +++ /dev/null @@ -1,466 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - "net" - "strings" - - "github.com/google/go-cmp/cmp" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" - "sigs.k8s.io/cluster-api/util/annotations" -) - -const ( - warningClassicELB = "%s load balancer is using a classic elb which is deprecated & support will be removed in a future release, please consider using another type of load balancer instead" - warningHealthCheckProtocolNotSet = "healthcheck protocol is not set, the default value has changed from SSL to TCP. Health checks for existing clusters will be updated to TCP" -) - -// log is for logging in this package. -var _ = ctrl.Log.WithName("awscluster-resource") - -func (r *AWSCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsClusterWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awscluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1beta2,name=validation.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awscluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1beta2,name=default.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsClusterWebhook struct{} - -var ( - _ webhook.CustomValidator = &awsClusterWebhook{} - _ webhook.CustomDefaulter = &awsClusterWebhook{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSCluster) - if !ok { - return nil, fmt.Errorf("expected an AWSCluster object but got %T", r) - } - - var allErrs field.ErrorList - var allWarnings admission.Warnings - - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - allErrs = append(allErrs, r.validateSSHKeyName()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.Spec.S3Bucket.Validate()...) - allErrs = append(allErrs, r.validateNetwork()...) - - warnings, errs := r.validateControlPlaneLBs() - if len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if len(warnings) > 0 { - allWarnings = append(allWarnings, warnings...) - } - - return allWarnings, aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSCluster) - if !ok { - return nil, fmt.Errorf("expected an AWSCluster object but got %T", r) - } - - var allErrs field.ErrorList - var allWarnings admission.Warnings - - allErrs = append(allErrs, r.validateGCTasksAnnotation()...) - - oldC, ok := oldObj.(*AWSCluster) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected an AWSCluster but got a %T", oldObj)) - } - - if r.Spec.Region != oldC.Spec.Region { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "region"), r.Spec.Region, "field is immutable"), - ) - } - - // Validate the control plane load balancers. - lbs := map[*AWSLoadBalancerSpec]*AWSLoadBalancerSpec{ - oldC.Spec.ControlPlaneLoadBalancer: r.Spec.ControlPlaneLoadBalancer, - oldC.Spec.SecondaryControlPlaneLoadBalancer: r.Spec.SecondaryControlPlaneLoadBalancer, - } - - for oldLB, newLB := range lbs { - if oldLB == nil && newLB == nil { - continue - } - - allErrs = append(allErrs, r.validateControlPlaneLoadBalancerUpdate(oldLB, newLB)...) - } - - if !cmp.Equal(oldC.Spec.ControlPlaneEndpoint, clusterv1beta1.APIEndpoint{}) && - !cmp.Equal(r.Spec.ControlPlaneEndpoint, oldC.Spec.ControlPlaneEndpoint) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneEndpoint"), r.Spec.ControlPlaneEndpoint, "field is immutable"), - ) - } - - // Modifying VPC id is not allowed because it will cause a new VPC creation if set to nil. - if !cmp.Equal(oldC.Spec.NetworkSpec, NetworkSpec{}) && - !cmp.Equal(oldC.Spec.NetworkSpec.VPC, VPCSpec{}) && - oldC.Spec.NetworkSpec.VPC.ID != "" { - if cmp.Equal(r.Spec.NetworkSpec, NetworkSpec{}) || - cmp.Equal(r.Spec.NetworkSpec.VPC, VPCSpec{}) || - oldC.Spec.NetworkSpec.VPC.ID != r.Spec.NetworkSpec.VPC.ID { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "network", "vpc", "id"), - r.Spec.NetworkSpec.VPC.ID, "field cannot be modified once set")) - } - } - - // If a identityRef is already set, do not allow removal of it. - if oldC.Spec.IdentityRef != nil && r.Spec.IdentityRef == nil { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "identityRef"), - r.Spec.IdentityRef, "field cannot be set to nil"), - ) - } - - if annotations.IsExternallyManaged(oldC) && !annotations.IsExternallyManaged(r) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("metadata", "annotations"), - r.Annotations, "removal of externally managed annotation is not allowed"), - ) - } - - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.Spec.S3Bucket.Validate()...) - - if r.Spec.ControlPlaneLoadBalancer != nil { - if r.Spec.ControlPlaneLoadBalancer.LoadBalancerType == LoadBalancerTypeClassic { - allWarnings = append(allWarnings, fmt.Sprintf(warningClassicELB, "primary control plane")) - } - } - - if r.Spec.SecondaryControlPlaneLoadBalancer != nil { - if r.Spec.SecondaryControlPlaneLoadBalancer.LoadBalancerType == LoadBalancerTypeClassic { - allWarnings = append(allWarnings, fmt.Sprintf(warningClassicELB, "secondary control plane")) - } - } - - if r.Spec.ControlPlaneLoadBalancer == nil || r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol == nil { - allWarnings = append(allWarnings, fmt.Sprintf("%s. Existing load balancers will be updates", warningHealthCheckProtocolNotSet)) - } - - return allWarnings, aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -func (r *AWSCluster) validateControlPlaneLoadBalancerUpdate(oldlb, newlb *AWSLoadBalancerSpec) field.ErrorList { - var allErrs field.ErrorList - - if oldlb == nil { - // If old scheme was nil, the only value accepted here is the default value: internet-facing - if newlb.Scheme != nil && newlb.Scheme.String() != ELBSchemeInternetFacing.String() { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "scheme"), - newlb.Scheme, "field is immutable, default value was set to internet-facing"), - ) - } - } else { - // A disabled Load Balancer has many implications that must be treated as immutable/ - // this is mostly used by externally managed Control Plane, and there's no need to support type changes. - // More info: https://kubernetes.slack.com/archives/CD6U2V71N/p1708983246100859?thread_ts=1708973478.410979&cid=CD6U2V71N - if (oldlb.LoadBalancerType == LoadBalancerTypeDisabled && newlb.LoadBalancerType != LoadBalancerTypeDisabled) || - (newlb.LoadBalancerType == LoadBalancerTypeDisabled && oldlb.LoadBalancerType != LoadBalancerTypeDisabled) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "type"), - newlb.Scheme, "field is immutable when created of disabled type"), - ) - } - // If old scheme was not nil, the new scheme should be the same. - if !cmp.Equal(oldlb.Scheme, newlb.Scheme) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "scheme"), - newlb.Scheme, "field is immutable"), - ) - } - // The name must be defined when the AWSCluster is created. If it is not defined, - // then the controller generates a default name at runtime, but does not store it, - // so the name remains nil. In either case, the name cannot be changed. - if !cmp.Equal(oldlb.Name, newlb.Name) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "name"), - newlb.Name, "field is immutable"), - ) - } - - // Block the update for Protocol : - // - if it was not set in old spec but added in new spec - // - if it was set in old spec but changed in new spec - if oldlb.LoadBalancerType != LoadBalancerTypeClassic { - if !cmp.Equal(newlb.HealthCheckProtocol, oldlb.HealthCheckProtocol) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "healthCheckProtocol"), - newlb.HealthCheckProtocol, "field is immutable once set"), - ) - } - } - } - - return allErrs -} - -// Default satisfies the defaulting webhook interface. -func (*awsClusterWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSCluster) - if !ok { - return fmt.Errorf("expected an AWSCluster object but got %T", r) - } - - r.Default() - return nil -} - -// Default satisfies the defaulting webhook interface. -func (r *AWSCluster) Default() { - SetObjectDefaults_AWSCluster(r) -} - -func (r *AWSCluster) validateGCTasksAnnotation() field.ErrorList { - var allErrs field.ErrorList - - annotations := r.GetAnnotations() - if annotations == nil { - return nil - } - - if gcTasksAnnotationValue := annotations[ExternalResourceGCTasksAnnotation]; gcTasksAnnotationValue != "" { - gcTasks := strings.Split(gcTasksAnnotationValue, ",") - - supportedGCTasks := []GCTask{GCTaskLoadBalancer, GCTaskTargetGroup, GCTaskSecurityGroup} - - for _, gcTask := range gcTasks { - found := false - - for _, supportedGCTask := range supportedGCTasks { - if gcTask == string(supportedGCTask) { - found = true - break - } - } - - if !found { - allErrs = append(allErrs, - field.Invalid(field.NewPath("metadata", "annotations"), - r.Annotations, - fmt.Sprintf("annotation %s contains unsupported GC task %s", ExternalResourceGCTasksAnnotation, gcTask)), - ) - } - } - } - - return allErrs -} - -func (r *AWSCluster) validateSSHKeyName() field.ErrorList { - return validateSSHKeyName(r.Spec.SSHKeyName) -} - -func (r *AWSCluster) validateNetwork() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.NetworkSpec.VPC.IsIPv6Enabled() { - allErrs = append(allErrs, field.Invalid(field.NewPath("ipv6"), r.Spec.NetworkSpec.VPC.IPv6, "IPv6 cannot be used with unmanaged clusters at this time.")) - } - for _, subnet := range r.Spec.NetworkSpec.Subnets { - if subnet.IsIPv6 || subnet.IPv6CidrBlock != "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("subnets"), r.Spec.NetworkSpec.Subnets, "IPv6 cannot be used with unmanaged clusters at this time.")) - } - if subnet.ZoneType != nil && subnet.IsEdge() { - if subnet.ParentZoneName == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("subnets"), r.Spec.NetworkSpec.Subnets, "ParentZoneName must be set when ZoneType is 'local-zone'.")) - } - } - } - - if r.Spec.NetworkSpec.VPC.CidrBlock != "" && r.Spec.NetworkSpec.VPC.IPAMPool != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("cidrBlock"), r.Spec.NetworkSpec.VPC.CidrBlock, "cidrBlock and ipamPool cannot be used together")) - } - - if r.Spec.NetworkSpec.VPC.IPAMPool != nil && r.Spec.NetworkSpec.VPC.IPAMPool.ID == "" && r.Spec.NetworkSpec.VPC.IPAMPool.Name == "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("ipamPool"), r.Spec.NetworkSpec.VPC.IPAMPool, "ipamPool must have either id or name")) - } - - allErrs = append(allErrs, r.validateIngressRules(field.NewPath("spec", "network", "additionalControlPlaneIngressRules"), r.Spec.NetworkSpec.AdditionalControlPlaneIngressRules)...) - allErrs = append(allErrs, r.validateIngressRules(field.NewPath("spec", "network", "additionalNodeIngressRules"), r.Spec.NetworkSpec.AdditionalNodeIngressRules)...) - - for cidrBlockIndex, cidrBlock := range r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks { - if _, _, err := net.ParseCIDR(cidrBlock); err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "network", fmt.Sprintf("nodePortIngressRuleCidrBlocks[%d]", cidrBlockIndex)), r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks, "CIDR block is invalid")) - } - } - - if r.Spec.NetworkSpec.VPC.ElasticIPPool != nil { - eipp := r.Spec.NetworkSpec.VPC.ElasticIPPool - if eipp.PublicIpv4Pool != nil { - if eipp.PublicIpv4PoolFallBackOrder == nil { - return append(allErrs, field.Invalid(field.NewPath("elasticIpPool.publicIpv4PoolFallbackOrder"), r.Spec.NetworkSpec.VPC.ElasticIPPool, "publicIpv4PoolFallbackOrder must be set when publicIpv4Pool is defined.")) - } - awsPublicIpv4PoolPrefix := "ipv4pool-ec2-" - if !strings.HasPrefix(*eipp.PublicIpv4Pool, awsPublicIpv4PoolPrefix) { - return append(allErrs, field.Invalid(field.NewPath("elasticIpPool.publicIpv4Pool"), r.Spec.NetworkSpec.VPC.ElasticIPPool, fmt.Sprintf("publicIpv4Pool must start with %s.", awsPublicIpv4PoolPrefix))) - } - } - if eipp.PublicIpv4Pool == nil && eipp.PublicIpv4PoolFallBackOrder != nil { - return append(allErrs, field.Invalid(field.NewPath("elasticIpPool.publicIpv4PoolFallbackOrder"), r.Spec.NetworkSpec.VPC.ElasticIPPool, "publicIpv4Pool must be set when publicIpv4PoolFallbackOrder is defined.")) - } - } - - secondaryCidrBlocks := r.Spec.NetworkSpec.VPC.SecondaryCidrBlocks - secondaryCidrBlocksField := field.NewPath("spec", "network", "vpc", "secondaryCidrBlocks") - for _, cidrBlock := range secondaryCidrBlocks { - if r.Spec.NetworkSpec.VPC.CidrBlock != "" && r.Spec.NetworkSpec.VPC.CidrBlock == cidrBlock.IPv4CidrBlock { - allErrs = append(allErrs, field.Invalid(secondaryCidrBlocksField, secondaryCidrBlocks, fmt.Sprintf("AWSCluster.spec.network.vpc.secondaryCidrBlocks must not contain the primary AWSCluster.spec.network.vpc.cidrBlock %v", r.Spec.NetworkSpec.VPC.CidrBlock))) - } - } - - return allErrs -} - -func (r *AWSCluster) validateControlPlaneLBs() (admission.Warnings, field.ErrorList) { - var allErrs field.ErrorList - var allWarnings admission.Warnings - - if r.Spec.ControlPlaneLoadBalancer != nil && r.Spec.ControlPlaneLoadBalancer.LoadBalancerType == LoadBalancerTypeClassic { - allWarnings = append(allWarnings, fmt.Sprintf(warningClassicELB, "primary control plane")) - - if r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol == nil { - allWarnings = append(allWarnings, warningHealthCheckProtocolNotSet) - } - - if r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol != nil && *r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol == ELBProtocolSSL { - allWarnings = append(allWarnings, "loadbalancer is using a classic elb with SSL health check, this causes issues with ciper suites with kubernetes v1.30+") - } - } - - // If the secondary is defined, check that the name is not empty and different from the primary. - // Also, ensure that the secondary load balancer is an NLB - if r.Spec.SecondaryControlPlaneLoadBalancer != nil { - if r.Spec.SecondaryControlPlaneLoadBalancer.Name == nil || *r.Spec.SecondaryControlPlaneLoadBalancer.Name == "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "secondaryControlPlaneLoadBalancer", "name"), r.Spec.SecondaryControlPlaneLoadBalancer.Name, "secondary controlPlaneLoadBalancer.name cannot be empty")) - } - - if r.Spec.SecondaryControlPlaneLoadBalancer.Name == r.Spec.ControlPlaneLoadBalancer.Name { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "secondaryControlPlaneLoadBalancer", "name"), r.Spec.SecondaryControlPlaneLoadBalancer.Name, "field must be different from controlPlaneLoadBalancer.name")) - } - - if r.Spec.SecondaryControlPlaneLoadBalancer.Scheme.Equals(r.Spec.ControlPlaneLoadBalancer.Scheme) { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "secondaryControlPlaneLoadBalancer", "scheme"), r.Spec.SecondaryControlPlaneLoadBalancer.Scheme, "control plane load balancers must have different schemes")) - } - - if r.Spec.SecondaryControlPlaneLoadBalancer.LoadBalancerType != LoadBalancerTypeNLB { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "secondaryControlPlaneLoadBalancer", "loadBalancerType"), r.Spec.SecondaryControlPlaneLoadBalancer.LoadBalancerType, "secondary control plane load balancer must be a Network Load Balancer")) - } - if r.Spec.SecondaryControlPlaneLoadBalancer.LoadBalancerType == LoadBalancerTypeClassic { - allWarnings = append(allWarnings, fmt.Sprintf(warningClassicELB, "secondary control plane")) - } - } - - // Additional listeners are only supported for NLBs. - // Validate the control plane load balancers. - if r.Spec.ControlPlaneLoadBalancer != nil { - allErrs = append(allErrs, r.validateIngressRules(field.NewPath("spec", "controlPlaneLoadBalancer", "ingressRules"), r.Spec.ControlPlaneLoadBalancer.IngressRules)...) - } - if r.Spec.SecondaryControlPlaneLoadBalancer != nil { - allErrs = append(allErrs, r.validateIngressRules(field.NewPath("spec", "secondaryControlPlaneLoadBalancer", "ingressRules"), r.Spec.SecondaryControlPlaneLoadBalancer.IngressRules)...) - } - - if r.Spec.ControlPlaneLoadBalancer.LoadBalancerType == LoadBalancerTypeDisabled { - if r.Spec.ControlPlaneLoadBalancer.Name != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "name"), r.Spec.ControlPlaneLoadBalancer.Name, "cannot configure a name if the LoadBalancer reconciliation is disabled")) - } - - if r.Spec.ControlPlaneLoadBalancer.CrossZoneLoadBalancing { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "crossZoneLoadBalancing"), r.Spec.ControlPlaneLoadBalancer.CrossZoneLoadBalancing, "cross-zone load balancing cannot be set if the LoadBalancer reconciliation is disabled")) - } - - if len(r.Spec.ControlPlaneLoadBalancer.Subnets) > 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "subnets"), r.Spec.ControlPlaneLoadBalancer.Subnets, "subnets cannot be set if the LoadBalancer reconciliation is disabled")) - } - - if r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "healthCheckProtocol"), r.Spec.ControlPlaneLoadBalancer.HealthCheckProtocol, "healthcheck protocol cannot be set if the LoadBalancer reconciliation is disabled")) - } - - if len(r.Spec.ControlPlaneLoadBalancer.AdditionalSecurityGroups) > 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "additionalSecurityGroups"), r.Spec.ControlPlaneLoadBalancer.AdditionalSecurityGroups, "additional Security Groups cannot be set if the LoadBalancer reconciliation is disabled")) - } - - if len(r.Spec.ControlPlaneLoadBalancer.AdditionalListeners) > 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "additionalListeners"), r.Spec.ControlPlaneLoadBalancer.AdditionalListeners, "cannot set additional listeners if the LoadBalancer reconciliation is disabled")) - } - - if len(r.Spec.ControlPlaneLoadBalancer.IngressRules) > 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "ingressRules"), r.Spec.ControlPlaneLoadBalancer.IngressRules, "ingress rules cannot be set if the LoadBalancer reconciliation is disabled")) - } - - if r.Spec.ControlPlaneLoadBalancer.PreserveClientIP { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "preserveClientIP"), r.Spec.ControlPlaneLoadBalancer.PreserveClientIP, "cannot preserve client IP if the LoadBalancer reconciliation is disabled")) - } - - if r.Spec.ControlPlaneLoadBalancer.DisableHostsRewrite { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "disableHostsRewrite"), r.Spec.ControlPlaneLoadBalancer.DisableHostsRewrite, "cannot disable hosts rewrite if the LoadBalancer reconciliation is disabled")) - } - } - - return allWarnings, allErrs -} - -func (r *AWSCluster) validateIngressRules(path *field.Path, rules []IngressRule) field.ErrorList { - var allErrs field.ErrorList - for ruleIndex, rule := range rules { - rulePath := path.Index(ruleIndex) - if rule.NatGatewaysIPsSource { - if rule.CidrBlocks != nil || rule.IPv6CidrBlocks != nil || rule.SourceSecurityGroupIDs != nil || rule.SourceSecurityGroupRoles != nil { - allErrs = append(allErrs, field.Invalid(rulePath, rules, "natGatewaysIPsSource cannot be used together with CIDR blocks, security group IDs or security group roles")) - } - } else { - if (rule.CidrBlocks != nil || rule.IPv6CidrBlocks != nil) && (rule.SourceSecurityGroupIDs != nil || rule.SourceSecurityGroupRoles != nil) { - allErrs = append(allErrs, field.Invalid(rulePath, rules, "CIDR blocks and security group IDs or security group roles cannot be used together")) - } - } - } - return allErrs -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustercontrolleridentity_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustercontrolleridentity_webhook.go deleted file mode 100644 index ec52eb3947b7..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustercontrolleridentity_webhook.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// log is for logging in this package. -var _ = ctrl.Log.WithName("awsclustercontrolleridentity-resource") - -func (r *AWSClusterControllerIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsClusterControllerIdentityWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsclustercontrolleridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1beta2,name=validation.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsclustercontrolleridentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1beta2,name=default.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsClusterControllerIdentityWebhook struct{} - -var ( - _ webhook.CustomValidator = &awsClusterControllerIdentityWebhook{} - _ webhook.CustomDefaulter = &awsClusterControllerIdentityWebhook{} -) - -// ValidateCreate will do any extra validation when creating an AWSClusterControllerIdentity. -func (*awsClusterControllerIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSClusterControllerIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterControllerIdentity object but got %T", r) - } - - // Ensures AWSClusterControllerIdentity being singleton by only allowing "default" as name - if r.Name != AWSClusterControllerIdentityName { - return nil, field.Invalid(field.NewPath("name"), - r.Name, "AWSClusterControllerIdentity is a singleton and only acceptable name is default") - } - - // Validate selector parses as Selector if AllowedNameSpaces is populated - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selector"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// ValidateDelete allows you to add any extra validation when deleting an AWSClusterControllerIdentity. -func (*awsClusterControllerIdentityWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate will do any extra validation when updating an AWSClusterControllerIdentity. -func (*awsClusterControllerIdentityWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSClusterControllerIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterControllerIdentity object but got %T", r) - } - - oldP, ok := oldObj.(*AWSClusterControllerIdentity) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected an AWSClusterControllerIdentity but got a %T", oldObj)) - } - - if !cmp.Equal(r.Spec, oldP.Spec) { - return nil, errors.New("AWSClusterControllerIdentity is immutable") - } - - if r.Name != oldP.Name { - return nil, field.Invalid(field.NewPath("name"), - r.Name, "AWSClusterControllerIdentity is a singleton and only acceptable name is default") - } - - // Validate selector parses as Selector if AllowedNameSpaces is not nil - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selectors"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// Default will set default values for the AWSClusterControllerIdentity. -func (*awsClusterControllerIdentityWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSClusterControllerIdentity) - if !ok { - return fmt.Errorf("expected an AWSClusterControllerIdentity object but got %T", r) - } - - SetDefaults_Labels(&r.ObjectMeta) - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterroleidentity_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterroleidentity_webhook.go deleted file mode 100644 index 8528ba87f06f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterroleidentity_webhook.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// log is for logging in this package. -var _ = ctrl.Log.WithName("awsclusterroleidentity-resource") - -func (r *AWSClusterRoleIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsClusterRoleIdentityWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsclusterroleidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1beta2,name=validation.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsclusterroleidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1beta2,name=default.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsClusterRoleIdentityWebhook struct{} - -var ( - _ webhook.CustomValidator = &awsClusterRoleIdentityWebhook{} - _ webhook.CustomDefaulter = &awsClusterRoleIdentityWebhook{} -) - -// ValidateCreate will do any extra validation when creating an AWSClusterRoleIdentity. -func (*awsClusterRoleIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSClusterRoleIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterRoleIdentity object but got %T", r) - } - - if r.Spec.SourceIdentityRef == nil { - return nil, field.Invalid(field.NewPath("spec", "sourceIdentityRef"), - r.Spec.SourceIdentityRef, "field cannot be set to nil") - } - - // Validate selector parses as Selector - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selector"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// ValidateDelete allows you to add any extra validation when deleting an AWSClusterRoleIdentity. -func (*awsClusterRoleIdentityWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate will do any extra validation when updating an AWSClusterRoleIdentity. -func (*awsClusterRoleIdentityWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSClusterRoleIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterRoleIdentity object but got %T", r) - } - - oldP, ok := oldObj.(*AWSClusterRoleIdentity) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected an AWSClusterRoleIdentity but got a %T", oldObj)) - } - - // If a SourceIdentityRef is set, do not allow removal of it. - if oldP.Spec.SourceIdentityRef != nil && r.Spec.SourceIdentityRef == nil { - return nil, field.Invalid(field.NewPath("spec", "sourceIdentityRef"), - r.Spec.SourceIdentityRef, "field cannot be set to nil") - } - - // Validate selector parses as Selector - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selector"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// Default will set default values for the AWSClusterRoleIdentity. -func (*awsClusterRoleIdentityWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSClusterRoleIdentity) - if !ok { - return fmt.Errorf("expected an AWSClusterRoleIdentity object but got %T", r) - } - SetDefaults_Labels(&r.ObjectMeta) - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterstaticidentity_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterstaticidentity_webhook.go deleted file mode 100644 index 0d6bd89cf3da..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclusterstaticidentity_webhook.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// log is for logging in this package. -var _ = ctrl.Log.WithName("awsclusterstaticidentity-resource") - -func (r *AWSClusterStaticIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsClusterStaticIdentityWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsclusterstaticidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1beta2,name=validation.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsclusterstaticidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1beta2,name=default.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsClusterStaticIdentityWebhook struct{} - -var ( - _ webhook.CustomValidator = &awsClusterStaticIdentityWebhook{} - _ webhook.CustomDefaulter = &awsClusterStaticIdentityWebhook{} -) - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*awsClusterStaticIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSClusterStaticIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterStaticIdentity object but got %T", r) - } - - // Validate selector parses as Selector - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selector"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*awsClusterStaticIdentityWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*awsClusterStaticIdentityWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSClusterStaticIdentity) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterStaticIdentity object but got %T", r) - } - - oldP, ok := oldObj.(*AWSClusterStaticIdentity) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected an AWSClusterStaticIdentity but got a %T", oldObj)) - } - - if oldP.Spec.SecretRef != r.Spec.SecretRef { - return nil, field.Invalid(field.NewPath("spec", "secretRef"), - r.Spec.SecretRef, "field cannot be updated") - } - - // Validate selector parses as Selector - if r.Spec.AllowedNamespaces != nil { - _, err := metav1.LabelSelectorAsSelector(&r.Spec.AllowedNamespaces.Selector) - if err != nil { - return nil, field.Invalid(field.NewPath("spec", "allowedNamespaces", "selector"), r.Spec.AllowedNamespaces.Selector, err.Error()) - } - } - - return nil, nil -} - -// Default should return the default AWSClusterStaticIdentity. -func (*awsClusterStaticIdentityWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSClusterStaticIdentity) - if !ok { - return fmt.Errorf("expected an AWSClusterStaticIdentity object but got %T", r) - } - SetDefaults_Labels(&r.ObjectMeta) - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustertemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustertemplate_webhook.go deleted file mode 100644 index e81ea119c86d..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsclustertemplate_webhook.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/google/go-cmp/cmp" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -func (r *AWSClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsClusterTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1beta2,name=validation.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1beta2,name=default.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsClusterTemplateWebhook struct{} - -var _ webhook.CustomDefaulter = &awsClusterTemplateWebhook{} -var _ webhook.CustomValidator = &awsClusterTemplateWebhook{} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (*awsClusterTemplateWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSClusterTemplate) - if !ok { - return fmt.Errorf("expected an AWSClusterTemplate object but got %T", r) - } - - SetObjectDefaults_AWSClusterTemplate(r) - return nil -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSClusterTemplate) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterTemplate object but got %T", r) - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.Spec.Template.Spec.Bastion.Validate()...) - allErrs = append(allErrs, validateSSHKeyName(r.Spec.Template.Spec.SSHKeyName)...) - - return nil, aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSClusterTemplate) - if !ok { - return nil, fmt.Errorf("expected an AWSClusterTemplate object but got %T", r) - } - - old := oldObj.(*AWSClusterTemplate) - - if !cmp.Equal(r.Spec, old.Spec) { - return nil, apierrors.NewBadRequest("AWSClusterTemplate.Spec is immutable") - } - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*awsClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_webhook.go deleted file mode 100644 index 9c271c69392f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_webhook.go +++ /dev/null @@ -1,493 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "encoding/base64" - "fmt" - "net" - "net/url" - "strings" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-aws/v2/feature" -) - -// log is for logging in this package. -var log = ctrl.Log.WithName("awsmachine-resource") - -func (r *AWSMachine) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsMachineWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1beta2,name=validation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsmachine,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1beta2,name=mawsmachine.kb.io,name=mutation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsMachineWebhook struct{} - -var ( - _ webhook.CustomValidator = &awsMachineWebhook{} - _ webhook.CustomDefaulter = &awsMachineWebhook{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*awsMachineWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSMachine) - if !ok { - return nil, fmt.Errorf("expected an AWSMachine object but got %T", r) - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateCloudInitSecret()...) - allErrs = append(allErrs, r.validateIgnitionAndCloudInit()...) - allErrs = append(allErrs, r.validateRootVolume()...) - allErrs = append(allErrs, r.validateNonRootVolumes()...) - allErrs = append(allErrs, r.validateSSHKeyName()...) - allErrs = append(allErrs, r.validateAdditionalSecurityGroups()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.validateNetworkElasticIPPool()...) - allErrs = append(allErrs, r.validateInstanceMarketType()...) - allErrs = append(allErrs, r.validateCapacityReservation()...) - allErrs = append(allErrs, r.validateHostAllocation()...) - - return nil, aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*awsMachineWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSMachine) - if !ok { - return nil, fmt.Errorf("expected an AWSMachine object but got %T", r) - } - - newAWSMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("AWSMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert new AWSMachine to unstructured object")), - }) - } - oldAWSMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(oldObj) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("AWSMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert old AWSMachine to unstructured object")), - }) - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateCloudInitSecret()...) - allErrs = append(allErrs, r.validateAdditionalSecurityGroups()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.validateHostAllocation()...) - - newAWSMachineSpec := newAWSMachine["spec"].(map[string]interface{}) - oldAWSMachineSpec := oldAWSMachine["spec"].(map[string]interface{}) - - // allow changes to providerID - delete(oldAWSMachineSpec, "providerID") - delete(newAWSMachineSpec, "providerID") - - // allow changes to instanceID - delete(oldAWSMachineSpec, "instanceID") - delete(newAWSMachineSpec, "instanceID") - - // allow changes to additionalTags - delete(oldAWSMachineSpec, "additionalTags") - delete(newAWSMachineSpec, "additionalTags") - - // allow changes to additionalSecurityGroups - delete(oldAWSMachineSpec, "additionalSecurityGroups") - delete(newAWSMachineSpec, "additionalSecurityGroups") - - // allow changes to secretPrefix, secretCount, and secureSecretsBackend - if cloudInit, ok := oldAWSMachineSpec["cloudInit"].(map[string]interface{}); ok { - delete(cloudInit, "secretPrefix") - delete(cloudInit, "secretCount") - delete(cloudInit, "secureSecretsBackend") - } - - if cloudInit, ok := newAWSMachineSpec["cloudInit"].(map[string]interface{}); ok { - delete(cloudInit, "secretPrefix") - delete(cloudInit, "secretCount") - delete(cloudInit, "secureSecretsBackend") - } - - // allow changes to enableResourceNameDNSAAAARecord and enableResourceNameDNSARecord - if privateDNSName, ok := oldAWSMachineSpec["privateDnsName"].(map[string]interface{}); ok { - delete(privateDNSName, "enableResourceNameDnsAAAARecord") - delete(privateDNSName, "enableResourceNameDnsARecord") - } - - if privateDNSName, ok := newAWSMachineSpec["privateDnsName"].(map[string]interface{}); ok { - delete(privateDNSName, "enableResourceNameDnsAAAARecord") - delete(privateDNSName, "enableResourceNameDnsARecord") - } - - if !cmp.Equal(oldAWSMachineSpec, newAWSMachineSpec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "cannot be modified")) - } - - return nil, aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -func (r *AWSMachine) validateCloudInitSecret() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.CloudInit.InsecureSkipSecretsManager { - if r.Spec.CloudInit.SecretPrefix != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretPrefix"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - if r.Spec.CloudInit.SecretCount != 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - if r.Spec.CloudInit.SecureSecretsBackend != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secureSecretsBackend"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - } - - if (r.Spec.CloudInit.SecretPrefix != "") != (r.Spec.CloudInit.SecretCount != 0) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "must be set together with spec.CloudInit.SecretPrefix")) - } - - return allErrs -} - -func (r *AWSMachine) cloudInitConfigured() bool { - configured := false - - configured = configured || r.Spec.CloudInit.SecretPrefix != "" - configured = configured || r.Spec.CloudInit.SecretCount != 0 - configured = configured || r.Spec.CloudInit.SecureSecretsBackend != "" - configured = configured || r.Spec.CloudInit.InsecureSkipSecretsManager - - return configured -} - -func (r *AWSMachine) ignitionEnabled() bool { - return r.Spec.Ignition != nil -} - -func (r *AWSMachine) validateIgnitionAndCloudInit() field.ErrorList { - var allErrs field.ErrorList - if !r.ignitionEnabled() { - return allErrs - } - - // Feature gate is not enabled but ignition is enabled then send a forbidden error. - if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition"), - "can be set only if the BootstrapFormatIgnition feature gate is enabled")) - } - - // If ignition is enabled, cloudInit should not be configured. - if r.cloudInitConfigured() { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit"), "cannot be set if spec.ignition is set")) - } - - // Proxy and TLS are only valid for Ignition versions >= 3.1. - if r.Spec.Ignition.Version == "2.3" || r.Spec.Ignition.Version == "3.0" { - if r.Spec.Ignition.Proxy != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition", "proxy"), "cannot be set if spec.ignition.version is 2.3 or 3.0")) - } - if r.Spec.Ignition.TLS != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition", "tls"), "cannot be set if spec.ignition.version is 2.3 or 3.0")) - } - } - - allErrs = append(allErrs, r.validateIgnitionProxy()...) - allErrs = append(allErrs, r.validateIgnitionTLS()...) - - return allErrs -} - -func (r *AWSMachine) validateIgnitionProxy() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.Ignition.Proxy == nil { - return allErrs - } - - // Validate HTTPProxy. - if r.Spec.Ignition.Proxy.HTTPProxy != nil { - // Parse the url to check if it is valid. - _, err := url.Parse(*r.Spec.Ignition.Proxy.HTTPProxy) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "httpProxy"), *r.Spec.Ignition.Proxy.HTTPProxy, "invalid URL")) - } - } - - // Validate HTTPSProxy. - if r.Spec.Ignition.Proxy.HTTPSProxy != nil { - // Parse the url to check if it is valid. - _, err := url.Parse(*r.Spec.Ignition.Proxy.HTTPSProxy) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "httpsProxy"), *r.Spec.Ignition.Proxy.HTTPSProxy, "invalid URL")) - } - } - - // Validate NoProxy. - for _, noProxy := range r.Spec.Ignition.Proxy.NoProxy { - noProxy := string(noProxy) - // Validate here that the value `noProxy` is: - // - A domain name - // - A domain name matches that name and all subdomains - // - A domain name with a leading . matches subdomains only - - // A special DNS label (*). - if noProxy == "*" { - continue - } - // An IP address prefix (1.2.3.4). - if ip := net.ParseIP(noProxy); ip != nil { - continue - } - // An IP address prefix in CIDR notation (1.2.3.4/8). - if _, _, err := net.ParseCIDR(noProxy); err == nil { - continue - } - // An IP or domain name with a port. - if _, _, err := net.SplitHostPort(noProxy); err == nil { - continue - } - // A domain name. - if noProxy[0] == '.' { - // If it starts with a dot, it should be a domain name. - noProxy = noProxy[1:] - } - // Validate that the value matches DNS 1123. - if errs := validation.IsDNS1123Subdomain(noProxy); len(errs) > 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "noProxy"), noProxy, fmt.Sprintf("invalid noProxy value, please refer to the field documentation: %s", strings.Join(errs, "; ")))) - } - } - - return allErrs -} - -func (r *AWSMachine) validateIgnitionTLS() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.Ignition.TLS == nil { - return allErrs - } - - for _, source := range r.Spec.Ignition.TLS.CASources { - // Validate that source is RFC 2397 data URL. - u, err := url.Parse(string(source)) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid URL")) - } - - switch u.Scheme { - case "http", "https", "tftp", "s3", "arn", "gs": - // Valid schemes. - case "data": - // Validate that the data URL is base64 encoded. - i := strings.Index(u.Opaque, ",") - if i < 0 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid data URL")) - } - // Validate that the data URL is base64 encoded. - if _, err := base64.StdEncoding.DecodeString(u.Opaque[i+1:]); err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid base64 encoding for data url")) - } - default: - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "unsupported URL scheme")) - } - } - - return allErrs -} - -func (r *AWSMachine) validateRootVolume() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.RootVolume == nil { - return allErrs - } - - if VolumeTypesProvisioned.Has(string(r.Spec.RootVolume.Type)) && r.Spec.RootVolume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.rootVolume.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if r.Spec.RootVolume.Throughput != nil { - if r.Spec.RootVolume.Type != VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.rootVolume.throughput"), "throughput is valid only for type 'gp3'")) - } - if *r.Spec.RootVolume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.rootVolume.throughput"), "throughput must be nonnegative")) - } - } - - if r.Spec.RootVolume.DeviceName != "" { - log.Info("root volume shouldn't have a device name (this can be ignored if performing a `clusterctl move`)") - } - - return allErrs -} - -func (r *AWSMachine) validateNetworkElasticIPPool() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.ElasticIPPool == nil { - return allErrs - } - if !ptr.Deref(r.Spec.PublicIP, false) { - allErrs = append(allErrs, field.Required(field.NewPath("spec.elasticIpPool"), "publicIp must be set to 'true' to assign custom public IPv4 pools with elasticIpPool")) - } - eipp := r.Spec.ElasticIPPool - if eipp.PublicIpv4Pool != nil { - if eipp.PublicIpv4PoolFallBackOrder == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec.elasticIpPool.publicIpv4PoolFallbackOrder"), r.Spec.ElasticIPPool, "publicIpv4PoolFallbackOrder must be set when publicIpv4Pool is defined.")) - } - awsPublicIpv4PoolPrefix := "ipv4pool-ec2-" - if !strings.HasPrefix(*eipp.PublicIpv4Pool, awsPublicIpv4PoolPrefix) { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec.elasticIpPool.publicIpv4Pool"), r.Spec.ElasticIPPool, fmt.Sprintf("publicIpv4Pool must start with %s.", awsPublicIpv4PoolPrefix))) - } - } else if eipp.PublicIpv4PoolFallBackOrder != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec.elasticIpPool.publicIpv4PoolFallbackOrder"), r.Spec.ElasticIPPool, "publicIpv4Pool must be set when publicIpv4PoolFallbackOrder is defined.")) - } - - return allErrs -} - -func (r *AWSMachine) validateCapacityReservation() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.CapacityReservationID != nil && r.Spec.CapacityReservationPreference != CapacityReservationPreferenceOnly && r.Spec.CapacityReservationPreference != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "capacityReservationPreference"), "when capacityReservationId is specified, capacityReservationPreference may only be 'CapacityReservationsOnly' or empty")) - } - if r.Spec.CapacityReservationPreference == CapacityReservationPreferenceOnly && r.Spec.MarketType == MarketTypeSpot { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "capacityReservationPreference"), "when marketType is set to 'Spot', capacityReservationPreference cannot be set to 'CapacityReservationsOnly'")) - } - if r.Spec.CapacityReservationPreference == CapacityReservationPreferenceOnly && r.Spec.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "capacityReservationPreference"), "when capacityReservationPreference is 'CapacityReservationsOnly', spotMarketOptions cannot be set (which implies marketType: 'Spot')")) - } - return allErrs -} - -func (r *AWSMachine) validateInstanceMarketType() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.MarketType == MarketTypeCapacityBlock && r.Spec.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "marketType"), "marketType set to CapacityBlock and spotMarketOptions cannot be used together")) - } - if r.Spec.MarketType == MarketTypeOnDemand && r.Spec.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "marketType"), "setting marketType to OnDemand and spotMarketOptions cannot be used together")) - } - if r.Spec.MarketType == MarketTypeCapacityBlock && r.Spec.CapacityReservationID == nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "capacityReservationID"), "is required when CapacityBlock is provided")) - } - return allErrs -} - -func (r *AWSMachine) validateNonRootVolumes() field.ErrorList { - var allErrs field.ErrorList - - for _, volume := range r.Spec.NonRootVolumes { - if VolumeTypesProvisioned.Has(string(volume.Type)) && volume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if volume.Throughput != nil { - if volume.Type != VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.throughput"), "throughput is valid only for type 'gp3'")) - } - if *volume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.throughput"), "throughput must be nonnegative")) - } - } - - if volume.DeviceName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.deviceName"), "non root volume should have device name")) - } - } - - return allErrs -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*awsMachineWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default implements webhook.Defaulter such that an empty CloudInit will be defined with a default -// SecureSecretsBackend as SecretBackendSecretsManager iff InsecureSkipSecretsManager is unset. -func (*awsMachineWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSMachine) - if !ok { - return fmt.Errorf("expected an AWSMachine object but got %T", r) - } - - if !r.Spec.CloudInit.InsecureSkipSecretsManager && r.Spec.CloudInit.SecureSecretsBackend == "" && !r.ignitionEnabled() { - r.Spec.CloudInit.SecureSecretsBackend = SecretBackendSecretsManager - } - - if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" { - r.Spec.Ignition.StorageType = DefaultIgnitionStorageType - } - // Defaults the version field if StorageType is not set to `UnencryptedUserData`. - // When using `UnencryptedUserData` the version field is ignored because the userdata defines its version itself. - if r.ignitionEnabled() && r.Spec.Ignition.Version == "" && r.Spec.Ignition.StorageType != IgnitionStorageTypeOptionUnencryptedUserData { - r.Spec.Ignition.Version = DefaultIgnitionVersion - } - - return nil -} - -func (r *AWSMachine) validateAdditionalSecurityGroups() field.ErrorList { - var allErrs field.ErrorList - - for _, additionalSecurityGroup := range r.Spec.AdditionalSecurityGroups { - if len(additionalSecurityGroup.Filters) > 0 && additionalSecurityGroup.ID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.additionalSecurityGroups"), "only one of ID or Filters may be specified, specifying both is forbidden")) - } - } - return allErrs -} - -func (r *AWSMachine) validateHostAllocation() field.ErrorList { - var allErrs field.ErrorList - - // Check if both hostID and dynamicHostAllocation are specified - hasHostID := r.Spec.HostID != nil && len(*r.Spec.HostID) > 0 - hasDynamicHostAllocation := r.Spec.DynamicHostAllocation != nil - - if hasHostID && hasDynamicHostAllocation { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.hostID"), "hostID and dynamicHostAllocation are mutually exclusive"), field.Forbidden(field.NewPath("spec.dynamicHostAllocation"), "hostID and dynamicHostAllocation are mutually exclusive")) - } - - return allErrs -} - -func (r *AWSMachine) validateSSHKeyName() field.ErrorList { - return validateSSHKeyName(r.Spec.SSHKeyName) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachinetemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachinetemplate_webhook.go deleted file mode 100644 index 7180939d5360..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachinetemplate_webhook.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/google/go-cmp/cmp" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-aws/v2/feature" - "sigs.k8s.io/cluster-api/util/topology" -) - -func (r *AWSMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(AWSMachineTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(&AWSMachineTemplate{}). - WithValidator(w). - Complete() -} - -// AWSMachineTemplateWebhook implements a custom validation webhook for AWSMachineTemplate. -// Note: we use a custom validator to access the request context for SSA of AWSMachineTemplate. -// +kubebuilder:object:generate=false -type AWSMachineTemplateWebhook struct{} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinetemplates,versions=v1beta2,name=validation.awsmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -var _ webhook.CustomValidator = &AWSMachineTemplateWebhook{} - -func (r *AWSMachineTemplate) validateRootVolume() field.ErrorList { - var allErrs field.ErrorList - - spec := r.Spec.Template.Spec - if spec.RootVolume == nil { - return allErrs - } - - if VolumeTypesProvisioned.Has(string(spec.RootVolume.Type)) && spec.RootVolume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.rootVolume.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if spec.RootVolume.Throughput != nil { - if spec.RootVolume.Type != VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.rootVolume.throughput"), "throughput is valid only for type 'gp3'")) - } - if *spec.RootVolume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.rootVolume.throughput"), "throughput must be nonnegative")) - } - } - - if spec.RootVolume.DeviceName != "" { - log.Info("root volume shouldn't have a device name (this can be ignored if performing a `clusterctl move`)") - } - - return allErrs -} - -func (r *AWSMachineTemplate) validateNonRootVolumes() field.ErrorList { - var allErrs field.ErrorList - - spec := r.Spec.Template.Spec - - for _, volume := range spec.NonRootVolumes { - if VolumeTypesProvisioned.Has(string(volume.Type)) && volume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if volume.Throughput != nil { - if volume.Type != VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.throughput"), "throughput is valid only for type 'gp3'")) - } - if *volume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.throughput"), "throughput must be nonnegative")) - } - } - - if volume.DeviceName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.deviceName"), "non root volume should have device name")) - } - } - - return allErrs -} - -func (r *AWSMachineTemplate) validateAdditionalSecurityGroups() field.ErrorList { - var allErrs field.ErrorList - - spec := r.Spec.Template.Spec - - for _, additionalSecurityGroup := range spec.AdditionalSecurityGroups { - if len(additionalSecurityGroup.Filters) > 0 && additionalSecurityGroup.ID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "additionalSecurityGroups"), "only one of ID or Filters may be specified, specifying both is forbidden")) - } - } - return allErrs -} - -func (r *AWSMachineTemplate) validateCloudInitSecret() field.ErrorList { - var allErrs field.ErrorList - - spec := r.Spec.Template.Spec - if spec.CloudInit.InsecureSkipSecretsManager { - if spec.CloudInit.SecretPrefix != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secretPrefix"), "cannot be set if spec.template.spec.cloudInit.insecureSkipSecretsManager is true")) - } - if spec.CloudInit.SecretCount != 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secretCount"), "cannot be set if spec.template.spec.cloudInit.insecureSkipSecretsManager is true")) - } - if spec.CloudInit.SecureSecretsBackend != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secureSecretsBackend"), "cannot be set if spec.template.spec.cloudInit.insecureSkipSecretsManager is true")) - } - } - - if (spec.CloudInit.SecretPrefix != "") != (spec.CloudInit.SecretCount != 0) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secretCount"), "must be set together with spec.template.spec.CloudInit.SecretPrefix")) - } - - return allErrs -} - -func (r *AWSMachineTemplate) cloudInitConfigured() bool { - spec := r.Spec.Template.Spec - configured := false - - configured = configured || spec.CloudInit.SecretPrefix != "" - configured = configured || spec.CloudInit.SecretCount != 0 - configured = configured || spec.CloudInit.SecureSecretsBackend != "" - configured = configured || spec.CloudInit.InsecureSkipSecretsManager - - return configured -} - -func (r *AWSMachineTemplate) ignitionEnabled() bool { - return r.Spec.Template.Spec.Ignition != nil -} - -func (r *AWSMachineTemplate) validateIgnitionAndCloudInit() field.ErrorList { - var allErrs field.ErrorList - - // Feature gate is not enabled but ignition is enabled then send a forbidden error. - if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) && r.ignitionEnabled() { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "ignition"), - "can be set only if the BootstrapFormatIgnition feature gate is enabled")) - } - - if r.ignitionEnabled() && r.cloudInitConfigured() { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit"), - "cannot be set if spec.template.spec.ignition is set")) - } - - return allErrs -} - -func (r *AWSMachineTemplate) validateHostAllocation() field.ErrorList { - var allErrs field.ErrorList - - spec := r.Spec.Template.Spec - - // Check if both hostID and dynamicHostAllocation are specified - hasHostID := spec.HostID != nil && len(*spec.HostID) > 0 - hasDynamicHostAllocation := spec.DynamicHostAllocation != nil - - if hasHostID && hasDynamicHostAllocation { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.template.spec.hostID"), "hostID and dynamicHostAllocation are mutually exclusive"), field.Forbidden(field.NewPath("spec.template.spec.dynamicHostAllocation"), "hostID and dynamicHostAllocation are mutually exclusive")) - } - - return allErrs -} - -func (r *AWSMachineTemplate) validateSSHKeyName() field.ErrorList { - return validateSSHKeyName(r.Spec.Template.Spec.SSHKeyName) -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (r *AWSMachineTemplateWebhook) ValidateCreate(_ context.Context, raw runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - obj, ok := raw.(*AWSMachineTemplate) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a AWSMachineTemplate but got a %T", raw)) - } - - spec := obj.Spec.Template.Spec - - if spec.CloudInit.SecretPrefix != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secretPrefix"), "cannot be set in templates")) - } - - if spec.CloudInit.SecretCount != 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "cannot be set in templates")) - } - - if spec.ProviderID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "providerID"), "cannot be set in templates")) - } - - allErrs = append(allErrs, obj.validateCloudInitSecret()...) - allErrs = append(allErrs, obj.validateIgnitionAndCloudInit()...) - allErrs = append(allErrs, obj.validateRootVolume()...) - allErrs = append(allErrs, obj.validateNonRootVolumes()...) - allErrs = append(allErrs, obj.validateSSHKeyName()...) - allErrs = append(allErrs, obj.validateAdditionalSecurityGroups()...) - allErrs = append(allErrs, obj.Spec.Template.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, obj.validateHostAllocation()...) - - return nil, aggregateObjErrors(obj.GroupVersionKind().GroupKind(), obj.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *AWSMachineTemplateWebhook) ValidateUpdate(ctx context.Context, oldRaw runtime.Object, newRaw runtime.Object) (admission.Warnings, error) { - newAWSMachineTemplate, ok := newRaw.(*AWSMachineTemplate) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a AWSMachineTemplate but got a %T", newRaw)) - } - oldAWSMachineTemplate, ok := oldRaw.(*AWSMachineTemplate) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a AWSMachineTemplate but got a %T", oldRaw)) - } - - req, err := admission.RequestFromContext(ctx) - if err != nil { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a admission.Request inside context: %v", err)) - } - - var allErrs field.ErrorList - - if !topology.IsDryRunRequest(req, newAWSMachineTemplate) && !cmp.Equal(newAWSMachineTemplate.Spec, oldAWSMachineTemplate.Spec) { - if oldAWSMachineTemplate.Spec.Template.Spec.InstanceMetadataOptions == nil { - oldAWSMachineTemplate.Spec.Template.Spec.InstanceMetadataOptions = newAWSMachineTemplate.Spec.Template.Spec.InstanceMetadataOptions - } - - if !cmp.Equal(newAWSMachineTemplate.Spec.Template.Spec, oldAWSMachineTemplate.Spec.Template.Spec) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "template", "spec"), newAWSMachineTemplate, "AWSMachineTemplate.Spec is immutable"), - ) - } - } - - return nil, aggregateObjErrors(newAWSMachineTemplate.GroupVersionKind().GroupKind(), newAWSMachineTemplate.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (r *AWSMachineTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedcluster_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedcluster_types.go deleted file mode 100644 index ce04e1866933..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedcluster_types.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// AWSManagedClusterSpec defines the desired state of AWSManagedCluster -type AWSManagedClusterSpec struct { - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` -} - -// AWSManagedClusterStatus defines the observed state of AWSManagedCluster -type AWSManagedClusterStatus struct { - // Ready is when the AWSManagedControlPlane has a API server URL. - // +optional - Ready bool `json:"ready,omitempty"` - - // FailureDomains specifies a list fo available availability zones that can be used - // +optional - FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` - - // Conditions defines current service state of the AWSManagedCluster. - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=awsmanagedclusters,scope=Namespaced,categories=cluster-api,shortName=awsmc -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSManagedControl belongs" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes" -// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1 - -// AWSManagedCluster is the Schema for the awsmanagedclusters API -type AWSManagedCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AWSManagedClusterSpec `json:"spec,omitempty"` - Status AWSManagedClusterStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// AWSManagedClusterList contains a list of AWSManagedCluster. -type AWSManagedClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSManagedCluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSManagedCluster{}, &AWSManagedClusterList{}) -} - -// GetConditions returns the observations of the operational state of the -// AWSManagedCluster resource. -func (r *AWSManagedCluster) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the AWSManagedCluster to -// the predescribed clusterv1beta1.Conditions. -func (r *AWSManagedCluster) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedclustertemplate_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedclustertemplate_types.go deleted file mode 100644 index 28ab2bea9e87..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedclustertemplate_types.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// AWSManagedClusterTemplateSpec defines the desired state of AWSManagedClusterTemplate. -type AWSManagedClusterTemplateSpec struct { - Template AWSManagedClusterTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=awsmanagedclustertemplates,scope=Namespaced,categories=cluster-api,shortName=awsmct -// +kubebuilder:storageversion - -// AWSManagedClusterTemplate is the Schema for the AWSManagedClusterTemplates API. -type AWSManagedClusterTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AWSManagedClusterTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// AWSManagedClusterTemplateList contains a list of AWSManagedClusterTemplates. -type AWSManagedClusterTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSManagedClusterTemplate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSManagedClusterTemplate{}, &AWSManagedClusterTemplateList{}) -} - -// AWSManagedClusterTemplateResource describes the data needed to create an AWSManagedCluster from a template. -type AWSManagedClusterTemplateResource struct { - Spec AWSManagedClusterSpec `json:"spec"` -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/conversion.go deleted file mode 100644 index aa1d61728663..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/conversion.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -// Hub marks AWSCluster as a conversion hub. -func (*AWSCluster) Hub() {} - -// Hub marks AWSClusterList as a conversion hub. -func (*AWSClusterList) Hub() {} - -// Hub marks AWSMachine as a conversion hub. -func (*AWSMachine) Hub() {} - -// Hub marks AWSMachineList as a conversion hub. -func (*AWSMachineList) Hub() {} - -// Hub marks AWSMachineTemplate as a conversion hub. -func (*AWSMachineTemplate) Hub() {} - -// Hub marks AWSMachineTemplateList as a conversion hub. -func (*AWSMachineTemplateList) Hub() {} - -// Hub marks AWSClusterStaticIdentity as a conversion hub. -func (*AWSClusterStaticIdentity) Hub() {} - -// Hub marks AWSClusterStaticIdentityList as a conversion hub. -func (*AWSClusterStaticIdentityList) Hub() {} - -// Hub marks AWSClusterRoleIdentity as a conversion hub. -func (*AWSClusterRoleIdentity) Hub() {} - -// Hub marks AWSClusterRoleIdentityList as a conversion hub. -func (*AWSClusterRoleIdentityList) Hub() {} - -// Hub marks AWSClusterControllerIdentity as a conversion hub. -func (*AWSClusterControllerIdentity) Hub() {} - -// Hub marks AWSClusterControllerIdentityList as a conversion hub. -func (*AWSClusterControllerIdentityList) Hub() {} - -// Hub marks AWSClusterTemplate as a conversion hub. -func (*AWSClusterTemplate) Hub() {} - -// Hub marks AWSClusterTemplateList as a conversion hub. -func (*AWSClusterTemplateList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/defaults.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/defaults.go index f10bb895c124..8ae799f7b6c3 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/defaults.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/defaults.go @@ -16,12 +16,6 @@ limitations under the License. package v1beta2 -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" -) - // SetDefaults_Bastion is used by defaulter-gen. func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck // Default to allow open access to the bastion host if no CIDR Blocks have been set @@ -80,13 +74,8 @@ func SetDefaults_AWSClusterSpec(s *AWSClusterSpec) { //nolint:golint,stylecheck } // SetDefaults_Labels is used to default cluster scope resources for clusterctl move. -func SetDefaults_Labels(obj *metav1.ObjectMeta) { //nolint:golint,stylecheck - // Defaults to set label if no labels have been set - if obj.Labels == nil { - obj.Labels = map[string]string{ - clusterv1.ClusterctlMoveHierarchyLabel: ""} - } -} +//nolint:golint,stylecheck +// Defaults to set label if no labels have been set // SetDefaults_AWSMachineSpec is used by defaulter-gen. func SetDefaults_AWSMachineSpec(obj *AWSMachineSpec) { //nolint:golint,stylecheck diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/network_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/network_types.go index 26e38bc934c4..82eb30dcd291 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/network_types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/network_types.go @@ -20,10 +20,6 @@ import ( "fmt" "sort" "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "k8s.io/utils/ptr" ) const ( @@ -667,31 +663,6 @@ func (s *SubnetSpec) IsEdgeWavelength() bool { } // SetZoneInfo updates the subnets with zone information. -func (s *SubnetSpec) SetZoneInfo(zones []types.AvailabilityZone) error { - zoneInfo := func(zoneName string) *types.AvailabilityZone { - for _, zone := range zones { - if aws.ToString(zone.ZoneName) == zoneName { - return &zone - } - } - return nil - } - - zone := zoneInfo(s.AvailabilityZone) - if zone == nil { - if len(s.AvailabilityZone) > 0 { - return fmt.Errorf("unable to update zone information for subnet '%v' and zone '%v'", s.ID, s.AvailabilityZone) - } - return fmt.Errorf("unable to update zone information for subnet '%v'", s.ID) - } - if zone.ZoneType != nil { - s.ZoneType = ptr.To(ZoneType(*zone.ZoneType)) - } - if zone.ParentZoneName != nil { - s.ParentZoneName = zone.ParentZoneName - } - return nil -} // Subnets is a slice of Subnet. // +listType=map @@ -826,14 +797,6 @@ func (s Subnets) GetUniqueZones() []string { } // SetZoneInfo updates the subnets with zone information. -func (s Subnets) SetZoneInfo(zones []types.AvailabilityZone) error { - for i := range s { - if err := s[i].SetZoneInfo(zones); err != nil { - return err - } - } - return nil -} // HasPublicSubnetWavelength returns true when there are subnets in Wavelength zone. func (s Subnets) HasPublicSubnetWavelength() bool { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/s3bucket.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/s3bucket.go index 777c0a4cfa27..9efef7baa3d3 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/s3bucket.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/s3bucket.go @@ -17,57 +17,14 @@ limitations under the License. package v1beta2 import ( - "fmt" "net" "k8s.io/apimachinery/pkg/util/validation/field" - - "sigs.k8s.io/cluster-api-provider-aws/v2/feature" ) // Validate validates S3Bucket fields. -func (b *S3Bucket) Validate() []*field.Error { - var errs field.ErrorList - - if b == nil { - return errs - } - - if b.Name == "" { - errs = append(errs, field.Required(field.NewPath("spec", "s3Bucket", "name"), "can't be empty")) - } - - // Feature gate is not enabled but ignition is enabled then send a forbidden error. - if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) { - errs = append(errs, field.Forbidden(field.NewPath("spec", "s3Bucket"), - "can be set only if the BootstrapFormatIgnition feature gate is enabled")) - } - if b.PresignedURLDuration == nil { - if b.ControlPlaneIAMInstanceProfile == "" { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", "controlPlaneIAMInstanceProfiles"), "can't be empty")) - } - - if len(b.NodesIAMInstanceProfiles) == 0 { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", "nodesIAMInstanceProfiles"), "can't be empty")) - } - - for i, iamInstanceProfile := range b.NodesIAMInstanceProfiles { - if iamInstanceProfile == "" { - errs = append(errs, - field.Required(field.NewPath("spec", "s3Bucket", fmt.Sprintf("nodesIAMInstanceProfiles[%d]", i)), "can't be empty")) - } - } - } - - if b.Name != "" { - errs = append(errs, validateS3BucketName(b.Name)...) - } - - return errs -} +// Feature gate is not enabled but ignition is enabled then send a forbidden error. // Validation rules taken from https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html. func validateS3BucketName(name string) []*field.Error { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go index 1293074cb56d..fd7211238824 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go @@ -1,13 +1,13 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -23,7 +23,7 @@ package v1beta2 import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" + runtime "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/cluster-api/api/core/v1beta1" ) @@ -972,200 +972,6 @@ func (in *AWSMachineTemplateStatus) DeepCopy() *AWSMachineTemplateStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedCluster) DeepCopyInto(out *AWSManagedCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedCluster. -func (in *AWSManagedCluster) DeepCopy() *AWSManagedCluster { - if in == nil { - return nil - } - out := new(AWSManagedCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedCluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterList) DeepCopyInto(out *AWSManagedClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSManagedCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterList. -func (in *AWSManagedClusterList) DeepCopy() *AWSManagedClusterList { - if in == nil { - return nil - } - out := new(AWSManagedClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterSpec) DeepCopyInto(out *AWSManagedClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterSpec. -func (in *AWSManagedClusterSpec) DeepCopy() *AWSManagedClusterSpec { - if in == nil { - return nil - } - out := new(AWSManagedClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterStatus) DeepCopyInto(out *AWSManagedClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(v1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterStatus. -func (in *AWSManagedClusterStatus) DeepCopy() *AWSManagedClusterStatus { - if in == nil { - return nil - } - out := new(AWSManagedClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterTemplate) DeepCopyInto(out *AWSManagedClusterTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplate. -func (in *AWSManagedClusterTemplate) DeepCopy() *AWSManagedClusterTemplate { - if in == nil { - return nil - } - out := new(AWSManagedClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedClusterTemplate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterTemplateList) DeepCopyInto(out *AWSManagedClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSManagedClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateList. -func (in *AWSManagedClusterTemplateList) DeepCopy() *AWSManagedClusterTemplateList { - if in == nil { - return nil - } - out := new(AWSManagedClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedClusterTemplateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterTemplateResource) DeepCopyInto(out *AWSManagedClusterTemplateResource) { - *out = *in - out.Spec = in.Spec -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateResource. -func (in *AWSManagedClusterTemplateResource) DeepCopy() *AWSManagedClusterTemplateResource { - if in == nil { - return nil - } - out := new(AWSManagedClusterTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedClusterTemplateSpec) DeepCopyInto(out *AWSManagedClusterTemplateSpec) { - *out = *in - out.Template = in.Template -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedClusterTemplateSpec. -func (in *AWSManagedClusterTemplateSpec) DeepCopy() *AWSManagedClusterTemplateSpec { - if in == nil { - return nil - } - out := new(AWSManagedClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSResourceReference) DeepCopyInto(out *AWSResourceReference) { *out = *in diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.defaults.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.defaults.go deleted file mode 100644 index 506e7e780575..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.defaults.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1beta2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&AWSCluster{}, func(obj interface{}) { SetObjectDefaults_AWSCluster(obj.(*AWSCluster)) }) - scheme.AddTypeDefaultingFunc(&AWSClusterTemplate{}, func(obj interface{}) { SetObjectDefaults_AWSClusterTemplate(obj.(*AWSClusterTemplate)) }) - scheme.AddTypeDefaultingFunc(&AWSMachine{}, func(obj interface{}) { SetObjectDefaults_AWSMachine(obj.(*AWSMachine)) }) - scheme.AddTypeDefaultingFunc(&AWSMachineTemplate{}, func(obj interface{}) { SetObjectDefaults_AWSMachineTemplate(obj.(*AWSMachineTemplate)) }) - return nil -} - -func SetObjectDefaults_AWSCluster(in *AWSCluster) { - SetDefaults_AWSClusterSpec(&in.Spec) - SetDefaults_NetworkSpec(&in.Spec.NetworkSpec) - SetDefaults_Bastion(&in.Spec.Bastion) -} - -func SetObjectDefaults_AWSClusterTemplate(in *AWSClusterTemplate) { - SetDefaults_AWSClusterSpec(&in.Spec.Template.Spec) - SetDefaults_NetworkSpec(&in.Spec.Template.Spec.NetworkSpec) - SetDefaults_Bastion(&in.Spec.Template.Spec.Bastion) -} - -func SetObjectDefaults_AWSMachine(in *AWSMachine) { - SetDefaults_AWSMachineSpec(&in.Spec) -} - -func SetObjectDefaults_AWSMachineTemplate(in *AWSMachineTemplate) { - SetDefaults_AWSMachineSpec(&in.Spec.Template.Spec) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/conditions_consts.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/conditions_consts.go deleted file mode 100644 index 4229bedb8152..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/conditions_consts.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" - -const ( - // ROSAControlPlaneReadyCondition condition reports on the successful reconciliation of ROSAControlPlane. - ROSAControlPlaneReadyCondition clusterv1beta1.ConditionType = "ROSAControlPlaneReady" - - // ROSAControlPlaneValidCondition condition reports whether ROSAControlPlane configuration is valid. - ROSAControlPlaneValidCondition clusterv1beta1.ConditionType = "ROSAControlPlaneValid" - - // ROSAControlPlaneUpgradingCondition condition reports whether ROSAControlPlane is upgrading or not. - ROSAControlPlaneUpgradingCondition clusterv1beta1.ConditionType = "ROSAControlPlaneUpgrading" - - // ExternalAuthConfiguredCondition condition reports whether external auth has beed correctly configured. - ExternalAuthConfiguredCondition clusterv1beta1.ConditionType = "ExternalAuthConfigured" - - // ROSARoleConfigReadyCondition condition reports whether the referenced RosaRoleConfig is ready. - ROSARoleConfigReadyCondition clusterv1beta1.ConditionType = "ROSARoleConfigReady" - - // ReconciliationFailedReason used to report reconciliation failures. - ReconciliationFailedReason = "ReconciliationFailed" - - // ROSAControlPlaneDeletionFailedReason used to report failures while deleting ROSAControlPlane. - ROSAControlPlaneDeletionFailedReason = "DeletionFailed" - - // ROSAControlPlaneInvalidConfigurationReason used to report invalid user input. - ROSAControlPlaneInvalidConfigurationReason = "InvalidConfiguration" - - // ROSARoleConfigNotReadyReason used to report when referenced RosaRoleConfig is not ready. - ROSARoleConfigNotReadyReason = "ROSARoleConfigNotReady" - - // ROSARoleConfigNotFoundReason used to report when referenced RosaRoleConfig is not found. - ROSARoleConfigNotFoundReason = "ROSARoleConfigNotFound" -) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/defaults.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/defaults.go deleted file mode 100644 index a2006137c1e6..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/defaults.go +++ /dev/null @@ -1,13 +0,0 @@ -package v1beta2 - -import "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - -// SetDefaults_RosaControlPlaneSpec is used by defaulter-gen. -func SetDefaults_RosaControlPlaneSpec(s *RosaControlPlaneSpec) { //nolint:golint,stylecheck - if s.IdentityRef == nil { - s.IdentityRef = &v1beta2.AWSIdentityReference{ - Kind: v1beta2.ControllerIdentityKind, - Name: v1beta2.AWSClusterControllerIdentityName, - } - } -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/external_auth_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/external_auth_types.go deleted file mode 100644 index 7bd16d4585fd..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/external_auth_types.go +++ /dev/null @@ -1,249 +0,0 @@ -package v1beta2 - -// ExternalAuthProvider is an external OIDC identity provider that can issue tokens for this cluster -type ExternalAuthProvider struct { - // Name of the OIDC provider - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required - // +required - Name string `json:"name"` - // Issuer describes attributes of the OIDC token issuer - // - // +kubebuilder:validation:Required - // +required - Issuer TokenIssuer `json:"issuer"` - - // OIDCClients contains configuration for the platform's clients that - // need to request tokens from the issuer - // - // +listType=map - // +listMapKey=componentNamespace - // +listMapKey=componentName - // +kubebuilder:validation:MaxItems=20 - // +optional - OIDCClients []OIDCClientConfig `json:"oidcClients,omitempty"` - - // ClaimMappings describes rules on how to transform information from an - // ID token into a cluster identity - // +optional - ClaimMappings *TokenClaimMappings `json:"claimMappings,omitempty"` - - // ClaimValidationRules are rules that are applied to validate token claims to authenticate users. - // - // +listType=atomic - ClaimValidationRules []TokenClaimValidationRule `json:"claimValidationRules,omitempty"` -} - -// TokenAudience is the audience that the token was issued for. -// -// +kubebuilder:validation:MinLength=1 -type TokenAudience string - -// TokenIssuer describes attributes of the OIDC token issuer -type TokenIssuer struct { - // URL is the serving URL of the token issuer. - // Must use the https:// scheme. - // - // +kubebuilder:validation:Pattern=`^https:\/\/[^\s]` - // +kubebuilder:validation:Required - // +required - URL string `json:"issuerURL"` - - // Audiences is an array of audiences that the token was issued for. - // Valid tokens must include at least one of these values in their - // "aud" claim. - // Must be set to exactly one value. - // - // +listType=set - // +kubebuilder:validation:Required - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=10 - // +required - Audiences []TokenAudience `json:"audiences"` - - // CertificateAuthority is a reference to a config map in the - // configuration namespace. The .data of the configMap must contain - // the "ca-bundle.crt" key. - // If unset, system trust is used instead. - CertificateAuthority *LocalObjectReference `json:"issuerCertificateAuthority,omitempty"` -} - -// OIDCClientConfig contains configuration for the platform's client that -// need to request tokens from the issuer. -type OIDCClientConfig struct { - // ComponentName is the name of the component that is supposed to consume this - // client configuration - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=256 - // +kubebuilder:validation:Required - // +required - ComponentName string `json:"componentName"` - - // ComponentNamespace is the namespace of the component that is supposed to consume this - // client configuration - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=63 - // +kubebuilder:validation:Required - // +required - ComponentNamespace string `json:"componentNamespace"` - - // ClientID is the identifier of the OIDC client from the OIDC provider - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required - // +required - ClientID string `json:"clientID"` - - // ClientSecret refers to a secret that - // contains the client secret in the `clientSecret` key of the `.data` field - ClientSecret LocalObjectReference `json:"clientSecret"` - - // ExtraScopes is an optional set of scopes to request tokens with. - // - // +listType=set - // +optional - ExtraScopes []string `json:"extraScopes,omitempty"` -} - -// TokenClaimMappings describes rules on how to transform information from an -// ID token into a cluster identity. -type TokenClaimMappings struct { - // Username is a name of the claim that should be used to construct - // usernames for the cluster identity. - // - // Default value: "sub" - // +optional - Username *UsernameClaimMapping `json:"username,omitempty"` - - // Groups is a name of the claim that should be used to construct - // groups for the cluster identity. - // The referenced claim must use array of strings values. - // +optional - Groups *PrefixedClaimMapping `json:"groups,omitempty"` -} - -// PrefixedClaimMapping defines claims with a prefix. -type PrefixedClaimMapping struct { - // Claim is a JWT token claim to be used in the mapping - // - // +kubebuilder:validation:Required - // +required - Claim string `json:"claim"` - - // Prefix is a string to prefix the value from the token in the result of the - // claim mapping. - // - // By default, no prefixing occurs. - // - // Example: if `prefix` is set to "myoidc:"" and the `claim` in JWT contains - // an array of strings "a", "b" and "c", the mapping will result in an - // array of string "myoidc:a", "myoidc:b" and "myoidc:c". - Prefix string `json:"prefix,omitempty"` -} - -// UsernameClaimMapping defines the claim that should be used to construct usernames for the cluster identity. -// -// +kubebuilder:validation:XValidation:rule="self.prefixPolicy == 'Prefix' ? has(self.prefix) : !has(self.prefix)",message="prefix must be set if prefixPolicy is 'Prefix', but must remain unset otherwise" -type UsernameClaimMapping struct { - // Claim is a JWT token claim to be used in the mapping - // - // +kubebuilder:validation:Required - // +required - Claim string `json:"claim"` - - // PrefixPolicy specifies how a prefix should apply. - // - // By default, claims other than `email` will be prefixed with the issuer URL to - // prevent naming clashes with other plugins. - // - // Set to "NoPrefix" to disable prefixing. - // - // Example: - // (1) `prefix` is set to "myoidc:" and `claim` is set to "username". - // If the JWT claim `username` contains value `userA`, the resulting - // mapped value will be "myoidc:userA". - // (2) `prefix` is set to "myoidc:" and `claim` is set to "email". If the - // JWT `email` claim contains value "userA@myoidc.tld", the resulting - // mapped value will be "myoidc:userA@myoidc.tld". - // (3) `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`, - // the JWT claims include "username":"userA" and "email":"userA@myoidc.tld", - // and `claim` is set to: - // (a) "username": the mapped value will be "https://myoidc.tld#userA" - // (b) "email": the mapped value will be "userA@myoidc.tld" - // - // +kubebuilder:validation:Enum={"", "NoPrefix", "Prefix"} - // +optional - PrefixPolicy UsernamePrefixPolicy `json:"prefixPolicy,omitempty"` - - // Prefix is prepended to claim to prevent clashes with existing names. - // - // +kubebuilder:validation:MinLength=1 - // +optional - Prefix *string `json:"prefix,omitempty"` -} - -// UsernamePrefixPolicy specifies how a prefix should apply. -type UsernamePrefixPolicy string - -const ( - // NoOpinion let's the cluster assign prefixes. If the username claim is email, there is no prefix - // If the username claim is anything else, it is prefixed by the issuerURL - NoOpinion UsernamePrefixPolicy = "" - - // NoPrefix means the username claim value will not have any prefix - NoPrefix UsernamePrefixPolicy = "NoPrefix" - - // Prefix means the prefix value must be specified. It cannot be empty - Prefix UsernamePrefixPolicy = "Prefix" -) - -// TokenValidationRuleType defines the type of the validation rule. -type TokenValidationRuleType string - -const ( - // TokenValidationRuleTypeRequiredClaim defines the type for RequiredClaim. - TokenValidationRuleTypeRequiredClaim TokenValidationRuleType = "RequiredClaim" -) - -// TokenClaimValidationRule validates token claims to authenticate users. -type TokenClaimValidationRule struct { - // Type sets the type of the validation rule - // - // +kubebuilder:validation:Enum={"RequiredClaim"} - // +kubebuilder:default="RequiredClaim" - Type TokenValidationRuleType `json:"type"` - - // RequiredClaim allows configuring a required claim name and its expected value - // +kubebuilder:validation:Required - RequiredClaim TokenRequiredClaim `json:"requiredClaim"` -} - -// TokenRequiredClaim allows configuring a required claim name and its expected value. -type TokenRequiredClaim struct { - // Claim is a name of a required claim. Only claims with string values are - // supported. - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required - // +required - Claim string `json:"claim"` - - // RequiredValue is the required value for the claim. - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:Required - // +required - RequiredValue string `json:"requiredValue"` -} - -// LocalObjectReference references an object in the same namespace. -type LocalObjectReference struct { - // Name is the metadata.name of the referenced object. - // - // +kubebuilder:validation:Required - // +required - Name string `json:"name"` -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go deleted file mode 100644 index 4be22a8decf8..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_types.go +++ /dev/null @@ -1,864 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// RosaEndpointAccessType specifies the publishing scope of cluster endpoints. -type RosaEndpointAccessType string - -const ( - // Public endpoint access allows public API server access and - // private node communication with the control plane. - Public RosaEndpointAccessType = "Public" - - // Private endpoint access allows only private API server access and private - // node communication with the control plane. - Private RosaEndpointAccessType = "Private" -) - -// VersionGateAckType specifies the version gate acknowledgment. -type VersionGateAckType string - -const ( - // Acknowledge if acknowledgment is required and proceed with the upgrade. - Acknowledge VersionGateAckType = "Acknowledge" - - // WaitForAcknowledge if acknowledgment is required, wait not to proceed with the upgrade. - WaitForAcknowledge VersionGateAckType = "WaitForAcknowledge" - - // AlwaysAcknowledge always acknowledg if required and proceed with the upgrade. - AlwaysAcknowledge VersionGateAckType = "AlwaysAcknowledge" -) - -// ChannelGroupType specifies the OpenShift version channel group. -type ChannelGroupType string - -const ( - // Stable channel group is the default channel group for stable releases. - Stable ChannelGroupType = "stable" - - // Eus channel group is for eus channel releases. - Eus ChannelGroupType = "eus" - - // Fast channel group is for fast channel releases. - Fast ChannelGroupType = "fast" - - // Candidate channel group is for testing candidate builds. - Candidate ChannelGroupType = "candidate" - - // Nightly channel group is for testing nigtly builds. - Nightly ChannelGroupType = "nightly" -) - -// AutoNodeMode specifies the AutoNode mode for the ROSA Control Plane. -type AutoNodeMode string - -const ( - // AutoNodeModeEnabled enable AutoNode - AutoNodeModeEnabled AutoNodeMode = "Enabled" - - // AutoNodeModeDisabled Disabled AutoNode - AutoNodeModeDisabled AutoNodeMode = "Disabled" -) - -// RosaControlPlaneSpec defines the desired state of ROSAControlPlane. -type RosaControlPlaneSpec struct { //nolint: maligned - // Cluster name must be valid DNS-1035 label, so it must consist of lower case alphanumeric - // characters or '-', start with an alphabetic character, end with an alphanumeric character - // and have a max length of 54 characters. - // - // +immutable - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="rosaClusterName is immutable" - // +kubebuilder:validation:MaxLength:=54 - // +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$` - RosaClusterName string `json:"rosaClusterName"` - - // DomainPrefix is an optional prefix added to the cluster's domain name. It will be used - // when generating a sub-domain for the cluster on openshiftapps domain. It must be valid DNS-1035 label - // consisting of lower case alphanumeric characters or '-', start with an alphabetic character - // end with an alphanumeric character and have a max length of 15 characters. - // - // +immutable - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="domainPrefix is immutable" - // +kubebuilder:validation:MaxLength:=15 - // +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$` - // +optional - DomainPrefix string `json:"domainPrefix,omitempty"` - - // The Subnet IDs to use when installing the cluster. - // SubnetIDs should come in pairs; two per availability zone, one private and one public. - // +optional - Subnets []string `json:"subnets,omitempty"` - - // AvailabilityZones describe AWS AvailabilityZones of the worker nodes. - // should match the AvailabilityZones of the provided Subnets. - // a machinepool will be created for each availabilityZone. - // +optional - AvailabilityZones []string `json:"availabilityZones,omitempty"` - - // The AWS Region the cluster lives in. - Region string `json:"region"` - - // OpenShift semantic version, for example "4.14.5". - Version string `json:"version"` - - // OpenShift version channel group, default is stable. - // - // +kubebuilder:validation:Enum=stable;eus;fast;candidate;nightly - // +kubebuilder:default=stable - ChannelGroup ChannelGroupType `json:"channelGroup"` - - // VersionGate requires acknowledgment when upgrading ROSA-HCP y-stream versions (e.g., from 4.15 to 4.16). - // Default is WaitForAcknowledge. - // WaitForAcknowledge: If acknowledgment is required, the upgrade will not proceed until VersionGate is set to Acknowledge or AlwaysAcknowledge. - // Acknowledge: If acknowledgment is required, apply it for the upgrade. After upgrade is done set the version gate to WaitForAcknowledge. - // AlwaysAcknowledge: If acknowledgment is required, apply it and proceed with the upgrade. - // - // +kubebuilder:validation:Enum=Acknowledge;WaitForAcknowledge;AlwaysAcknowledge - // +kubebuilder:default=WaitForAcknowledge - VersionGate VersionGateAckType `json:"versionGate"` - - // RosaRoleConfigRef is a reference to a RosaRoleConfig resource that contains account roles, operator roles and OIDC configuration. - // RosaRoleConfigRef and role fields such as installerRoleARN, supportRoleARN, workerRoleARN, rolesRef and oidcID are mutually exclusive. - // - // +optional - RosaRoleConfigRef *corev1.LocalObjectReference `json:"rosaRoleConfigRef,omitempty"` - - // AWS IAM roles used to perform credential requests by the openshift operators. - // Required if RosaRoleConfigRef is not specified. - // +optional - RolesRef AWSRolesRef `json:"rolesRef,omitempty"` - - // The ID of the internal OpenID Connect Provider. - // Required if RosaRoleConfigRef is not specified. - // - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="oidcID is immutable" - // +optional - OIDCID string `json:"oidcID,omitempty"` - - // EnableExternalAuthProviders enables external authentication configuration for the cluster. - // - // +kubebuilder:default=false - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="enableExternalAuthProviders is immutable" - // +optional - EnableExternalAuthProviders bool `json:"enableExternalAuthProviders,omitempty"` - - // ExternalAuthProviders are external OIDC identity providers that can issue tokens for this cluster. - // Can only be set if "enableExternalAuthProviders" is set to "True". - // - // At most one provider can be configured. - // - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=1 - ExternalAuthProviders []ExternalAuthProvider `json:"externalAuthProviders,omitempty"` - - // InstallerRoleARN is an AWS IAM role that OpenShift Cluster Manager will assume to create the cluster. - // Required if RosaRoleConfigRef is not specified. - // +optional - InstallerRoleARN string `json:"installerRoleARN,omitempty"` - // SupportRoleARN is an AWS IAM role used by Red Hat SREs to enable - // access to the cluster account in order to provide support. - // Required if RosaRoleConfigRef is not specified. - // +optional - SupportRoleARN string `json:"supportRoleARN,omitempty"` - // WorkerRoleARN is an AWS IAM role that will be attached to worker instances. - // Required if RosaRoleConfigRef is not specified. - // +optional - WorkerRoleARN string `json:"workerRoleARN,omitempty"` - - // BillingAccount is an optional AWS account to use for billing the subscription fees for ROSA HCP clusters. - // The cost of running each ROSA HCP cluster will be billed to the infrastructure account in which the cluster - // is running. - // - // +kubebuilder:validation:Optional - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="billingAccount is immutable" - // +kubebuilder:validation:XValidation:rule="self.matches('^[0-9]{12}$')", message="billingAccount must be a valid AWS account ID" - // +immutable - // +optional - BillingAccount string `json:"billingAccount,omitempty"` - - // DefaultMachinePoolSpec defines the configuration for the default machinepool(s) provisioned as part of the cluster creation. - // One MachinePool will be created with this configuration per AvailabilityZone. Those default machinepools are required for openshift cluster operators - // to work properly. - // As these machinepool not created using ROSAMachinePool CR, they will not be visible/managed by ROSA CAPI provider. - // `rosa list machinepools -c ` can be used to view those machinepools. - // - // This field will be removed in the future once the current limitation is resolved. - // - // +optional - DefaultMachinePoolSpec DefaultMachinePoolSpec `json:"defaultMachinePoolSpec,omitempty"` - - // Network config for the ROSA HCP cluster. - // +optional - Network *NetworkSpec `json:"network,omitempty"` - - // EndpointAccess specifies the publishing scope of cluster endpoints. The - // default is Public. - // - // +kubebuilder:validation:Enum=Public;Private - // +kubebuilder:default=Public - // +optional - EndpointAccess RosaEndpointAccessType `json:"endpointAccess,omitempty"` - - // AdditionalTags are user-defined tags to be added on the AWS resources associated with the control plane. - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // EtcdEncryptionKMSARN is the ARN of the KMS key used to encrypt etcd. The key itself needs to be - // created out-of-band by the user and tagged with `red-hat:true`. - // +optional - EtcdEncryptionKMSARN string `json:"etcdEncryptionKMSARN,omitempty"` - - // AuditLogRoleARN defines the role that is used to forward audit logs to AWS CloudWatch. - // If not set, audit log forwarding is disabled. - // +optional - AuditLogRoleARN string `json:"auditLogRoleARN,omitempty"` - - // ProvisionShardID defines the shard where ROSA hosted control plane components will be hosted. - // - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="provisionShardID is immutable" - // +optional - ProvisionShardID string `json:"provisionShardID,omitempty"` - - // CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API. - // The secret should contain the following data keys: - // - ocmToken: eyJhbGciOiJIUzI1NiIsI.... - // - ocmApiUrl: Optional, defaults to 'https://api.openshift.com' - // +optional - CredentialsSecretRef *corev1.LocalObjectReference `json:"credentialsSecretRef,omitempty"` - - // IdentityRef is a reference to an identity to be used when reconciling the managed control plane. - // If no identity is specified, the default identity for this controller will be used. - // - // +optional - IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` - - // ClusterRegistryConfig represents registry config used with the cluster. - // +optional - ClusterRegistryConfig *RegistryConfig `json:"clusterRegistryConfig,omitempty"` - - // autoNode set the autoNode mode and roleARN. - // +optional - AutoNode *AutoNode `json:"autoNode,omitempty"` - - // ROSANetworkRef references ROSANetwork custom resource that contains the networking infrastructure - // for the ROSA HCP cluster. - // +optional - ROSANetworkRef *corev1.LocalObjectReference `json:"rosaNetworkRef,omitempty"` -} - -// AutoNode set the AutoNode mode and AutoNode role ARN. -type AutoNode struct { - // mode specifies the mode for the AutoNode. Setting Enable/Disable mode will allows/disallow karpenter AutoNode scaling. - // +kubebuilder:validation:Enum=Enabled;Disabled - // +kubebuilder:default=Disabled - // +optional - Mode AutoNodeMode `json:"mode,omitempty"` - - // roleARN sets the autoNode role ARN, which includes the IAM policy and cluster-specific role that grant the necessary permissions to the Karpenter controller. - // The role must be attached with the same OIDC-ID that is used with the ROSA-HCP cluster. - // +kubebuilder:validation:MaxLength:=2048 - // +optional - RoleARN string `json:"roleARN,omitempty"` -} - -// RegistryConfig for ROSA-HCP cluster -type RegistryConfig struct { - // AdditionalTrustedCAs containing the registry hostname as the key, and the PEM-encoded certificate as the value, - // for each additional registry CA to trust. - // +optional - AdditionalTrustedCAs map[string]string `json:"additionalTrustedCAs,omitempty"` - - // AllowedRegistriesForImport limits the container image registries that normal users may import - // images from. Set this list to the registries that you trust to contain valid Docker - // images and that you want applications to be able to import from. - // +optional - AllowedRegistriesForImport []RegistryLocation `json:"allowedRegistriesForImport,omitempty"` - - // RegistrySources contains configuration that determines how the container runtime - // should treat individual registries when accessing images. It does not contain configuration - // for the internal cluster registry. AllowedRegistries, BlockedRegistries are mutually exclusive. - // +optional - RegistrySources *RegistrySources `json:"registrySources,omitempty"` -} - -// RegistryLocation contains a location of the registry specified by the registry domain name. -type RegistryLocation struct { - // domainName specifies a domain name for the registry. The domain name might include wildcards, like '*' or '??'. - // In case the registry use non-standard (80 or 443) port, the port should be included in the domain name as well. - // +optional - DomainName string `json:"domainName,omitempty"` - - // insecure indicates whether the registry is secure (https) or insecure (http), default is secured. - // +kubebuilder:default=false - // +optional - Insecure bool `json:"insecure,omitempty"` -} - -// RegistrySources contains registries configuration. -type RegistrySources struct { - // AllowedRegistries are the registries for which image pull and push actions are allowed. - // To specify all subdomains, add the asterisk (*) wildcard character as a prefix to the domain name, - // For example, *.example.com. - // You can specify an individual repository within a registry, For example: reg1.io/myrepo/myapp:latest. - // All other registries are blocked. - // +optional - AllowedRegistries []string `json:"allowedRegistries,omitempty"` - - // BlockedRegistries are the registries for which image pull and push actions are denied. - // To specify all subdomains, add the asterisk (*) wildcard character as a prefix to the domain name, - // For example, *.example.com. - // You can specify an individual repository within a registry, For example: reg1.io/myrepo/myapp:latest. - // All other registries are allowed. - // +optional - BlockedRegistries []string `json:"blockedRegistries,omitempty"` - - // InsecureRegistries are registries which do not have a valid TLS certificate or only support HTTP connections. - // To specify all subdomains, add the asterisk (*) wildcard character as a prefix to the domain name, - // For example, *.example.com. - // You can specify an individual repository within a registry, For example: reg1.io/myrepo/myapp:latest. - // +optional - InsecureRegistries []string `json:"insecureRegistries,omitempty"` -} - -// NetworkSpec for ROSA-HCP. -type NetworkSpec struct { - // IP addresses block used by OpenShift while installing the cluster, for example "10.0.0.0/16". - // +kubebuilder:validation:Format=cidr - // +optional - MachineCIDR string `json:"machineCIDR,omitempty"` - - // IP address block from which to assign pod IP addresses, for example `10.128.0.0/14`. - // +kubebuilder:validation:Format=cidr - // +optional - PodCIDR string `json:"podCIDR,omitempty"` - - // IP address block from which to assign service IP addresses, for example `172.30.0.0/16`. - // +kubebuilder:validation:Format=cidr - // +optional - ServiceCIDR string `json:"serviceCIDR,omitempty"` - - // Network host prefix which is defaulted to `23` if not specified. - // +kubebuilder:default=23 - // +optional - HostPrefix int `json:"hostPrefix,omitempty"` - - // The CNI network type default is OVNKubernetes. - // +kubebuilder:validation:Enum=OVNKubernetes;Other - // +kubebuilder:default=OVNKubernetes - // +optional - NetworkType string `json:"networkType,omitempty"` -} - -// DefaultMachinePoolSpec defines the configuration for the required worker nodes provisioned as part of the cluster creation. -type DefaultMachinePoolSpec struct { - // The instance type to use, for example `r5.xlarge`. Instance type ref; https://aws.amazon.com/ec2/instance-types/ - // +optional - InstanceType string `json:"instanceType,omitempty"` - - // Autoscaling specifies auto scaling behaviour for the default MachinePool. Autoscaling min/max value - // must be equal or multiple of the availability zones count. - // +optional - Autoscaling *AutoScaling `json:"autoscaling,omitempty"` - - // VolumeSize set the disk volume size for the default workers machine pool in Gib. The default is 300 GiB. - // +kubebuilder:validation:Minimum=75 - // +kubebuilder:validation:Maximum=16384 - // +immutable - // +optional - VolumeSize int `json:"volumeSize,omitempty"` -} - -// AutoScaling specifies scaling options. -type AutoScaling struct { - // +kubebuilder:validation:Minimum=1 - MinReplicas int `json:"minReplicas,omitempty"` - // +kubebuilder:validation:Minimum=1 - MaxReplicas int `json:"maxReplicas,omitempty"` -} - -// AWSRolesRef contains references to various AWS IAM roles required for operators to make calls against the AWS API. -type AWSRolesRef struct { - // The referenced role must have a trust relationship that allows it to be assumed via web identity. - // https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html. - // Example: - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Principal": { - // "Federated": "{{ .ProviderARN }}" - // }, - // "Action": "sts:AssumeRoleWithWebIdentity", - // "Condition": { - // "StringEquals": { - // "{{ .ProviderName }}:sub": {{ .ServiceAccounts }} - // } - // } - // } - // ] - // } - // - // IngressARN is an ARN value referencing a role appropriate for the Ingress Operator. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Action": [ - // "elasticloadbalancing:DescribeLoadBalancers", - // "tag:GetResources", - // "route53:ListHostedZones" - // ], - // "Resource": "*" - // }, - // { - // "Effect": "Allow", - // "Action": [ - // "route53:ChangeResourceRecordSets" - // ], - // "Resource": [ - // "arn:aws:route53:::PUBLIC_ZONE_ID", - // "arn:aws:route53:::PRIVATE_ZONE_ID" - // ] - // } - // ] - // } - IngressARN string `json:"ingressARN"` - - // ImageRegistryARN is an ARN value referencing a role appropriate for the Image Registry Operator. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Action": [ - // "s3:CreateBucket", - // "s3:DeleteBucket", - // "s3:PutBucketTagging", - // "s3:GetBucketTagging", - // "s3:PutBucketPublicAccessBlock", - // "s3:GetBucketPublicAccessBlock", - // "s3:PutEncryptionConfiguration", - // "s3:GetEncryptionConfiguration", - // "s3:PutLifecycleConfiguration", - // "s3:GetLifecycleConfiguration", - // "s3:GetBucketLocation", - // "s3:ListBucket", - // "s3:GetObject", - // "s3:PutObject", - // "s3:DeleteObject", - // "s3:ListBucketMultipartUploads", - // "s3:AbortMultipartUpload", - // "s3:ListMultipartUploadParts" - // ], - // "Resource": "*" - // } - // ] - // } - ImageRegistryARN string `json:"imageRegistryARN"` - - // StorageARN is an ARN value referencing a role appropriate for the Storage Operator. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Action": [ - // "ec2:AttachVolume", - // "ec2:CreateSnapshot", - // "ec2:CreateTags", - // "ec2:CreateVolume", - // "ec2:DeleteSnapshot", - // "ec2:DeleteTags", - // "ec2:DeleteVolume", - // "ec2:DescribeInstances", - // "ec2:DescribeSnapshots", - // "ec2:DescribeTags", - // "ec2:DescribeVolumes", - // "ec2:DescribeVolumesModifications", - // "ec2:DetachVolume", - // "ec2:ModifyVolume" - // ], - // "Resource": "*" - // } - // ] - // } - StorageARN string `json:"storageARN"` - - // NetworkARN is an ARN value referencing a role appropriate for the Network Operator. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Action": [ - // "ec2:DescribeInstances", - // "ec2:DescribeInstanceStatus", - // "ec2:DescribeInstanceTypes", - // "ec2:UnassignPrivateIpAddresses", - // "ec2:AssignPrivateIpAddresses", - // "ec2:UnassignIpv6Addresses", - // "ec2:AssignIpv6Addresses", - // "ec2:DescribeSubnets", - // "ec2:DescribeNetworkInterfaces" - // ], - // "Resource": "*" - // } - // ] - // } - NetworkARN string `json:"networkARN"` - - // KubeCloudControllerARN is an ARN value referencing a role appropriate for the KCM/KCC. - // Source: https://cloud-provider-aws.sigs.k8s.io/prerequisites/#iam-policies - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Action": [ - // "autoscaling:DescribeAutoScalingGroups", - // "autoscaling:DescribeLaunchConfigurations", - // "autoscaling:DescribeTags", - // "ec2:DescribeAvailabilityZones", - // "ec2:DescribeInstances", - // "ec2:DescribeImages", - // "ec2:DescribeRegions", - // "ec2:DescribeRouteTables", - // "ec2:DescribeSecurityGroups", - // "ec2:DescribeSubnets", - // "ec2:DescribeVolumes", - // "ec2:CreateSecurityGroup", - // "ec2:CreateTags", - // "ec2:CreateVolume", - // "ec2:ModifyInstanceAttribute", - // "ec2:ModifyVolume", - // "ec2:AttachVolume", - // "ec2:AuthorizeSecurityGroupIngress", - // "ec2:CreateRoute", - // "ec2:DeleteRoute", - // "ec2:DeleteSecurityGroup", - // "ec2:DeleteVolume", - // "ec2:DetachVolume", - // "ec2:RevokeSecurityGroupIngress", - // "ec2:DescribeVpcs", - // "elasticloadbalancing:AddTags", - // "elasticloadbalancing:AttachLoadBalancerToSubnets", - // "elasticloadbalancing:ApplySecurityGroupsToLoadBalancer", - // "elasticloadbalancing:CreateLoadBalancer", - // "elasticloadbalancing:CreateLoadBalancerPolicy", - // "elasticloadbalancing:CreateLoadBalancerListeners", - // "elasticloadbalancing:ConfigureHealthCheck", - // "elasticloadbalancing:DeleteLoadBalancer", - // "elasticloadbalancing:DeleteLoadBalancerListeners", - // "elasticloadbalancing:DescribeLoadBalancers", - // "elasticloadbalancing:DescribeLoadBalancerAttributes", - // "elasticloadbalancing:DetachLoadBalancerFromSubnets", - // "elasticloadbalancing:DeregisterInstancesFromLoadBalancer", - // "elasticloadbalancing:ModifyLoadBalancerAttributes", - // "elasticloadbalancing:RegisterInstancesWithLoadBalancer", - // "elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer", - // "elasticloadbalancing:AddTags", - // "elasticloadbalancing:CreateListener", - // "elasticloadbalancing:CreateTargetGroup", - // "elasticloadbalancing:DeleteListener", - // "elasticloadbalancing:DeleteTargetGroup", - // "elasticloadbalancing:DeregisterTargets", - // "elasticloadbalancing:DescribeListeners", - // "elasticloadbalancing:DescribeLoadBalancerPolicies", - // "elasticloadbalancing:DescribeTargetGroups", - // "elasticloadbalancing:DescribeTargetHealth", - // "elasticloadbalancing:ModifyListener", - // "elasticloadbalancing:ModifyTargetGroup", - // "elasticloadbalancing:RegisterTargets", - // "elasticloadbalancing:SetLoadBalancerPoliciesOfListener", - // "iam:CreateServiceLinkedRole", - // "kms:DescribeKey" - // ], - // "Resource": [ - // "*" - // ], - // "Effect": "Allow" - // } - // ] - // } - // +immutable - KubeCloudControllerARN string `json:"kubeCloudControllerARN"` - - // NodePoolManagementARN is an ARN value referencing a role appropriate for the CAPI Controller. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Action": [ - // "ec2:AssociateRouteTable", - // "ec2:AttachInternetGateway", - // "ec2:AuthorizeSecurityGroupIngress", - // "ec2:CreateInternetGateway", - // "ec2:CreateNatGateway", - // "ec2:CreateRoute", - // "ec2:CreateRouteTable", - // "ec2:CreateSecurityGroup", - // "ec2:CreateSubnet", - // "ec2:CreateTags", - // "ec2:DeleteInternetGateway", - // "ec2:DeleteNatGateway", - // "ec2:DeleteRouteTable", - // "ec2:DeleteSecurityGroup", - // "ec2:DeleteSubnet", - // "ec2:DeleteTags", - // "ec2:DescribeAccountAttributes", - // "ec2:DescribeAddresses", - // "ec2:DescribeAvailabilityZones", - // "ec2:DescribeImages", - // "ec2:DescribeInstances", - // "ec2:DescribeInternetGateways", - // "ec2:DescribeNatGateways", - // "ec2:DescribeNetworkInterfaces", - // "ec2:DescribeNetworkInterfaceAttribute", - // "ec2:DescribeRouteTables", - // "ec2:DescribeSecurityGroups", - // "ec2:DescribeSubnets", - // "ec2:DescribeVpcs", - // "ec2:DescribeVpcAttribute", - // "ec2:DescribeVolumes", - // "ec2:DetachInternetGateway", - // "ec2:DisassociateRouteTable", - // "ec2:DisassociateAddress", - // "ec2:ModifyInstanceAttribute", - // "ec2:ModifyNetworkInterfaceAttribute", - // "ec2:ModifySubnetAttribute", - // "ec2:RevokeSecurityGroupIngress", - // "ec2:RunInstances", - // "ec2:TerminateInstances", - // "tag:GetResources", - // "ec2:CreateLaunchTemplate", - // "ec2:CreateLaunchTemplateVersion", - // "ec2:DescribeLaunchTemplates", - // "ec2:DescribeLaunchTemplateVersions", - // "ec2:DeleteLaunchTemplate", - // "ec2:DeleteLaunchTemplateVersions" - // ], - // "Resource": [ - // "*" - // ], - // "Effect": "Allow" - // }, - // { - // "Condition": { - // "StringLike": { - // "iam:AWSServiceName": "elasticloadbalancing.amazonaws.com" - // } - // }, - // "Action": [ - // "iam:CreateServiceLinkedRole" - // ], - // "Resource": [ - // "arn:*:iam::*:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing" - // ], - // "Effect": "Allow" - // }, - // { - // "Action": [ - // "iam:PassRole" - // ], - // "Resource": [ - // "arn:*:iam::*:role/*-worker-role" - // ], - // "Effect": "Allow" - // }, - // { - // "Effect": "Allow", - // "Action": [ - // "kms:Decrypt", - // "kms:ReEncrypt", - // "kms:GenerateDataKeyWithoutPlainText", - // "kms:DescribeKey" - // ], - // "Resource": "*" - // }, - // { - // "Effect": "Allow", - // "Action": [ - // "kms:CreateGrant" - // ], - // "Resource": "*", - // "Condition": { - // "Bool": { - // "kms:GrantIsForAWSResource": true - // } - // } - // } - // ] - // } - // - // +immutable - NodePoolManagementARN string `json:"nodePoolManagementARN"` - - // ControlPlaneOperatorARN is an ARN value referencing a role appropriate for the Control Plane Operator. - // - // The following is an example of a valid policy document: - // - // { - // "Version": "2012-10-17", - // "Statement": [ - // { - // "Effect": "Allow", - // "Action": [ - // "ec2:CreateVpcEndpoint", - // "ec2:DescribeVpcEndpoints", - // "ec2:ModifyVpcEndpoint", - // "ec2:DeleteVpcEndpoints", - // "ec2:CreateTags", - // "route53:ListHostedZones", - // "ec2:CreateSecurityGroup", - // "ec2:AuthorizeSecurityGroupIngress", - // "ec2:AuthorizeSecurityGroupEgress", - // "ec2:DeleteSecurityGroup", - // "ec2:RevokeSecurityGroupIngress", - // "ec2:RevokeSecurityGroupEgress", - // "ec2:DescribeSecurityGroups", - // "ec2:DescribeVpcs", - // ], - // "Resource": "*" - // }, - // { - // "Effect": "Allow", - // "Action": [ - // "route53:ChangeResourceRecordSets", - // "route53:ListResourceRecordSets" - // ], - // "Resource": "arn:aws:route53:::%s" - // } - // ] - // } - // +immutable - ControlPlaneOperatorARN string `json:"controlPlaneOperatorARN"` - KMSProviderARN string `json:"kmsProviderARN"` -} - -// RosaControlPlaneStatus defines the observed state of ROSAControlPlane. -type RosaControlPlaneStatus struct { - // ExternalManagedControlPlane indicates to cluster-api that the control plane - // is managed by an external service such as AKS, EKS, GKE, etc. - // +kubebuilder:default=true - ExternalManagedControlPlane *bool `json:"externalManagedControlPlane,omitempty"` - // Initialized denotes whether or not the control plane has the - // uploaded kubernetes config-map. - // +optional - Initialized bool `json:"initialized"` - // Ready denotes that the ROSAControlPlane API Server is ready to receive requests. - // +kubebuilder:default=false - Ready bool `json:"ready"` - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the state and will be set to a descriptive error message. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the spec or the configuration of - // the controller, and that manual intervention is required. - // - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - // Conditions specifies the conditions for the managed control plane - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` - - // ID is the cluster ID given by ROSA. - ID string `json:"id,omitempty"` - // ConsoleURL is the url for the openshift console. - ConsoleURL string `json:"consoleURL,omitempty"` - // OIDCEndpointURL is the endpoint url for the managed OIDC provider. - OIDCEndpointURL string `json:"oidcEndpointURL,omitempty"` - - // OpenShift semantic version, for example "4.14.5". - // +optional - Version string `json:"version"` - - // Available upgrades for the ROSA hosted control plane. - AvailableUpgrades []string `json:"availableUpgrades,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=rosacontrolplanes,shortName=rosacp,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this RosaControl belongs" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes" -// +k8s:defaulter-gen=true - -// ROSAControlPlane is the Schema for the ROSAControlPlanes API. -type ROSAControlPlane struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec RosaControlPlaneSpec `json:"spec,omitempty"` - Status RosaControlPlaneStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ROSAControlPlaneList contains a list of ROSAControlPlane. -type ROSAControlPlaneList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ROSAControlPlane `json:"items"` -} - -// GetConditions returns the control planes conditions. -func (r *ROSAControlPlane) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the status conditions for the AWSManagedControlPlane. -func (r *ROSAControlPlane) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -func init() { - SchemeBuilder.Register(&ROSAControlPlane{}, &ROSAControlPlaneList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_webhook.go deleted file mode 100644 index 21618bcec355..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/rosacontrolplane_webhook.go +++ /dev/null @@ -1,292 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - "net" - - "github.com/blang/semver" - kmsArnRegexpValidator "github.com/openshift-online/ocm-common/pkg/resource/validations" - apierrors "k8s.io/apimachinery/pkg/api/errors" - runtime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager will setup the webhooks for the ROSAControlPlane. -func (r *ROSAControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(rosaControlPlaneWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-controlplane-cluster-x-k8s-io-v1beta2-rosacontrolplane,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes,versions=v1beta2,name=validation.rosacontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-controlplane-cluster-x-k8s-io-v1beta2-rosacontrolplane,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes,versions=v1beta2,name=default.rosacontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type rosaControlPlaneWebhook struct{} - -var _ webhook.CustomDefaulter = &rosaControlPlaneWebhook{} -var _ webhook.CustomValidator = &rosaControlPlaneWebhook{} - -// ValidateCreate implements admission.Validator. -func (*rosaControlPlaneWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - r, ok := obj.(*ROSAControlPlane) - if !ok { - return nil, fmt.Errorf("expected an ROSAControlPlane object but got %T", r) - } - - var allErrs field.ErrorList - - if err := r.validateVersion(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateEtcdEncryptionKMSArn(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateExternalAuthProviders(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateClusterRegistryConfig(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateRosaRoleConfig(); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, r.validateNetwork()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - - if err := r.validateROSANetwork(); err != nil { - allErrs = append(allErrs, err) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -func (r *ROSAControlPlane) validateClusterRegistryConfig() *field.Error { - if r.Spec.ClusterRegistryConfig != nil { - if r.Spec.ClusterRegistryConfig.RegistrySources != nil { - if len(r.Spec.ClusterRegistryConfig.RegistrySources.AllowedRegistries) > 0 && len(r.Spec.ClusterRegistryConfig.RegistrySources.BlockedRegistries) > 0 { - return field.Invalid(field.NewPath("spec.clusterRegistryConfig.registrySources"), r.Spec.ClusterRegistryConfig.RegistrySources, "allowedRegistries and blockedRegistries are mutually exclusive fields") - } - } - } - - return nil -} - -// ValidateUpdate implements admission.Validator. -func (*rosaControlPlaneWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (warnings admission.Warnings, err error) { - r, ok := newObj.(*ROSAControlPlane) - if !ok { - return nil, fmt.Errorf("expected an ROSAControlPlane object but got %T", r) - } - - var allErrs field.ErrorList - - if err := r.validateVersion(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateEtcdEncryptionKMSArn(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateRosaRoleConfig(); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, r.validateNetwork()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete implements admission.Validator. -func (*rosaControlPlaneWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -func (r *ROSAControlPlane) validateVersion() *field.Error { - _, err := semver.Parse(r.Spec.Version) - if err != nil { - return field.Invalid(field.NewPath("spec.version"), r.Spec.Version, "must be a valid semantic version") - } - - return nil -} - -func (r *ROSAControlPlane) validateNetwork() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.Network == nil { - return allErrs - } - - rootPath := field.NewPath("spec", "network") - - if r.Spec.Network.MachineCIDR != "" { - _, _, err := net.ParseCIDR(r.Spec.Network.MachineCIDR) - if err != nil { - allErrs = append(allErrs, field.Invalid(rootPath.Child("machineCIDR"), r.Spec.Network.MachineCIDR, "must be valid CIDR block")) - } - } - - if r.Spec.Network.PodCIDR != "" { - _, _, err := net.ParseCIDR(r.Spec.Network.PodCIDR) - if err != nil { - allErrs = append(allErrs, field.Invalid(rootPath.Child("podCIDR"), r.Spec.Network.PodCIDR, "must be valid CIDR block")) - } - } - - if r.Spec.Network.ServiceCIDR != "" { - _, _, err := net.ParseCIDR(r.Spec.Network.ServiceCIDR) - if err != nil { - allErrs = append(allErrs, field.Invalid(rootPath.Child("serviceCIDR"), r.Spec.Network.ServiceCIDR, "must be valid CIDR block")) - } - } - - return allErrs -} - -func (r *ROSAControlPlane) validateEtcdEncryptionKMSArn() *field.Error { - err := kmsArnRegexpValidator.ValidateKMSKeyARN(&r.Spec.EtcdEncryptionKMSARN) - if err != nil { - return field.Invalid(field.NewPath("spec.etcdEncryptionKMSARN"), r.Spec.EtcdEncryptionKMSARN, err.Error()) - } - - return nil -} - -func (r *ROSAControlPlane) validateExternalAuthProviders() *field.Error { - if !r.Spec.EnableExternalAuthProviders && len(r.Spec.ExternalAuthProviders) > 0 { - return field.Invalid(field.NewPath("spec.ExternalAuthProviders"), r.Spec.ExternalAuthProviders, - "can only be set if spec.EnableExternalAuthProviders is set to 'True'") - } - - return nil -} - -func (r *ROSAControlPlane) validateRosaRoleConfig() *field.Error { - hasRoleFields := r.Spec.OIDCID != "" || r.Spec.InstallerRoleARN != "" || r.Spec.SupportRoleARN != "" || r.Spec.WorkerRoleARN != "" || - r.Spec.RolesRef.IngressARN != "" || r.Spec.RolesRef.ImageRegistryARN != "" || r.Spec.RolesRef.StorageARN != "" || - r.Spec.RolesRef.NetworkARN != "" || r.Spec.RolesRef.KubeCloudControllerARN != "" || r.Spec.RolesRef.NodePoolManagementARN != "" || - r.Spec.RolesRef.ControlPlaneOperatorARN != "" || r.Spec.RolesRef.KMSProviderARN != "" - - if r.Spec.RosaRoleConfigRef != nil { - if hasRoleFields { - return field.Invalid(field.NewPath("spec.rosaRoleConfigRef"), r.Spec.RosaRoleConfigRef, "RosaRoleConfigRef and role fields such as installerRoleARN, supportRoleARN, workerRoleARN, rolesRef and oidcID are mutually exclusive") - } - return nil - } - - if r.Spec.OIDCID == "" { - return field.Invalid(field.NewPath("spec.oidcID"), r.Spec.OIDCID, "must be specified") - } - if r.Spec.InstallerRoleARN == "" { - return field.Invalid(field.NewPath("spec.installerRoleARN"), r.Spec.InstallerRoleARN, "must be specified") - } - if r.Spec.SupportRoleARN == "" { - return field.Invalid(field.NewPath("spec.supportRoleARN"), r.Spec.SupportRoleARN, "must be specified") - } - if r.Spec.WorkerRoleARN == "" { - return field.Invalid(field.NewPath("spec.workerRoleARN"), r.Spec.WorkerRoleARN, "must be specified") - } - if r.Spec.RolesRef.IngressARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.ingressARN"), r.Spec.RolesRef.IngressARN, "must be specified") - } - if r.Spec.RolesRef.ImageRegistryARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.imageRegistryARN"), r.Spec.RolesRef.ImageRegistryARN, "must be specified") - } - if r.Spec.RolesRef.StorageARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.storageARN"), r.Spec.RolesRef.StorageARN, "must be specified") - } - if r.Spec.RolesRef.NetworkARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.networkARN"), r.Spec.RolesRef.NetworkARN, "must be specified") - } - if r.Spec.RolesRef.KubeCloudControllerARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.kubeCloudControllerARN"), r.Spec.RolesRef.KubeCloudControllerARN, "must be specified") - } - if r.Spec.RolesRef.NodePoolManagementARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.nodePoolManagementARN"), r.Spec.RolesRef.NodePoolManagementARN, "must be specified") - } - if r.Spec.RolesRef.ControlPlaneOperatorARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.controlPlaneOperatorARN"), r.Spec.RolesRef.ControlPlaneOperatorARN, "must be specified") - } - if r.Spec.RolesRef.KMSProviderARN == "" { - return field.Invalid(field.NewPath("spec.rolesRef.kmsProviderARN"), r.Spec.RolesRef.KMSProviderARN, "must be specified") - } - return nil -} - -func (r *ROSAControlPlane) validateROSANetwork() *field.Error { - if r.Spec.ROSANetworkRef != nil { - if r.Spec.Subnets != nil { - return field.Forbidden(field.NewPath("spec.rosaNetworkRef"), "spec.subnets and spec.rosaNetworkRef are mutually exclusive") - } - if r.Spec.AvailabilityZones != nil { - return field.Forbidden(field.NewPath("spec.rosaNetworkRef"), "spec.availabilityZones and spec.rosaNetworkRef are mutually exclusive") - } - } - - if r.Spec.ROSANetworkRef == nil && r.Spec.Subnets == nil { - return field.Required(field.NewPath("spec.subnets"), "spec.subnets cannot be empty when spec.rosaNetworkRef is unspecified") - } - - if r.Spec.ROSANetworkRef == nil && r.Spec.AvailabilityZones == nil { - return field.Required(field.NewPath("spec.availabilityZones"), "spec.availabilityZones cannot be empty when spec.rosaNetworkRef is unspecified") - } - - return nil -} - -// Default implements admission.Defaulter. -func (*rosaControlPlaneWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*ROSAControlPlane) - if !ok { - return fmt.Errorf("expected an ROSAControlPlane object but got %T", r) - } - - SetObjectDefaults_ROSAControlPlane(r) - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.deepcopy.go deleted file mode 100644 index 8c6e718edb20..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.deepcopy.go +++ /dev/null @@ -1,543 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta2 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSRolesRef) DeepCopyInto(out *AWSRolesRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSRolesRef. -func (in *AWSRolesRef) DeepCopy() *AWSRolesRef { - if in == nil { - return nil - } - out := new(AWSRolesRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AutoNode) DeepCopyInto(out *AutoNode) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoNode. -func (in *AutoNode) DeepCopy() *AutoNode { - if in == nil { - return nil - } - out := new(AutoNode) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AutoScaling) DeepCopyInto(out *AutoScaling) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScaling. -func (in *AutoScaling) DeepCopy() *AutoScaling { - if in == nil { - return nil - } - out := new(AutoScaling) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DefaultMachinePoolSpec) DeepCopyInto(out *DefaultMachinePoolSpec) { - *out = *in - if in.Autoscaling != nil { - in, out := &in.Autoscaling, &out.Autoscaling - *out = new(AutoScaling) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultMachinePoolSpec. -func (in *DefaultMachinePoolSpec) DeepCopy() *DefaultMachinePoolSpec { - if in == nil { - return nil - } - out := new(DefaultMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalAuthProvider) DeepCopyInto(out *ExternalAuthProvider) { - *out = *in - in.Issuer.DeepCopyInto(&out.Issuer) - if in.OIDCClients != nil { - in, out := &in.OIDCClients, &out.OIDCClients - *out = make([]OIDCClientConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ClaimMappings != nil { - in, out := &in.ClaimMappings, &out.ClaimMappings - *out = new(TokenClaimMappings) - (*in).DeepCopyInto(*out) - } - if in.ClaimValidationRules != nil { - in, out := &in.ClaimValidationRules, &out.ClaimValidationRules - *out = make([]TokenClaimValidationRule, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAuthProvider. -func (in *ExternalAuthProvider) DeepCopy() *ExternalAuthProvider { - if in == nil { - return nil - } - out := new(ExternalAuthProvider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalObjectReference) DeepCopyInto(out *LocalObjectReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectReference. -func (in *LocalObjectReference) DeepCopy() *LocalObjectReference { - if in == nil { - return nil - } - out := new(LocalObjectReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. -func (in *NetworkSpec) DeepCopy() *NetworkSpec { - if in == nil { - return nil - } - out := new(NetworkSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OIDCClientConfig) DeepCopyInto(out *OIDCClientConfig) { - *out = *in - out.ClientSecret = in.ClientSecret - if in.ExtraScopes != nil { - in, out := &in.ExtraScopes, &out.ExtraScopes - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCClientConfig. -func (in *OIDCClientConfig) DeepCopy() *OIDCClientConfig { - if in == nil { - return nil - } - out := new(OIDCClientConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrefixedClaimMapping) DeepCopyInto(out *PrefixedClaimMapping) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrefixedClaimMapping. -func (in *PrefixedClaimMapping) DeepCopy() *PrefixedClaimMapping { - if in == nil { - return nil - } - out := new(PrefixedClaimMapping) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAControlPlane) DeepCopyInto(out *ROSAControlPlane) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAControlPlane. -func (in *ROSAControlPlane) DeepCopy() *ROSAControlPlane { - if in == nil { - return nil - } - out := new(ROSAControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSAControlPlane) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAControlPlaneList) DeepCopyInto(out *ROSAControlPlaneList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ROSAControlPlane, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAControlPlaneList. -func (in *ROSAControlPlaneList) DeepCopy() *ROSAControlPlaneList { - if in == nil { - return nil - } - out := new(ROSAControlPlaneList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSAControlPlaneList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistryConfig) DeepCopyInto(out *RegistryConfig) { - *out = *in - if in.AdditionalTrustedCAs != nil { - in, out := &in.AdditionalTrustedCAs, &out.AdditionalTrustedCAs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.AllowedRegistriesForImport != nil { - in, out := &in.AllowedRegistriesForImport, &out.AllowedRegistriesForImport - *out = make([]RegistryLocation, len(*in)) - copy(*out, *in) - } - if in.RegistrySources != nil { - in, out := &in.RegistrySources, &out.RegistrySources - *out = new(RegistrySources) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryConfig. -func (in *RegistryConfig) DeepCopy() *RegistryConfig { - if in == nil { - return nil - } - out := new(RegistryConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistryLocation) DeepCopyInto(out *RegistryLocation) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryLocation. -func (in *RegistryLocation) DeepCopy() *RegistryLocation { - if in == nil { - return nil - } - out := new(RegistryLocation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistrySources) DeepCopyInto(out *RegistrySources) { - *out = *in - if in.AllowedRegistries != nil { - in, out := &in.AllowedRegistries, &out.AllowedRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.BlockedRegistries != nil { - in, out := &in.BlockedRegistries, &out.BlockedRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.InsecureRegistries != nil { - in, out := &in.InsecureRegistries, &out.InsecureRegistries - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrySources. -func (in *RegistrySources) DeepCopy() *RegistrySources { - if in == nil { - return nil - } - out := new(RegistrySources) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaControlPlaneSpec) DeepCopyInto(out *RosaControlPlaneSpec) { - *out = *in - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RosaRoleConfigRef != nil { - in, out := &in.RosaRoleConfigRef, &out.RosaRoleConfigRef - *out = new(v1.LocalObjectReference) - **out = **in - } - out.RolesRef = in.RolesRef - if in.ExternalAuthProviders != nil { - in, out := &in.ExternalAuthProviders, &out.ExternalAuthProviders - *out = make([]ExternalAuthProvider, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.DefaultMachinePoolSpec.DeepCopyInto(&out.DefaultMachinePoolSpec) - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(NetworkSpec) - **out = **in - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(apiv1beta2.AWSIdentityReference) - **out = **in - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ClusterRegistryConfig != nil { - in, out := &in.ClusterRegistryConfig, &out.ClusterRegistryConfig - *out = new(RegistryConfig) - (*in).DeepCopyInto(*out) - } - if in.AutoNode != nil { - in, out := &in.AutoNode, &out.AutoNode - *out = new(AutoNode) - **out = **in - } - if in.ROSANetworkRef != nil { - in, out := &in.ROSANetworkRef, &out.ROSANetworkRef - *out = new(v1.LocalObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaControlPlaneSpec. -func (in *RosaControlPlaneSpec) DeepCopy() *RosaControlPlaneSpec { - if in == nil { - return nil - } - out := new(RosaControlPlaneSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaControlPlaneStatus) DeepCopyInto(out *RosaControlPlaneStatus) { - *out = *in - if in.ExternalManagedControlPlane != nil { - in, out := &in.ExternalManagedControlPlane, &out.ExternalManagedControlPlane - *out = new(bool) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AvailableUpgrades != nil { - in, out := &in.AvailableUpgrades, &out.AvailableUpgrades - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaControlPlaneStatus. -func (in *RosaControlPlaneStatus) DeepCopy() *RosaControlPlaneStatus { - if in == nil { - return nil - } - out := new(RosaControlPlaneStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenClaimMappings) DeepCopyInto(out *TokenClaimMappings) { - *out = *in - if in.Username != nil { - in, out := &in.Username, &out.Username - *out = new(UsernameClaimMapping) - (*in).DeepCopyInto(*out) - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = new(PrefixedClaimMapping) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenClaimMappings. -func (in *TokenClaimMappings) DeepCopy() *TokenClaimMappings { - if in == nil { - return nil - } - out := new(TokenClaimMappings) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenClaimValidationRule) DeepCopyInto(out *TokenClaimValidationRule) { - *out = *in - out.RequiredClaim = in.RequiredClaim -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenClaimValidationRule. -func (in *TokenClaimValidationRule) DeepCopy() *TokenClaimValidationRule { - if in == nil { - return nil - } - out := new(TokenClaimValidationRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenIssuer) DeepCopyInto(out *TokenIssuer) { - *out = *in - if in.Audiences != nil { - in, out := &in.Audiences, &out.Audiences - *out = make([]TokenAudience, len(*in)) - copy(*out, *in) - } - if in.CertificateAuthority != nil { - in, out := &in.CertificateAuthority, &out.CertificateAuthority - *out = new(LocalObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenIssuer. -func (in *TokenIssuer) DeepCopy() *TokenIssuer { - if in == nil { - return nil - } - out := new(TokenIssuer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TokenRequiredClaim) DeepCopyInto(out *TokenRequiredClaim) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenRequiredClaim. -func (in *TokenRequiredClaim) DeepCopy() *TokenRequiredClaim { - if in == nil { - return nil - } - out := new(TokenRequiredClaim) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UsernameClaimMapping) DeepCopyInto(out *UsernameClaimMapping) { - *out = *in - if in.Prefix != nil { - in, out := &in.Prefix, &out.Prefix - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UsernameClaimMapping. -func (in *UsernameClaimMapping) DeepCopy() *UsernameClaimMapping { - if in == nil { - return nil - } - out := new(UsernameClaimMapping) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.defaults.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.defaults.go deleted file mode 100644 index 60d82ff4d78d..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2/zz_generated.defaults.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1beta2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&ROSAControlPlane{}, func(obj interface{}) { SetObjectDefaults_ROSAControlPlane(obj.(*ROSAControlPlane)) }) - scheme.AddTypeDefaultingFunc(&ROSAControlPlaneList{}, func(obj interface{}) { SetObjectDefaults_ROSAControlPlaneList(obj.(*ROSAControlPlaneList)) }) - return nil -} - -func SetObjectDefaults_ROSAControlPlane(in *ROSAControlPlane) { - SetDefaults_RosaControlPlaneSpec(&in.Spec) -} - -func SetObjectDefaults_ROSAControlPlaneList(in *ROSAControlPlaneList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_ROSAControlPlane(a) - } -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsfargateprofile_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsfargateprofile_types.go deleted file mode 100644 index 3bdcc0f5eb94..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsfargateprofile_types.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// DefaultEKSFargateRole is the name of the default IAM role to use for fargate -// profiles if no other role is supplied in the spec and if iam role creation -// is not enabled. The default can be created using clusterawsadm or created manually. -var DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", iamv1.DefaultNameSuffix) - -// FargateProfileSpec defines the desired state of FargateProfile. -type FargateProfileSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // ProfileName specifies the profile name. - ProfileName string `json:"profileName,omitempty"` - - // SubnetIDs specifies which subnets are used for the - // auto scaling group of this nodegroup. - // +optional - SubnetIDs []string `json:"subnetIDs,omitempty"` - - // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the - // ones added by default. - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // RoleName specifies the name of IAM role for this fargate pool - // If the role is pre-existing we will treat it as unmanaged - // and not delete it on deletion. If the EKSEnableIAM feature - // flag is true and no name is supplied then a role is created. - // +optional - RoleName string `json:"roleName,omitempty"` - - // Selectors specify fargate pod selectors. - Selectors []FargateSelector `json:"selectors,omitempty"` -} - -// FargateSelector specifies a selector for pods that should run on this fargate pool. -type FargateSelector struct { - // Labels specifies which pod labels this selector should match. - Labels map[string]string `json:"labels,omitempty"` - - // Namespace specifies which namespace this selector should match. - Namespace string `json:"namespace,omitempty"` -} - -// FargateProfileStatus defines the observed state of FargateProfile. -type FargateProfileStatus struct { - // Ready denotes that the FargateProfile is available. - // +kubebuilder:default=false - Ready bool `json:"ready"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the FargateProfile and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the FargateProfile's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // FargateProfiles can be added as events to the FargateProfile object - // and/or logged in the controller's output. - // +optional - FailureReason *string `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the FargateProfile and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the FargateProfile's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // FargateProfiles can be added as events to the FargateProfile - // object and/or logged in the controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Conditions defines current state of the Fargate profile. - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:resource:path=awsfargateprofiles,scope=Namespaced,categories=cluster-api,shortName=awsfp -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="AWSFargateProfile ready status" -// +kubebuilder:printcolumn:name="ProfileName",type="string",JSONPath=".spec.profileName",description="EKS Fargate profile name" -// +kubebuilder:printcolumn:name="FailureReason",type="string",JSONPath=".status.failureReason",description="Failure reason" - -// AWSFargateProfile is the Schema for the awsfargateprofiles API. -type AWSFargateProfile struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec FargateProfileSpec `json:"spec,omitempty"` - Status FargateProfileStatus `json:"status,omitempty"` -} - -// GetConditions returns the observations of the operational state of the AWSFargateProfile resource. -func (r *AWSFargateProfile) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1betav1.Conditions. -func (r *AWSFargateProfile) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion - -// AWSFargateProfileList contains a list of FargateProfiles. -type AWSFargateProfileList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSFargateProfile `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSFargateProfile{}, &AWSFargateProfileList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsmanagedmachinepool_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsmanagedmachinepool_types.go deleted file mode 100644 index 08fdd1d0c97f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/awsmanagedmachinepool_types.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool. -type ManagedMachineAMIType string - -const ( - // Al2x86_64 is the default AMI type. - Al2x86_64 ManagedMachineAMIType = "AL2_x86_64" - // Al2x86_64GPU is the x86-64 GPU AMI type. - Al2x86_64GPU ManagedMachineAMIType = "AL2_x86_64_GPU" - // Al2Arm64 is the Arm AMI type. - Al2Arm64 ManagedMachineAMIType = "AL2_ARM_64" - // Al2023x86_64 is the AL2023 x86-64 AMI type. - Al2023x86_64 ManagedMachineAMIType = "AL2023_x86_64_STANDARD" - // Al2023Arm64 is the AL2023 Arm AMI type. - Al2023Arm64 ManagedMachineAMIType = "AL2023_ARM_64_STANDARD" -) - -// ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool. -type ManagedMachinePoolCapacityType string - -const ( - // ManagedMachinePoolCapacityTypeOnDemand is the default capacity type, to launch on-demand instances. - ManagedMachinePoolCapacityTypeOnDemand ManagedMachinePoolCapacityType = "onDemand" - // ManagedMachinePoolCapacityTypeSpot is the spot instance capacity type to launch spot instances. - ManagedMachinePoolCapacityTypeSpot ManagedMachinePoolCapacityType = "spot" -) - -// DefaultEKSNodegroupRole is the name of the default IAM role to use for EKS nodegroups -// if no other role is supplied in the spec and if iam role creation is not enabled. The default -// can be created using clusterawsadm or created manually. -var DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", iamv1.DefaultNameSuffix) - -// AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool. -type AWSManagedMachinePoolSpec struct { - // EKSNodegroupName specifies the name of the nodegroup in AWS - // corresponding to this MachinePool. If you don't specify a name - // then a default name will be created based on the namespace and - // name of the managed machine pool. - // +optional - EKSNodegroupName string `json:"eksNodegroupName,omitempty"` - - // AvailabilityZones is an array of availability zones instances can run in - AvailabilityZones []string `json:"availabilityZones,omitempty"` - - // SubnetIDs specifies which subnets are used for the - // auto scaling group of this nodegroup - // +optional - SubnetIDs []string `json:"subnetIDs,omitempty"` - - // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the - // ones added by default. - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // RoleAdditionalPolicies allows you to attach additional polices to - // the node group role. You must enable the EKSAllowAddRoles - // feature flag to incorporate these into the created role. - // +optional - RoleAdditionalPolicies []string `json:"roleAdditionalPolicies,omitempty"` - - // RoleName specifies the name of IAM role for the node group. - // If the role is pre-existing we will treat it as unmanaged - // and not delete it on deletion. If the EKSEnableIAM feature - // flag is true and no name is supplied then a role is created. - // +optional - RoleName string `json:"roleName,omitempty"` - - // AMIVersion defines the desired AMI release version. If no version number - // is supplied then the latest version for the Kubernetes version - // will be used - // +kubebuilder:validation:MinLength:=2 - // +optional - AMIVersion *string `json:"amiVersion,omitempty"` - - // AMIType defines the AMI type - // +kubebuilder:validation:Enum:=AL2_x86_64;AL2_x86_64_GPU;AL2_ARM_64;AL2023_x86_64_STANDARD;AL2023_ARM_64_STANDARD;CUSTOM - // +kubebuilder:default:=AL2_x86_64 - // +optional - AMIType *ManagedMachineAMIType `json:"amiType,omitempty"` - - // Labels specifies labels for the Kubernetes node objects - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // Taints specifies the taints to apply to the nodes of the machine pool - // +optional - Taints Taints `json:"taints,omitempty"` - - // DiskSize specifies the root disk size - // +optional - DiskSize *int32 `json:"diskSize,omitempty"` - - // InstanceType specifies the AWS instance type - // +optional - InstanceType *string `json:"instanceType,omitempty"` - - // Scaling specifies scaling for the ASG behind this pool - // +optional - Scaling *ManagedMachinePoolScaling `json:"scaling,omitempty"` - - // RemoteAccess specifies how machines can be accessed remotely - // +optional - RemoteAccess *ManagedRemoteAccess `json:"remoteAccess,omitempty"` - - // ProviderIDList are the provider IDs of instances in the - // autoscaling group corresponding to the nodegroup represented by this - // machine pool - // +optional - ProviderIDList []string `json:"providerIDList,omitempty"` - - // CapacityType specifies the capacity type for the ASG behind this pool - // +kubebuilder:validation:Enum:=onDemand;spot - // +kubebuilder:default:=onDemand - // +optional - CapacityType *ManagedMachinePoolCapacityType `json:"capacityType,omitempty"` - - // UpdateConfig holds the optional config to control the behaviour of the update - // to the nodegroup. - // +optional - UpdateConfig *UpdateConfig `json:"updateConfig,omitempty"` - - // AWSLaunchTemplate specifies the launch template to use to create the managed node group. - // If AWSLaunchTemplate is specified, certain node group configuraions outside of launch template - // are prohibited (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html). - // +optional - AWSLaunchTemplate *AWSLaunchTemplate `json:"awsLaunchTemplate,omitempty"` -} - -// ManagedMachinePoolScaling specifies scaling options. -type ManagedMachinePoolScaling struct { - MinSize *int32 `json:"minSize,omitempty"` - MaxSize *int32 `json:"maxSize,omitempty"` -} - -// ManagedRemoteAccess specifies remote access settings for EC2 instances. -type ManagedRemoteAccess struct { - // SSHKeyName specifies which EC2 SSH key can be used to access machines. - // If left empty, the key from the control plane is used. - SSHKeyName *string `json:"sshKeyName,omitempty"` - - // SourceSecurityGroups specifies which security groups are allowed access - SourceSecurityGroups []string `json:"sourceSecurityGroups,omitempty"` - - // Public specifies whether to open port 22 to the public internet - Public bool `json:"public,omitempty"` -} - -// AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool. -type AWSManagedMachinePoolStatus struct { - // Ready denotes that the AWSManagedMachinePool nodegroup has joined - // the cluster - // +kubebuilder:default=false - Ready bool `json:"ready"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas"` - - // The ID of the launch template - // +optional - LaunchTemplateID *string `json:"launchTemplateID,omitempty"` - - // The version of the launch template - // +optional - LaunchTemplateVersion *string `json:"launchTemplateVersion,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the MachinePool and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of MachinePools - // can be added as events to the MachinePool object and/or logged in the - // controller's output. - // +optional - FailureReason *string `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the MachinePool and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachinePool's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of MachinePools - // can be added as events to the MachinePool object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Conditions defines current service state of the managed machine pool - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:resource:path=awsmanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmmp -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="MachinePool ready status" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Number of replicas" - -// AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API. -type AWSManagedMachinePool struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AWSManagedMachinePoolSpec `json:"spec,omitempty"` - Status AWSManagedMachinePoolStatus `json:"status,omitempty"` -} - -// GetConditions returns the observations of the operational state of the AWSManagedMachinePool resource. -func (r *AWSManagedMachinePool) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1beta1.Conditions. -func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion - -// AWSManagedMachinePoolList contains a list of AWSManagedMachinePools. -type AWSManagedMachinePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSManagedMachinePool `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSManagedMachinePool{}, &AWSManagedMachinePoolList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/conversion.go deleted file mode 100644 index 7b49ed9f64f1..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/conversion.go +++ /dev/null @@ -1,257 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -// ConvertTo converts the v1beta1 AWSMachinePool receiver to a v1beta2 AWSMachinePool. -func (src *AWSMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSMachinePool) - if err := Convert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &expinfrav1.AWSMachinePool{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.SuspendProcesses != nil { - dst.Spec.SuspendProcesses = restored.Spec.SuspendProcesses - } - if restored.Spec.RefreshPreferences != nil { - dst.Spec.RefreshPreferences.Disable = restored.Spec.RefreshPreferences.Disable - dst.Spec.RefreshPreferences.MaxHealthyPercentage = restored.Spec.RefreshPreferences.MaxHealthyPercentage - } - if restored.Spec.AWSLaunchTemplate.InstanceMetadataOptions != nil { - dst.Spec.AWSLaunchTemplate.InstanceMetadataOptions = restored.Spec.AWSLaunchTemplate.InstanceMetadataOptions - } - if restored.Spec.AvailabilityZoneSubnetType != nil { - dst.Spec.AvailabilityZoneSubnetType = restored.Spec.AvailabilityZoneSubnetType - } - if restored.Spec.Ignition != nil { - dst.Spec.Ignition = restored.Spec.Ignition - } - dst.Status.InfrastructureMachineKind = restored.Status.InfrastructureMachineKind - if restored.Spec.AWSLifecycleHooks != nil { - dst.Spec.AWSLifecycleHooks = restored.Spec.AWSLifecycleHooks - } - - if restored.Spec.AWSLaunchTemplate.PrivateDNSName != nil { - dst.Spec.AWSLaunchTemplate.PrivateDNSName = restored.Spec.AWSLaunchTemplate.PrivateDNSName - } - - if restored.Spec.AWSLaunchTemplate.CapacityReservationID != nil { - dst.Spec.AWSLaunchTemplate.CapacityReservationID = restored.Spec.AWSLaunchTemplate.CapacityReservationID - } - - if restored.Spec.AWSLaunchTemplate.MarketType != "" { - dst.Spec.AWSLaunchTemplate.MarketType = restored.Spec.AWSLaunchTemplate.MarketType - } - - if preference := restored.Spec.AWSLaunchTemplate.CapacityReservationPreference; preference != "" { - dst.Spec.AWSLaunchTemplate.CapacityReservationPreference = preference - } - - dst.Spec.DefaultInstanceWarmup = restored.Spec.DefaultInstanceWarmup - dst.Spec.AWSLaunchTemplate.NonRootVolumes = restored.Spec.AWSLaunchTemplate.NonRootVolumes - return nil -} - -// ConvertFrom converts the v1beta2 AWSMachinePool receiver to v1beta1 AWSMachinePool. -func (dst *AWSMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSMachinePool) - - if err := Convert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(src, dst, nil); err != nil { - return err - } - - return utilconversion.MarshalData(src, dst) -} - -// ConvertTo converts the v1beta1 AWSMachinePoolList receiver to a v1beta2 AWSMachinePoolList. -func (src *AWSMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSMachinePoolList) - return Convert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSMachinePoolList receiver to v1beta1 AWSMachinePoolList. -func (r *AWSMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSMachinePoolList) - return Convert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(src, r, nil) -} - -// ConvertTo converts the v1beta1 AWSManagedMachinePool receiver to a v1beta2 AWSManagedMachinePool. -func (src *AWSManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSManagedMachinePool) - if err := Convert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(src, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &expinfrav1.AWSManagedMachinePool{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.AWSLaunchTemplate != nil { - if dst.Spec.AWSLaunchTemplate == nil { - dst.Spec.AWSLaunchTemplate = restored.Spec.AWSLaunchTemplate - } - dst.Spec.AWSLaunchTemplate.InstanceMetadataOptions = restored.Spec.AWSLaunchTemplate.InstanceMetadataOptions - dst.Spec.AWSLaunchTemplate.NonRootVolumes = restored.Spec.AWSLaunchTemplate.NonRootVolumes - - if restored.Spec.AWSLaunchTemplate.PrivateDNSName != nil { - dst.Spec.AWSLaunchTemplate.PrivateDNSName = restored.Spec.AWSLaunchTemplate.PrivateDNSName - } - - if restored.Spec.AWSLaunchTemplate.CapacityReservationID != nil { - dst.Spec.AWSLaunchTemplate.CapacityReservationID = restored.Spec.AWSLaunchTemplate.CapacityReservationID - } - - if restored.Spec.AWSLaunchTemplate.MarketType != "" { - dst.Spec.AWSLaunchTemplate.MarketType = restored.Spec.AWSLaunchTemplate.MarketType - } - - if preference := restored.Spec.AWSLaunchTemplate.CapacityReservationPreference; preference != "" { - dst.Spec.AWSLaunchTemplate.CapacityReservationPreference = preference - } - } - if restored.Spec.AvailabilityZoneSubnetType != nil { - dst.Spec.AvailabilityZoneSubnetType = restored.Spec.AvailabilityZoneSubnetType - } - if restored.Spec.AWSLifecycleHooks != nil { - dst.Spec.AWSLifecycleHooks = restored.Spec.AWSLifecycleHooks - } - - dst.Spec.RolePath = restored.Spec.RolePath - dst.Spec.RolePermissionsBoundary = restored.Spec.RolePermissionsBoundary - - if restored.Spec.NodeRepairConfig != nil { - dst.Spec.NodeRepairConfig = restored.Spec.NodeRepairConfig - } - - return nil -} - -// ConvertFrom converts the v1beta2 AWSManagedMachinePool receiver to v1beta1 AWSManagedMachinePool. -func (r *AWSManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSManagedMachinePool) - - if err := Convert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(src, r, nil); err != nil { - return err - } - - return utilconversion.MarshalData(src, r) -} - -// Convert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec is a conversion function. -func Convert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *expinfrav1.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in, out, s) -} - -func Convert_v1beta2_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *expinfrav1.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in, out, s) -} - -// ConvertTo converts the v1beta1 AWSManagedMachinePoolList receiver to a v1beta2 AWSManagedMachinePoolList. -func (src *AWSManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSManagedMachinePoolList) - return Convert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSManagedMachinePoolList receiver to v1beta1 AWSManagedMachinePoolList. -func (r *AWSManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSManagedMachinePoolList) - - return Convert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(src, r, nil) -} - -// ConvertTo converts the v1beta1 AWSFargateProfile receiver to a v1beta2 AWSFargateProfile. -func (src *AWSFargateProfile) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSFargateProfile) - - if err := Convert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &expinfrav1.AWSFargateProfile{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.RolePath = restored.Spec.RolePath - dst.Spec.RolePermissionsBoundary = restored.Spec.RolePermissionsBoundary - - return nil -} - -// ConvertFrom converts the v1beta2 AWSFargateProfile receiver to v1beta1 AWSFargateProfile. -func (r *AWSFargateProfile) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSFargateProfile) - - if err := Convert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - return utilconversion.MarshalData(src, r) -} - -// ConvertTo converts the v1beta1 AWSFargateProfileList receiver to a v1beta2 AWSFargateProfileList. -func (src *AWSFargateProfileList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expinfrav1.AWSFargateProfileList) - return Convert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList(src, dst, nil) -} - -// ConvertFrom converts the v1beta2 AWSFargateProfileList receiver to v1beta1 AWSFargateProfileList. -func (r *AWSFargateProfileList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expinfrav1.AWSFargateProfileList) - - return Convert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(src, r, nil) -} - -// Convert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate converts the v1beta2 AWSLaunchTemplate receiver to a v1beta1 AWSLaunchTemplate. -func Convert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *expinfrav1.AWSLaunchTemplate, out *AWSLaunchTemplate, s apiconversion.Scope) error { - return autoConvert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in, out, s) -} - -func Convert_v1beta2_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *expinfrav1.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in, out, s) -} - -func Convert_v1beta2_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *expinfrav1.AutoScalingGroup, out *AutoScalingGroup, s apiconversion.Scope) error { - // explicitly ignore CurrentlySuspended. - return autoConvert_v1beta2_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in, out, s) -} - -// Convert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences converts the v1beta2 RefreshPreferences receiver to a v1beta1 RefreshPreferences. -func Convert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences(in *expinfrav1.RefreshPreferences, out *RefreshPreferences, s apiconversion.Scope) error { - // spec.refreshPreferences.disable has been added to v1beta2. - return autoConvert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences(in, out, s) -} - -func Convert_v1beta2_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *expinfrav1.FargateProfileSpec, out *FargateProfileSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.conversion.go deleted file mode 100644 index e825e20a31d0..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,1132 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - unsafe "unsafe" - - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - apiv1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - v1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2" - corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AWSFargateProfile)(nil), (*v1beta2.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1beta2.AWSFargateProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSFargateProfile)(nil), (*AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(a.(*v1beta2.AWSFargateProfile), b.(*AWSFargateProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSFargateProfileList)(nil), (*v1beta2.AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList(a.(*AWSFargateProfileList), b.(*v1beta2.AWSFargateProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSFargateProfileList)(nil), (*AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(a.(*v1beta2.AWSFargateProfileList), b.(*AWSFargateProfileList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSLaunchTemplate)(nil), (*v1beta2.AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(a.(*AWSLaunchTemplate), b.(*v1beta2.AWSLaunchTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachinePool)(nil), (*v1beta2.AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(a.(*AWSMachinePool), b.(*v1beta2.AWSMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachinePool)(nil), (*AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(a.(*v1beta2.AWSMachinePool), b.(*AWSMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolInstanceStatus)(nil), (*v1beta2.AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1beta2_AWSMachinePoolInstanceStatus(a.(*AWSMachinePoolInstanceStatus), b.(*v1beta2.AWSMachinePoolInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachinePoolInstanceStatus)(nil), (*AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(a.(*v1beta2.AWSMachinePoolInstanceStatus), b.(*AWSMachinePoolInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolList)(nil), (*v1beta2.AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList(a.(*AWSMachinePoolList), b.(*v1beta2.AWSMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSMachinePoolList)(nil), (*AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(a.(*v1beta2.AWSMachinePoolList), b.(*AWSMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolSpec)(nil), (*v1beta2.AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec(a.(*AWSMachinePoolSpec), b.(*v1beta2.AWSMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolStatus)(nil), (*v1beta2.AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus(a.(*AWSMachinePoolStatus), b.(*v1beta2.AWSMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePool)(nil), (*v1beta2.AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(a.(*AWSManagedMachinePool), b.(*v1beta2.AWSManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSManagedMachinePool)(nil), (*AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(a.(*v1beta2.AWSManagedMachinePool), b.(*AWSManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolList)(nil), (*v1beta2.AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList(a.(*AWSManagedMachinePoolList), b.(*v1beta2.AWSManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSManagedMachinePoolList)(nil), (*AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(a.(*v1beta2.AWSManagedMachinePoolList), b.(*AWSManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolSpec)(nil), (*v1beta2.AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec(a.(*AWSManagedMachinePoolSpec), b.(*v1beta2.AWSManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolStatus)(nil), (*v1beta2.AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus(a.(*AWSManagedMachinePoolStatus), b.(*v1beta2.AWSManagedMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.AWSManagedMachinePoolStatus)(nil), (*AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(a.(*v1beta2.AWSManagedMachinePoolStatus), b.(*AWSManagedMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AutoScalingGroup)(nil), (*v1beta2.AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AutoScalingGroup_To_v1beta2_AutoScalingGroup(a.(*AutoScalingGroup), b.(*v1beta2.AutoScalingGroup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BlockDeviceMapping)(nil), (*v1beta2.BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BlockDeviceMapping_To_v1beta2_BlockDeviceMapping(a.(*BlockDeviceMapping), b.(*v1beta2.BlockDeviceMapping), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.BlockDeviceMapping)(nil), (*BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(a.(*v1beta2.BlockDeviceMapping), b.(*BlockDeviceMapping), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*EBS)(nil), (*v1beta2.EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_EBS_To_v1beta2_EBS(a.(*EBS), b.(*v1beta2.EBS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.EBS)(nil), (*EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_EBS_To_v1beta1_EBS(a.(*v1beta2.EBS), b.(*EBS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FargateProfileSpec)(nil), (*v1beta2.FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec(a.(*FargateProfileSpec), b.(*v1beta2.FargateProfileSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FargateProfileStatus)(nil), (*v1beta2.FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus(a.(*FargateProfileStatus), b.(*v1beta2.FargateProfileStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.FargateProfileStatus)(nil), (*FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus(a.(*v1beta2.FargateProfileStatus), b.(*FargateProfileStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FargateSelector)(nil), (*v1beta2.FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FargateSelector_To_v1beta2_FargateSelector(a.(*FargateSelector), b.(*v1beta2.FargateSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.FargateSelector)(nil), (*FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_FargateSelector_To_v1beta1_FargateSelector(a.(*v1beta2.FargateSelector), b.(*FargateSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InstancesDistribution)(nil), (*v1beta2.InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_InstancesDistribution_To_v1beta2_InstancesDistribution(a.(*InstancesDistribution), b.(*v1beta2.InstancesDistribution), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.InstancesDistribution)(nil), (*InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_InstancesDistribution_To_v1beta1_InstancesDistribution(a.(*v1beta2.InstancesDistribution), b.(*InstancesDistribution), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ManagedMachinePoolScaling)(nil), (*v1beta2.ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedMachinePoolScaling_To_v1beta2_ManagedMachinePoolScaling(a.(*ManagedMachinePoolScaling), b.(*v1beta2.ManagedMachinePoolScaling), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.ManagedMachinePoolScaling)(nil), (*ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(a.(*v1beta2.ManagedMachinePoolScaling), b.(*ManagedMachinePoolScaling), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ManagedRemoteAccess)(nil), (*v1beta2.ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedRemoteAccess_To_v1beta2_ManagedRemoteAccess(a.(*ManagedRemoteAccess), b.(*v1beta2.ManagedRemoteAccess), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.ManagedRemoteAccess)(nil), (*ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(a.(*v1beta2.ManagedRemoteAccess), b.(*ManagedRemoteAccess), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MixedInstancesPolicy)(nil), (*v1beta2.MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MixedInstancesPolicy_To_v1beta2_MixedInstancesPolicy(a.(*MixedInstancesPolicy), b.(*v1beta2.MixedInstancesPolicy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.MixedInstancesPolicy)(nil), (*MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(a.(*v1beta2.MixedInstancesPolicy), b.(*MixedInstancesPolicy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Overrides)(nil), (*v1beta2.Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Overrides_To_v1beta2_Overrides(a.(*Overrides), b.(*v1beta2.Overrides), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Overrides)(nil), (*Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Overrides_To_v1beta1_Overrides(a.(*v1beta2.Overrides), b.(*Overrides), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RefreshPreferences)(nil), (*v1beta2.RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences(a.(*RefreshPreferences), b.(*v1beta2.RefreshPreferences), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Taint)(nil), (*v1beta2.Taint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Taint_To_v1beta2_Taint(a.(*Taint), b.(*v1beta2.Taint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Taint)(nil), (*Taint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Taint_To_v1beta1_Taint(a.(*v1beta2.Taint), b.(*Taint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*UpdateConfig)(nil), (*v1beta2.UpdateConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_UpdateConfig_To_v1beta2_UpdateConfig(a.(*UpdateConfig), b.(*v1beta2.UpdateConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.UpdateConfig)(nil), (*UpdateConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_UpdateConfig_To_v1beta1_UpdateConfig(a.(*v1beta2.UpdateConfig), b.(*UpdateConfig), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSLaunchTemplate)(nil), (*AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(a.(*v1beta2.AWSLaunchTemplate), b.(*AWSLaunchTemplate), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSMachinePoolSpec)(nil), (*AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(a.(*v1beta2.AWSMachinePoolSpec), b.(*AWSMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSMachinePoolStatus)(nil), (*AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(a.(*v1beta2.AWSMachinePoolStatus), b.(*AWSMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AWSManagedMachinePoolSpec)(nil), (*AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(a.(*v1beta2.AWSManagedMachinePoolSpec), b.(*AWSManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.AutoScalingGroup)(nil), (*AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_AutoScalingGroup_To_v1beta1_AutoScalingGroup(a.(*v1beta2.AutoScalingGroup), b.(*AutoScalingGroup), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.FargateProfileSpec)(nil), (*FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_FargateProfileSpec_To_v1beta1_FargateProfileSpec(a.(*v1beta2.FargateProfileSpec), b.(*FargateProfileSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.RefreshPreferences)(nil), (*RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences(a.(*v1beta2.RefreshPreferences), b.(*RefreshPreferences), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(in *AWSFargateProfile, out *v1beta2.AWSFargateProfile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile is an autogenerated conversion function. -func Convert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(in *AWSFargateProfile, out *v1beta2.AWSFargateProfile, s conversion.Scope) error { - return autoConvert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(in, out, s) -} - -func autoConvert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *v1beta2.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_FargateProfileSpec_To_v1beta1_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile is an autogenerated conversion function. -func Convert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *v1beta2.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { - return autoConvert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in, out, s) -} - -func autoConvert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta2.AWSFargateProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSFargateProfile, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSFargateProfile_To_v1beta2_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList is an autogenerated conversion function. -func Convert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta2.AWSFargateProfileList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSFargateProfileList_To_v1beta2_AWSFargateProfileList(in, out, s) -} - -func autoConvert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *v1beta2.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSFargateProfile, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSFargateProfile_To_v1beta1_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList is an autogenerated conversion function. -func Convert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *v1beta2.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in, out, s) -} - -func autoConvert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta2.AWSLaunchTemplate, s conversion.Scope) error { - out.Name = in.Name - out.IamInstanceProfile = in.IamInstanceProfile - out.AMI = in.AMI - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - out.InstanceType = in.InstanceType - out.RootVolume = (*apiv1beta2.Volume)(unsafe.Pointer(in.RootVolume)) - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) - out.AdditionalSecurityGroups = *(*[]apiv1beta2.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) - out.SpotMarketOptions = (*apiv1beta2.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - return nil -} - -// Convert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate is an autogenerated conversion function. -func Convert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta2.AWSLaunchTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(in, out, s) -} - -func autoConvert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *v1beta2.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { - out.Name = in.Name - out.IamInstanceProfile = in.IamInstanceProfile - out.AMI = in.AMI - out.ImageLookupFormat = in.ImageLookupFormat - out.ImageLookupOrg = in.ImageLookupOrg - out.ImageLookupBaseOS = in.ImageLookupBaseOS - out.InstanceType = in.InstanceType - out.RootVolume = (*apiv1beta2.Volume)(unsafe.Pointer(in.RootVolume)) - // WARNING: in.NonRootVolumes requires manual conversion: does not exist in peer-type - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) - out.AdditionalSecurityGroups = *(*[]apiv1beta2.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) - out.SpotMarketOptions = (*apiv1beta2.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) - // WARNING: in.InstanceMetadataOptions requires manual conversion: does not exist in peer-type - // WARNING: in.PrivateDNSName requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationID requires manual conversion: does not exist in peer-type - // WARNING: in.MarketType requires manual conversion: does not exist in peer-type - // WARNING: in.CapacityReservationPreference requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(in *AWSMachinePool, out *v1beta2.AWSMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool is an autogenerated conversion function. -func Convert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(in *AWSMachinePool, out *v1beta2.AWSMachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(in, out, s) -} - -func autoConvert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(in *v1beta2.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool is an autogenerated conversion function. -func Convert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(in *v1beta2.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(in, out, s) -} - -func autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1beta2_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta2.AWSMachinePoolInstanceStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Version = (*string)(unsafe.Pointer(in.Version)) - return nil -} - -// Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1beta2_AWSMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1beta2_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta2.AWSMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1beta2_AWSMachinePoolInstanceStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *v1beta2.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Version = (*string)(unsafe.Pointer(in.Version)) - return nil -} - -// Convert_v1beta2_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1beta2_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *v1beta2.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in, out, s) -} - -func autoConvert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta2.AWSMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSMachinePool_To_v1beta2_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta2.AWSMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachinePoolList_To_v1beta2_AWSMachinePoolList(in, out, s) -} - -func autoConvert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *v1beta2.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSMachinePool_To_v1beta1_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList is an autogenerated conversion function. -func Convert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *v1beta2.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta2.AWSMachinePoolSpec, s conversion.Scope) error { - out.ProviderID = in.ProviderID - out.MinSize = in.MinSize - out.MaxSize = in.MaxSize - out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) - out.Subnets = *(*[]apiv1beta2.AWSResourceReference)(unsafe.Pointer(&in.Subnets)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - if err := Convert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { - return err - } - out.MixedInstancesPolicy = (*v1beta2.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.DefaultCoolDown = in.DefaultCoolDown - if in.RefreshPreferences != nil { - in, out := &in.RefreshPreferences, &out.RefreshPreferences - *out = new(v1beta2.RefreshPreferences) - if err := Convert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences(*in, *out, s); err != nil { - return err - } - } else { - out.RefreshPreferences = nil - } - out.CapacityRebalance = in.CapacityRebalance - return nil -} - -// Convert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta2.AWSMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachinePoolSpec_To_v1beta2_AWSMachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *v1beta2.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { - out.ProviderID = in.ProviderID - out.MinSize = in.MinSize - out.MaxSize = in.MaxSize - out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) - // WARNING: in.AvailabilityZoneSubnetType requires manual conversion: does not exist in peer-type - out.Subnets = *(*[]apiv1beta2.AWSResourceReference)(unsafe.Pointer(&in.Subnets)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - if err := Convert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { - return err - } - out.MixedInstancesPolicy = (*MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.DefaultCoolDown = in.DefaultCoolDown - // WARNING: in.DefaultInstanceWarmup requires manual conversion: does not exist in peer-type - if in.RefreshPreferences != nil { - in, out := &in.RefreshPreferences, &out.RefreshPreferences - *out = new(RefreshPreferences) - if err := Convert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences(*in, *out, s); err != nil { - return err - } - } else { - out.RefreshPreferences = nil - } - out.CapacityRebalance = in.CapacityRebalance - // WARNING: in.SuspendProcesses requires manual conversion: does not exist in peer-type - // WARNING: in.Ignition requires manual conversion: does not exist in peer-type - // WARNING: in.AWSLifecycleHooks requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta2.AWSMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Instances = *(*[]v1beta2.AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) - out.LaunchTemplateID = in.LaunchTemplateID - out.LaunchTemplateVersion = (*string)(unsafe.Pointer(in.LaunchTemplateVersion)) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.ASGStatus = (*v1beta2.ASGStatus)(unsafe.Pointer(in.ASGStatus)) - return nil -} - -// Convert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta2.AWSMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSMachinePoolStatus_To_v1beta2_AWSMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *v1beta2.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Instances = *(*[]AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) - out.LaunchTemplateID = in.LaunchTemplateID - out.LaunchTemplateVersion = (*string)(unsafe.Pointer(in.LaunchTemplateVersion)) - // WARNING: in.InfrastructureMachineKind requires manual conversion: does not exist in peer-type - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.ASGStatus = (*ASGStatus)(unsafe.Pointer(in.ASGStatus)) - return nil -} - -func autoConvert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta2.AWSManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool is an autogenerated conversion function. -func Convert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta2.AWSManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(in, out, s) -} - -func autoConvert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *v1beta2.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool is an autogenerated conversion function. -func Convert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *v1beta2.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in, out, s) -} - -func autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta2.AWSManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.AWSManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AWSManagedMachinePool_To_v1beta2_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta2.AWSManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1beta2_AWSManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *v1beta2.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta2_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *v1beta2.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta2_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta2.AWSManagedMachinePoolSpec, s conversion.Scope) error { - out.EKSNodegroupName = in.EKSNodegroupName - out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) - out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.RoleAdditionalPolicies = *(*[]string)(unsafe.Pointer(&in.RoleAdditionalPolicies)) - out.RoleName = in.RoleName - out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) - out.AMIType = (*v1beta2.ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Taints = *(*v1beta2.Taints)(unsafe.Pointer(&in.Taints)) - out.DiskSize = (*int32)(unsafe.Pointer(in.DiskSize)) - out.InstanceType = (*string)(unsafe.Pointer(in.InstanceType)) - out.Scaling = (*v1beta2.ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) - out.RemoteAccess = (*v1beta2.ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.CapacityType = (*v1beta2.ManagedMachinePoolCapacityType)(unsafe.Pointer(in.CapacityType)) - out.UpdateConfig = (*v1beta2.UpdateConfig)(unsafe.Pointer(in.UpdateConfig)) - if in.AWSLaunchTemplate != nil { - in, out := &in.AWSLaunchTemplate, &out.AWSLaunchTemplate - *out = new(v1beta2.AWSLaunchTemplate) - if err := Convert_v1beta1_AWSLaunchTemplate_To_v1beta2_AWSLaunchTemplate(*in, *out, s); err != nil { - return err - } - } else { - out.AWSLaunchTemplate = nil - } - return nil -} - -// Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta2.AWSManagedMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1beta2_AWSManagedMachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta2_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *v1beta2.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s conversion.Scope) error { - out.EKSNodegroupName = in.EKSNodegroupName - out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) - // WARNING: in.AvailabilityZoneSubnetType requires manual conversion: does not exist in peer-type - out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.RoleAdditionalPolicies = *(*[]string)(unsafe.Pointer(&in.RoleAdditionalPolicies)) - out.RoleName = in.RoleName - // WARNING: in.RolePath requires manual conversion: does not exist in peer-type - // WARNING: in.RolePermissionsBoundary requires manual conversion: does not exist in peer-type - out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) - out.AMIType = (*ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Taints = *(*Taints)(unsafe.Pointer(&in.Taints)) - out.DiskSize = (*int32)(unsafe.Pointer(in.DiskSize)) - out.InstanceType = (*string)(unsafe.Pointer(in.InstanceType)) - out.Scaling = (*ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) - out.RemoteAccess = (*ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.CapacityType = (*ManagedMachinePoolCapacityType)(unsafe.Pointer(in.CapacityType)) - out.UpdateConfig = (*UpdateConfig)(unsafe.Pointer(in.UpdateConfig)) - if in.AWSLaunchTemplate != nil { - in, out := &in.AWSLaunchTemplate, &out.AWSLaunchTemplate - *out = new(AWSLaunchTemplate) - if err := Convert_v1beta2_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(*in, *out, s); err != nil { - return err - } - } else { - out.AWSLaunchTemplate = nil - } - // WARNING: in.AWSLifecycleHooks requires manual conversion: does not exist in peer-type - // WARNING: in.NodeRepairConfig requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta2.AWSManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.LaunchTemplateID = (*string)(unsafe.Pointer(in.LaunchTemplateID)) - out.LaunchTemplateVersion = (*string)(unsafe.Pointer(in.LaunchTemplateVersion)) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta2.AWSManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1beta2_AWSManagedMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *v1beta2.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.LaunchTemplateID = (*string)(unsafe.Pointer(in.LaunchTemplateID)) - out.LaunchTemplateVersion = (*string)(unsafe.Pointer(in.LaunchTemplateVersion)) - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *v1beta2.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1beta2_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta1_AutoScalingGroup_To_v1beta2_AutoScalingGroup(in *AutoScalingGroup, out *v1beta2.AutoScalingGroup, s conversion.Scope) error { - out.ID = in.ID - out.Tags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.Tags)) - out.Name = in.Name - out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) - out.MaxSize = in.MaxSize - out.MinSize = in.MinSize - out.PlacementGroup = in.PlacementGroup - out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) - out.DefaultCoolDown = in.DefaultCoolDown - out.CapacityRebalance = in.CapacityRebalance - out.MixedInstancesPolicy = (*v1beta2.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) - out.Status = v1beta2.ASGStatus(in.Status) - out.Instances = *(*[]apiv1beta2.Instance)(unsafe.Pointer(&in.Instances)) - return nil -} - -// Convert_v1beta1_AutoScalingGroup_To_v1beta2_AutoScalingGroup is an autogenerated conversion function. -func Convert_v1beta1_AutoScalingGroup_To_v1beta2_AutoScalingGroup(in *AutoScalingGroup, out *v1beta2.AutoScalingGroup, s conversion.Scope) error { - return autoConvert_v1beta1_AutoScalingGroup_To_v1beta2_AutoScalingGroup(in, out, s) -} - -func autoConvert_v1beta2_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *v1beta2.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { - out.ID = in.ID - out.Tags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.Tags)) - out.Name = in.Name - out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) - out.MaxSize = in.MaxSize - out.MinSize = in.MinSize - out.PlacementGroup = in.PlacementGroup - out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) - out.DefaultCoolDown = in.DefaultCoolDown - // WARNING: in.DefaultInstanceWarmup requires manual conversion: does not exist in peer-type - out.CapacityRebalance = in.CapacityRebalance - out.MixedInstancesPolicy = (*MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) - out.Status = ASGStatus(in.Status) - out.Instances = *(*[]apiv1beta2.Instance)(unsafe.Pointer(&in.Instances)) - // WARNING: in.CurrentlySuspendProcesses requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_BlockDeviceMapping_To_v1beta2_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta2.BlockDeviceMapping, s conversion.Scope) error { - out.DeviceName = in.DeviceName - if err := Convert_v1beta1_EBS_To_v1beta2_EBS(&in.Ebs, &out.Ebs, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_BlockDeviceMapping_To_v1beta2_BlockDeviceMapping is an autogenerated conversion function. -func Convert_v1beta1_BlockDeviceMapping_To_v1beta2_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta2.BlockDeviceMapping, s conversion.Scope) error { - return autoConvert_v1beta1_BlockDeviceMapping_To_v1beta2_BlockDeviceMapping(in, out, s) -} - -func autoConvert_v1beta2_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *v1beta2.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { - out.DeviceName = in.DeviceName - if err := Convert_v1beta2_EBS_To_v1beta1_EBS(&in.Ebs, &out.Ebs, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping is an autogenerated conversion function. -func Convert_v1beta2_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *v1beta2.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { - return autoConvert_v1beta2_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in, out, s) -} - -func autoConvert_v1beta1_EBS_To_v1beta2_EBS(in *EBS, out *v1beta2.EBS, s conversion.Scope) error { - out.Encrypted = in.Encrypted - out.VolumeSize = in.VolumeSize - out.VolumeType = in.VolumeType - return nil -} - -// Convert_v1beta1_EBS_To_v1beta2_EBS is an autogenerated conversion function. -func Convert_v1beta1_EBS_To_v1beta2_EBS(in *EBS, out *v1beta2.EBS, s conversion.Scope) error { - return autoConvert_v1beta1_EBS_To_v1beta2_EBS(in, out, s) -} - -func autoConvert_v1beta2_EBS_To_v1beta1_EBS(in *v1beta2.EBS, out *EBS, s conversion.Scope) error { - out.Encrypted = in.Encrypted - out.VolumeSize = in.VolumeSize - out.VolumeType = in.VolumeType - return nil -} - -// Convert_v1beta2_EBS_To_v1beta1_EBS is an autogenerated conversion function. -func Convert_v1beta2_EBS_To_v1beta1_EBS(in *v1beta2.EBS, out *EBS, s conversion.Scope) error { - return autoConvert_v1beta2_EBS_To_v1beta1_EBS(in, out, s) -} - -func autoConvert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec(in *FargateProfileSpec, out *v1beta2.FargateProfileSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.ProfileName = in.ProfileName - out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.RoleName = in.RoleName - out.Selectors = *(*[]v1beta2.FargateSelector)(unsafe.Pointer(&in.Selectors)) - return nil -} - -// Convert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec is an autogenerated conversion function. -func Convert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec(in *FargateProfileSpec, out *v1beta2.FargateProfileSpec, s conversion.Scope) error { - return autoConvert_v1beta1_FargateProfileSpec_To_v1beta2_FargateProfileSpec(in, out, s) -} - -func autoConvert_v1beta2_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *v1beta2.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.ProfileName = in.ProfileName - out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*apiv1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.RoleName = in.RoleName - // WARNING: in.RolePath requires manual conversion: does not exist in peer-type - // WARNING: in.RolePermissionsBoundary requires manual conversion: does not exist in peer-type - out.Selectors = *(*[]FargateSelector)(unsafe.Pointer(&in.Selectors)) - return nil -} - -func autoConvert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus(in *FargateProfileStatus, out *v1beta2.FargateProfileStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus is an autogenerated conversion function. -func Convert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus(in *FargateProfileStatus, out *v1beta2.FargateProfileStatus, s conversion.Scope) error { - return autoConvert_v1beta1_FargateProfileStatus_To_v1beta2_FargateProfileStatus(in, out, s) -} - -func autoConvert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *v1beta2.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus is an autogenerated conversion function. -func Convert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *v1beta2.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { - return autoConvert_v1beta2_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in, out, s) -} - -func autoConvert_v1beta1_FargateSelector_To_v1beta2_FargateSelector(in *FargateSelector, out *v1beta2.FargateSelector, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Namespace = in.Namespace - return nil -} - -// Convert_v1beta1_FargateSelector_To_v1beta2_FargateSelector is an autogenerated conversion function. -func Convert_v1beta1_FargateSelector_To_v1beta2_FargateSelector(in *FargateSelector, out *v1beta2.FargateSelector, s conversion.Scope) error { - return autoConvert_v1beta1_FargateSelector_To_v1beta2_FargateSelector(in, out, s) -} - -func autoConvert_v1beta2_FargateSelector_To_v1beta1_FargateSelector(in *v1beta2.FargateSelector, out *FargateSelector, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Namespace = in.Namespace - return nil -} - -// Convert_v1beta2_FargateSelector_To_v1beta1_FargateSelector is an autogenerated conversion function. -func Convert_v1beta2_FargateSelector_To_v1beta1_FargateSelector(in *v1beta2.FargateSelector, out *FargateSelector, s conversion.Scope) error { - return autoConvert_v1beta2_FargateSelector_To_v1beta1_FargateSelector(in, out, s) -} - -func autoConvert_v1beta1_InstancesDistribution_To_v1beta2_InstancesDistribution(in *InstancesDistribution, out *v1beta2.InstancesDistribution, s conversion.Scope) error { - out.OnDemandAllocationStrategy = v1beta2.OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) - out.SpotAllocationStrategy = v1beta2.SpotAllocationStrategy(in.SpotAllocationStrategy) - out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) - out.OnDemandPercentageAboveBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandPercentageAboveBaseCapacity)) - return nil -} - -// Convert_v1beta1_InstancesDistribution_To_v1beta2_InstancesDistribution is an autogenerated conversion function. -func Convert_v1beta1_InstancesDistribution_To_v1beta2_InstancesDistribution(in *InstancesDistribution, out *v1beta2.InstancesDistribution, s conversion.Scope) error { - return autoConvert_v1beta1_InstancesDistribution_To_v1beta2_InstancesDistribution(in, out, s) -} - -func autoConvert_v1beta2_InstancesDistribution_To_v1beta1_InstancesDistribution(in *v1beta2.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { - out.OnDemandAllocationStrategy = OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) - out.SpotAllocationStrategy = SpotAllocationStrategy(in.SpotAllocationStrategy) - out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) - out.OnDemandPercentageAboveBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandPercentageAboveBaseCapacity)) - return nil -} - -// Convert_v1beta2_InstancesDistribution_To_v1beta1_InstancesDistribution is an autogenerated conversion function. -func Convert_v1beta2_InstancesDistribution_To_v1beta1_InstancesDistribution(in *v1beta2.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { - return autoConvert_v1beta2_InstancesDistribution_To_v1beta1_InstancesDistribution(in, out, s) -} - -func autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1beta2_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta2.ManagedMachinePoolScaling, s conversion.Scope) error { - out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) - out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) - return nil -} - -// Convert_v1beta1_ManagedMachinePoolScaling_To_v1beta2_ManagedMachinePoolScaling is an autogenerated conversion function. -func Convert_v1beta1_ManagedMachinePoolScaling_To_v1beta2_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta2.ManagedMachinePoolScaling, s conversion.Scope) error { - return autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1beta2_ManagedMachinePoolScaling(in, out, s) -} - -func autoConvert_v1beta2_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *v1beta2.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { - out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) - out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) - return nil -} - -// Convert_v1beta2_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling is an autogenerated conversion function. -func Convert_v1beta2_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *v1beta2.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { - return autoConvert_v1beta2_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in, out, s) -} - -func autoConvert_v1beta1_ManagedRemoteAccess_To_v1beta2_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta2.ManagedRemoteAccess, s conversion.Scope) error { - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) - out.Public = in.Public - return nil -} - -// Convert_v1beta1_ManagedRemoteAccess_To_v1beta2_ManagedRemoteAccess is an autogenerated conversion function. -func Convert_v1beta1_ManagedRemoteAccess_To_v1beta2_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta2.ManagedRemoteAccess, s conversion.Scope) error { - return autoConvert_v1beta1_ManagedRemoteAccess_To_v1beta2_ManagedRemoteAccess(in, out, s) -} - -func autoConvert_v1beta2_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *v1beta2.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { - out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) - out.Public = in.Public - return nil -} - -// Convert_v1beta2_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess is an autogenerated conversion function. -func Convert_v1beta2_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *v1beta2.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { - return autoConvert_v1beta2_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in, out, s) -} - -func autoConvert_v1beta1_MixedInstancesPolicy_To_v1beta2_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta2.MixedInstancesPolicy, s conversion.Scope) error { - out.InstancesDistribution = (*v1beta2.InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) - out.Overrides = *(*[]v1beta2.Overrides)(unsafe.Pointer(&in.Overrides)) - return nil -} - -// Convert_v1beta1_MixedInstancesPolicy_To_v1beta2_MixedInstancesPolicy is an autogenerated conversion function. -func Convert_v1beta1_MixedInstancesPolicy_To_v1beta2_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta2.MixedInstancesPolicy, s conversion.Scope) error { - return autoConvert_v1beta1_MixedInstancesPolicy_To_v1beta2_MixedInstancesPolicy(in, out, s) -} - -func autoConvert_v1beta2_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *v1beta2.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { - out.InstancesDistribution = (*InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) - out.Overrides = *(*[]Overrides)(unsafe.Pointer(&in.Overrides)) - return nil -} - -// Convert_v1beta2_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy is an autogenerated conversion function. -func Convert_v1beta2_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *v1beta2.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { - return autoConvert_v1beta2_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in, out, s) -} - -func autoConvert_v1beta1_Overrides_To_v1beta2_Overrides(in *Overrides, out *v1beta2.Overrides, s conversion.Scope) error { - out.InstanceType = in.InstanceType - return nil -} - -// Convert_v1beta1_Overrides_To_v1beta2_Overrides is an autogenerated conversion function. -func Convert_v1beta1_Overrides_To_v1beta2_Overrides(in *Overrides, out *v1beta2.Overrides, s conversion.Scope) error { - return autoConvert_v1beta1_Overrides_To_v1beta2_Overrides(in, out, s) -} - -func autoConvert_v1beta2_Overrides_To_v1beta1_Overrides(in *v1beta2.Overrides, out *Overrides, s conversion.Scope) error { - out.InstanceType = in.InstanceType - return nil -} - -// Convert_v1beta2_Overrides_To_v1beta1_Overrides is an autogenerated conversion function. -func Convert_v1beta2_Overrides_To_v1beta1_Overrides(in *v1beta2.Overrides, out *Overrides, s conversion.Scope) error { - return autoConvert_v1beta2_Overrides_To_v1beta1_Overrides(in, out, s) -} - -func autoConvert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences(in *RefreshPreferences, out *v1beta2.RefreshPreferences, s conversion.Scope) error { - out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) - out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) - out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) - return nil -} - -// Convert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences is an autogenerated conversion function. -func Convert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences(in *RefreshPreferences, out *v1beta2.RefreshPreferences, s conversion.Scope) error { - return autoConvert_v1beta1_RefreshPreferences_To_v1beta2_RefreshPreferences(in, out, s) -} - -func autoConvert_v1beta2_RefreshPreferences_To_v1beta1_RefreshPreferences(in *v1beta2.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { - // WARNING: in.Disable requires manual conversion: does not exist in peer-type - out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) - out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) - out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) - // WARNING: in.MaxHealthyPercentage requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_Taint_To_v1beta2_Taint(in *Taint, out *v1beta2.Taint, s conversion.Scope) error { - out.Effect = v1beta2.TaintEffect(in.Effect) - out.Key = in.Key - out.Value = in.Value - return nil -} - -// Convert_v1beta1_Taint_To_v1beta2_Taint is an autogenerated conversion function. -func Convert_v1beta1_Taint_To_v1beta2_Taint(in *Taint, out *v1beta2.Taint, s conversion.Scope) error { - return autoConvert_v1beta1_Taint_To_v1beta2_Taint(in, out, s) -} - -func autoConvert_v1beta2_Taint_To_v1beta1_Taint(in *v1beta2.Taint, out *Taint, s conversion.Scope) error { - out.Effect = TaintEffect(in.Effect) - out.Key = in.Key - out.Value = in.Value - return nil -} - -// Convert_v1beta2_Taint_To_v1beta1_Taint is an autogenerated conversion function. -func Convert_v1beta2_Taint_To_v1beta1_Taint(in *v1beta2.Taint, out *Taint, s conversion.Scope) error { - return autoConvert_v1beta2_Taint_To_v1beta1_Taint(in, out, s) -} - -func autoConvert_v1beta1_UpdateConfig_To_v1beta2_UpdateConfig(in *UpdateConfig, out *v1beta2.UpdateConfig, s conversion.Scope) error { - out.MaxUnavailable = (*int)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxUnavailablePercentage = (*int)(unsafe.Pointer(in.MaxUnavailablePercentage)) - return nil -} - -// Convert_v1beta1_UpdateConfig_To_v1beta2_UpdateConfig is an autogenerated conversion function. -func Convert_v1beta1_UpdateConfig_To_v1beta2_UpdateConfig(in *UpdateConfig, out *v1beta2.UpdateConfig, s conversion.Scope) error { - return autoConvert_v1beta1_UpdateConfig_To_v1beta2_UpdateConfig(in, out, s) -} - -func autoConvert_v1beta2_UpdateConfig_To_v1beta1_UpdateConfig(in *v1beta2.UpdateConfig, out *UpdateConfig, s conversion.Scope) error { - out.MaxUnavailable = (*int)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxUnavailablePercentage = (*int)(unsafe.Pointer(in.MaxUnavailablePercentage)) - return nil -} - -// Convert_v1beta2_UpdateConfig_To_v1beta1_UpdateConfig is an autogenerated conversion function. -func Convert_v1beta2_UpdateConfig_To_v1beta1_UpdateConfig(in *v1beta2.UpdateConfig, out *UpdateConfig, s conversion.Scope) error { - return autoConvert_v1beta2_UpdateConfig_To_v1beta1_UpdateConfig(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/OWNERS b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/OWNERS deleted file mode 100644 index c8a9655900e3..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs: - -filters: - "^(rosa|zz_).*\\.go$": - approvers: - - muraee - - serngawy - reviewers: - - serngawy diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_types.go deleted file mode 100644 index 453fd4b724b4..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_types.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -var ( - // DefaultEKSFargateRole is the name of the default IAM role to use for fargate - // profiles if no other role is supplied in the spec and if iam role creation - // is not enabled. The default can be created using clusterawsadm or created manually. - DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", iamv1.DefaultNameSuffix) -) - -// FargateProfileSpec defines the desired state of FargateProfile. -type FargateProfileSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // ProfileName specifies the profile name. - ProfileName string `json:"profileName,omitempty"` - - // SubnetIDs specifies which subnets are used for the - // auto scaling group of this nodegroup. - // +optional - SubnetIDs []string `json:"subnetIDs,omitempty"` - - // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the - // ones added by default. - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // RoleName specifies the name of IAM role for this fargate pool - // If the role is pre-existing we will treat it as unmanaged - // and not delete it on deletion. If the EKSEnableIAM feature - // flag is true and no name is supplied then a role is created. - // +optional - RoleName string `json:"roleName,omitempty"` - - // RolePath sets the path to the role. For more information about paths, see IAM Identifiers - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - // +optional - RolePath string `json:"rolePath,omitempty"` - - // RolePermissionsBoundary sets the ARN of the managed policy that is used - // to set the permissions boundary for the role. - // - // A permissions boundary policy defines the maximum permissions that identity-based - // policies can grant to an entity, but does not grant permissions. Permissions - // boundaries do not define the maximum permissions that a resource-based policy - // can grant to an entity. To learn more, see Permissions boundaries for IAM - // entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) - // in the IAM User Guide. - // - // For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types) - // in the IAM User Guide. - // +optional - RolePermissionsBoundary string `json:"rolePermissionsBoundary,omitempty"` - - // Selectors specify fargate pod selectors. - Selectors []FargateSelector `json:"selectors,omitempty"` -} - -// FargateSelector specifies a selector for pods that should run on this fargate pool. -type FargateSelector struct { - // Labels specifies which pod labels this selector should match. - Labels map[string]string `json:"labels,omitempty"` - - // Namespace specifies which namespace this selector should match. - Namespace string `json:"namespace,omitempty"` -} - -// FargateProfileStatus defines the observed state of FargateProfile. -type FargateProfileStatus struct { - // Ready denotes that the FargateProfile is available. - // +kubebuilder:default=false - Ready bool `json:"ready"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the FargateProfile and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the FargateProfile's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // FargateProfiles can be added as events to the FargateProfile object - // and/or logged in the controller's output. - // +optional - FailureReason *string `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the FargateProfile and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the FargateProfile's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // FargateProfiles can be added as events to the FargateProfile - // object and/or logged in the controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Conditions defines current state of the Fargate profile. - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=awsfargateprofiles,scope=Namespaced,categories=cluster-api,shortName=awsfp -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="AWSFargateProfile ready status" -// +kubebuilder:printcolumn:name="ProfileName",type="string",JSONPath=".spec.profileName",description="EKS Fargate profile name" -// +kubebuilder:printcolumn:name="FailureReason",type="string",JSONPath=".status.failureReason",description="Failure reason" - -// AWSFargateProfile is the Schema for the awsfargateprofiles API. -type AWSFargateProfile struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec FargateProfileSpec `json:"spec,omitempty"` - Status FargateProfileStatus `json:"status,omitempty"` -} - -// GetConditions returns the observations of the operational state of the AWSFargateProfile resource. -func (r *AWSFargateProfile) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1beta1.Conditions. -func (r *AWSFargateProfile) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// AWSFargateProfileList contains a list of FargateProfiles. -type AWSFargateProfileList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSFargateProfile `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSFargateProfile{}, &AWSFargateProfileList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_webhook.go deleted file mode 100644 index f0cb893cb846..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsfargateprofile_webhook.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -const ( - maxProfileNameLength = 100 - maxIAMRoleNameLength = 64 -) - -// SetupWebhookWithManager will setup the webhooks for the AWSFargateProfile. -func (r *AWSFargateProfile) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsFargateProfileWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsfargateprofile,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1beta2,name=default.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsfargateprofile,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1beta2,name=validation.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsFargateProfileWebhook struct{} - -var ( - _ webhook.CustomDefaulter = &awsFargateProfileWebhook{} - _ webhook.CustomValidator = &awsFargateProfileWebhook{} -) - -// Default will set default values for the AWSFargateProfile. -func (*awsFargateProfileWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSFargateProfile) - if !ok { - return fmt.Errorf("expected an AWSFargateProfile object but got %T", r) - } - - if r.Labels == nil { - r.Labels = make(map[string]string) - } - r.Labels[clusterv1beta1.ClusterNameLabel] = r.Spec.ClusterName - - if r.Spec.ProfileName == "" { - name, err := eks.GenerateEKSName(r.Name, r.Namespace, maxProfileNameLength) - if err != nil { - mmpLog.Error(err, "failed to create EKS nodegroup name") - return nil - } - - r.Spec.ProfileName = name - } - return nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*awsFargateProfileWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSFargateProfile) - if !ok { - return nil, fmt.Errorf("expected an AWSFargateProfile object but got %T", r) - } - - gv := r.GroupVersionKind().GroupKind() - old, ok := oldObj.(*AWSFargateProfile) - if !ok { - return nil, apierrors.NewInvalid(gv, r.Name, field.ErrorList{ - field.InternalError(nil, errors.Errorf("failed to convert old %s to object", gv.Kind)), - }) - } - - var allErrs field.ErrorList - - // Spec is immutable, but if the new RoleName is the generated one(or default if EnableIAM is disabled) and - // the old RoleName is nil, then ignore checking that field. - if old.Spec.RoleName == "" { - roleName, err := eks.GenerateEKSName( - "fargate", - fmt.Sprintf("%s-%s", r.Spec.ClusterName, r.Spec.ProfileName), - maxIAMRoleNameLength, - ) - if err != nil { - mmpLog.Error(err, "failed to create EKS fargate role name") - } - - if r.Spec.RoleName == roleName || r.Spec.RoleName == DefaultEKSFargateRole { - r.Spec.RoleName = "" - } - } - - // Spec is immutable, but if the new ProfileName is the defaulted one and - // the old ProfileName is nil, then ignore checking that field. - if old.Spec.ProfileName == "" { - name, err := eks.GenerateEKSName(old.Name, old.Namespace, maxProfileNameLength) - if err != nil { - mmpLog.Error(err, "failed to create EKS nodegroup name") - } - if r.Spec.ProfileName == name { - r.Spec.ProfileName = "" - } - } - - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - // remove additionalTags from equal check since they are mutable - old.Spec.AdditionalTags = nil - r.Spec.AdditionalTags = nil - - if !cmp.Equal(old.Spec, r.Spec) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec"), r.Spec, "is immutable"), - ) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - gv, - r.Name, - allErrs, - ) -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*awsFargateProfileWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSFargateProfile) - if !ok { - return nil, fmt.Errorf("expected an AWSFargateProfile object but got %T", r) - } - - var allErrs field.ErrorList - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*awsFargateProfileWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmachinepool_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmachinepool_webhook.go deleted file mode 100644 index 478ec233749f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmachinepool_webhook.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/klog/v2" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - "sigs.k8s.io/cluster-api-provider-aws/v2/feature" -) - -var log = ctrl.Log.WithName("awsmachinepool-resource") - -// SetupWebhookWithManager will setup the webhooks for the AWSMachinePool. -func (r *AWSMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(AWSMachinePoolWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1beta2,name=validation.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1beta2,name=default.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// AWSMachinePoolWebhook implements a custom validation webhook for AWSMachinePool. -type AWSMachinePoolWebhook struct{} - -var _ webhook.CustomDefaulter = &AWSMachinePoolWebhook{} -var _ webhook.CustomValidator = &AWSMachinePoolWebhook{} - -func (r *AWSMachinePool) validateDefaultCoolDown() field.ErrorList { - var allErrs field.ErrorList - - if int(r.Spec.DefaultCoolDown.Duration.Seconds()) < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.DefaultCoolDown"), "DefaultCoolDown must be greater than zero")) - } - - return allErrs -} - -func (r *AWSMachinePool) validateRootVolume() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.AWSLaunchTemplate.RootVolume == nil { - return allErrs - } - - if infrav1.VolumeTypesProvisioned.Has(string(r.Spec.AWSLaunchTemplate.RootVolume.Type)) && r.Spec.AWSLaunchTemplate.RootVolume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.awsLaunchTemplate.rootVolume.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if r.Spec.AWSLaunchTemplate.RootVolume.Throughput != nil { - if r.Spec.AWSLaunchTemplate.RootVolume.Type != infrav1.VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.awsLaunchTemplate.rootVolume.throughput"), "throughput is valid only for type 'gp3'")) - } - if *r.Spec.AWSLaunchTemplate.RootVolume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.awsLaunchTemplate.rootVolume.throughput"), "throughput must be nonnegative")) - } - } - - if r.Spec.AWSLaunchTemplate.RootVolume.DeviceName != "" { - log.Info("root volume shouldn't have a device name (this can be ignored if performing a `clusterctl move`)") - } - - return allErrs -} - -func (r *AWSMachinePool) validateNonRootVolumes() field.ErrorList { - var allErrs field.ErrorList - - for _, volume := range r.Spec.AWSLaunchTemplate.NonRootVolumes { - if infrav1.VolumeTypesProvisioned.Has(string(volume.Type)) && volume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if volume.Throughput != nil { - if volume.Type != infrav1.VolumeTypeGP3 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.throughput"), "throughput is valid only for type 'gp3'")) - } - if *volume.Throughput < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.throughput"), "throughput must be nonnegative")) - } - } - - if volume.DeviceName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.template.spec.nonRootVolumes.deviceName"), "non root volume should have device name")) - } - } - - return allErrs -} - -func (r *AWSMachinePool) validateSubnets() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.Subnets == nil { - return allErrs - } - - for _, subnet := range r.Spec.Subnets { - if subnet.ID != nil && subnet.Filters != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.subnets.filters"), "providing either subnet ID or filter is supported, should not provide both")) - break - } - } - - return allErrs -} - -func (r *AWSMachinePool) validateAdditionalSecurityGroups() field.ErrorList { - var allErrs field.ErrorList - for _, sg := range r.Spec.AWSLaunchTemplate.AdditionalSecurityGroups { - if sg.ID != nil && sg.Filters != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.AdditionalSecurityGroups"), "either ID or filters should be used")) - } - } - return allErrs -} - -func (r *AWSMachinePool) validateSpotInstances() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.AWSLaunchTemplate.SpotMarketOptions != nil && r.Spec.MixedInstancesPolicy != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.spotMarketOptions"), "either spec.awsLaunchTemplate.spotMarketOptions or spec.mixedInstancesPolicy should be used")) - } - return allErrs -} - -func (r *AWSMachinePool) validateRefreshPreferences() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.RefreshPreferences == nil { - return allErrs - } - - if r.Spec.RefreshPreferences.MaxHealthyPercentage != nil && r.Spec.RefreshPreferences.MinHealthyPercentage == nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.refreshPreferences.maxHealthyPercentage"), "If you specify spec.refreshPreferences.maxHealthyPercentage, you must also specify spec.refreshPreferences.minHealthyPercentage")) - } - - if r.Spec.RefreshPreferences.MaxHealthyPercentage != nil && r.Spec.RefreshPreferences.MinHealthyPercentage != nil { - if *r.Spec.RefreshPreferences.MaxHealthyPercentage-*r.Spec.RefreshPreferences.MinHealthyPercentage > 100 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.refreshPreferences.maxHealthyPercentage"), "the difference between spec.refreshPreferences.maxHealthyPercentage and spec.refreshPreferences.minHealthyPercentage cannot be greater than 100")) - } - } - - return allErrs -} - -func (r *AWSMachinePool) validateLifecycleHooks() field.ErrorList { - return validateLifecycleHooks(r.Spec.AWSLifecycleHooks) -} - -func (r *AWSMachinePool) ignitionEnabled() bool { - return r.Spec.Ignition != nil -} - -func (r *AWSMachinePool) validateIgnition() field.ErrorList { - var allErrs field.ErrorList - - // Feature gate is not enabled but ignition is enabled then send a forbidden error. - if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) && r.ignitionEnabled() { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition"), - "can be set only if the BootstrapFormatIgnition feature gate is enabled")) - } - - return allErrs -} - -// ValidateCreate will do any extra validation when creating a AWSMachinePool. -func (*AWSMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSMachinePool) - if !ok { - return nil, fmt.Errorf("expected an AWSMachinePool object but got %T", r) - } - - log.Info("AWSMachinePool validate create", "machine-pool", klog.KObj(r)) - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateDefaultCoolDown()...) - allErrs = append(allErrs, r.validateRootVolume()...) - allErrs = append(allErrs, r.validateNonRootVolumes()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.validateSubnets()...) - allErrs = append(allErrs, r.validateAdditionalSecurityGroups()...) - allErrs = append(allErrs, r.validateSpotInstances()...) - allErrs = append(allErrs, r.validateRefreshPreferences()...) - allErrs = append(allErrs, r.validateInstanceMarketType()...) - allErrs = append(allErrs, r.validateCapacityReservation()...) - allErrs = append(allErrs, r.validateLifecycleHooks()...) - allErrs = append(allErrs, r.validateIgnition()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -func (r *AWSMachinePool) validateCapacityReservation() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.AWSLaunchTemplate.CapacityReservationID != nil && - r.Spec.AWSLaunchTemplate.CapacityReservationPreference != infrav1.CapacityReservationPreferenceOnly && - r.Spec.AWSLaunchTemplate.CapacityReservationPreference != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "capacityReservationPreference"), "when capacityReservationId is specified, capacityReservationPreference may only be `CapacityReservationsOnly` or empty")) - } - return allErrs -} - -func (r *AWSMachinePool) validateInstanceMarketType() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.AWSLaunchTemplate.MarketType == infrav1.MarketTypeCapacityBlock && r.Spec.AWSLaunchTemplate.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.marketType"), "setting marketType to CapacityBlock and spotMarketOptions cannot be used together")) - } - if r.Spec.AWSLaunchTemplate.MarketType == infrav1.MarketTypeOnDemand && r.Spec.AWSLaunchTemplate.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.marketType"), "setting marketType to OnDemand and spotMarketOptions cannot be used together")) - } - - if r.Spec.AWSLaunchTemplate.MarketType == infrav1.MarketTypeCapacityBlock && r.Spec.AWSLaunchTemplate.CapacityReservationID == nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.capacityReservationID"), "is required when CapacityBlock is provided")) - } - switch r.Spec.AWSLaunchTemplate.MarketType { - case "", infrav1.MarketTypeOnDemand, infrav1.MarketTypeSpot, infrav1.MarketTypeCapacityBlock: - default: - allErrs = append(allErrs, field.Invalid(field.NewPath("spec.awsLaunchTemplate.marketType"), r.Spec.AWSLaunchTemplate.MarketType, fmt.Sprintf("Valid values are: %s, %s, %s and omitted", infrav1.MarketTypeOnDemand, infrav1.MarketTypeSpot, infrav1.MarketTypeCapacityBlock))) - } - if r.Spec.AWSLaunchTemplate.MarketType == infrav1.MarketTypeSpot && r.Spec.AWSLaunchTemplate.CapacityReservationID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.marketType"), "cannot be set to 'Spot' when CapacityReservationID is specified")) - } - - if r.Spec.AWSLaunchTemplate.CapacityReservationID != nil && r.Spec.AWSLaunchTemplate.SpotMarketOptions != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.spotMarketOptions"), "cannot be set to when CapacityReservationID is specified")) - } - - return allErrs -} - -// ValidateUpdate will do any extra validation when updating a AWSMachinePool. -func (*AWSMachinePoolWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSMachinePool) - if !ok { - return nil, fmt.Errorf("expected an AWSMachinePool object but got %T", r) - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateDefaultCoolDown()...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - allErrs = append(allErrs, r.validateSubnets()...) - allErrs = append(allErrs, r.validateAdditionalSecurityGroups()...) - allErrs = append(allErrs, r.validateSpotInstances()...) - allErrs = append(allErrs, r.validateRefreshPreferences()...) - allErrs = append(allErrs, r.validateLifecycleHooks()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete allows you to add any extra validation when deleting. -func (*AWSMachinePoolWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default will set default values for the AWSMachinePool. -func (*AWSMachinePoolWebhook) Default(ctx context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSMachinePool) - if !ok { - return fmt.Errorf("expected an AWSMachinePool object but got %T", r) - } - - if int(r.Spec.DefaultCoolDown.Duration.Seconds()) == 0 { - log.Info("DefaultCoolDown is zero, setting 300 seconds as default") - r.Spec.DefaultCoolDown.Duration = 300 * time.Second - } - - if int(r.Spec.DefaultInstanceWarmup.Duration.Seconds()) == 0 { - log.Info("DefaultInstanceWarmup is zero, setting 300 seconds as default") - r.Spec.DefaultInstanceWarmup.Duration = 300 * time.Second - } - - if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" { - r.Spec.Ignition.StorageType = infrav1.DefaultMachinePoolIgnitionStorageType - } - // Defaults the version field if StorageType is not set to `UnencryptedUserData`. - // When using `UnencryptedUserData` the version field is ignored because the userdata defines its version itself. - if r.ignitionEnabled() && r.Spec.Ignition.Version == "" && r.Spec.Ignition.StorageType != infrav1.IgnitionStorageTypeOptionUnencryptedUserData { - r.Spec.Ignition.Version = infrav1.DefaultIgnitionVersion - } - - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_types.go deleted file mode 100644 index 8e761a506f18..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_types.go +++ /dev/null @@ -1,350 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - iamv1 "sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool. -// Source of truth can be found using the link below: -// https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateNodegroup.html#AmazonEKS-CreateNodegroup-request-amiType -type ManagedMachineAMIType string - -const ( - // Al2x86_64 is the default AMI type. - Al2x86_64 ManagedMachineAMIType = "AL2_x86_64" - // Al2x86_64GPU is the x86-64 GPU AMI type. - Al2x86_64GPU ManagedMachineAMIType = "AL2_x86_64_GPU" - // Al2Arm64 is the Arm AMI type. - Al2Arm64 ManagedMachineAMIType = "AL2_ARM_64" - // Custom is the custom AMI type. - Custom ManagedMachineAMIType = "CUSTOM" - // BottleRocketArm64 is the Arm AMI type. - BottleRocketArm64 ManagedMachineAMIType = "BOTTLEROCKET_ARM_64" - // BottleRocketx86_64 is the BottleRocket x86-64 AMI type. - BottleRocketx86_64 ManagedMachineAMIType = "BOTTLEROCKET_x86_64" - // BottleRocketArm64Fips is the BottleRocket Arm Fips AMI type. - BottleRocketArm64Fips ManagedMachineAMIType = "BOTTLEROCKET_ARM_64_FIPS" - // BottleRocketx86_64Fips is the BottleRocket x86-64 Fips AMI type. - BottleRocketx86_64Fips ManagedMachineAMIType = "BOTTLEROCKET_x86_64_FIPS" - // BottleRocketArm64Nvidia is the BottleRocket Arm Nvidia AMI type. - BottleRocketArm64Nvidia ManagedMachineAMIType = "BOTTLEROCKET_ARM_64_NVIDIA" - // BottleRocketx86_64Nvidia is the BottleRocket x86-64 Nvidia AMI type. - BottleRocketx86_64Nvidia ManagedMachineAMIType = "BOTTLEROCKET_x86_64_NVIDIA" - // WindowsCore2019x86_64 is the Windows Core 2019 x86-64 AMI type. - WindowsCore2019x86_64 ManagedMachineAMIType = "WINDOWS_CORE_2019_x86_64" - // WindowsFull2019x86_64 is the Windows Full 2019 x86-64 AMI type. - WindowsFull2019x86_64 ManagedMachineAMIType = "WINDOWS_FULL_2019_x86_64" - // WindowsCore2022x86_64 is the Windows Core 2022 x86-64 AMI type. - WindowsCore2022x86_64 ManagedMachineAMIType = "WINDOWS_CORE_2022_x86_64" - // WindowsFull2022x86_64 is the Windows Full 2022 x86-64 AMI type. - WindowsFull2022x86_64 ManagedMachineAMIType = "WINDOWS_FULL_2022_x86_64" - // Al2023x86_64 is the AL2023 x86-64 AMI type. - Al2023x86_64 ManagedMachineAMIType = "AL2023_x86_64_STANDARD" - // Al2023Arm64 is the AL2023 Arm AMI type. - Al2023Arm64 ManagedMachineAMIType = "AL2023_ARM_64_STANDARD" - // Al2023x86_64Neuron is the AL2023 x86-64 Neuron AMI type. - Al2023x86_64Neuron ManagedMachineAMIType = "AL2023_x86_64_NEURON" - // Al2023x86_64Nvidia is the AL2023 x86-64 Nvidia AMI type. - Al2023x86_64Nvidia ManagedMachineAMIType = "AL2023_x86_64_NVIDIA" - // Al2023Arm64Nvidia is the AL2023 Arm Nvidia AMI type. - Al2023Arm64Nvidia ManagedMachineAMIType = "AL2023_ARM_64_NVIDIA" -) - -// ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool. -type ManagedMachinePoolCapacityType string - -const ( - // ManagedMachinePoolCapacityTypeOnDemand is the default capacity type, to launch on-demand instances. - ManagedMachinePoolCapacityTypeOnDemand ManagedMachinePoolCapacityType = "onDemand" - // ManagedMachinePoolCapacityTypeSpot is the spot instance capacity type to launch spot instances. - ManagedMachinePoolCapacityTypeSpot ManagedMachinePoolCapacityType = "spot" -) - -var ( - // DefaultEKSNodegroupRole is the name of the default IAM role to use for EKS nodegroups - // if no other role is supplied in the spec and if iam role creation is not enabled. The default - // can be created using clusterawsadm or created manually. - DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", iamv1.DefaultNameSuffix) -) - -// AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool. -type AWSManagedMachinePoolSpec struct { - // EKSNodegroupName specifies the name of the nodegroup in AWS - // corresponding to this MachinePool. If you don't specify a name - // then a default name will be created based on the namespace and - // name of the managed machine pool. - // +optional - EKSNodegroupName string `json:"eksNodegroupName,omitempty"` - - // AvailabilityZones is an array of availability zones instances can run in - AvailabilityZones []string `json:"availabilityZones,omitempty"` - - // AvailabilityZoneSubnetType specifies which type of subnets to use when an availability zone is specified. - // +kubebuilder:validation:Enum:=public;private;all - // +optional - AvailabilityZoneSubnetType *AZSubnetType `json:"availabilityZoneSubnetType,omitempty"` - - // SubnetIDs specifies which subnets are used for the - // auto scaling group of this nodegroup - // +optional - SubnetIDs []string `json:"subnetIDs,omitempty"` - - // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the - // ones added by default. - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // RoleAdditionalPolicies allows you to attach additional polices to - // the node group role. You must enable the EKSAllowAddRoles - // feature flag to incorporate these into the created role. - // +optional - RoleAdditionalPolicies []string `json:"roleAdditionalPolicies,omitempty"` - - // RoleName specifies the name of IAM role for the node group. - // If the role is pre-existing we will treat it as unmanaged - // and not delete it on deletion. If the EKSEnableIAM feature - // flag is true and no name is supplied then a role is created. - // +optional - RoleName string `json:"roleName,omitempty"` - - // RolePath sets the path to the role. For more information about paths, see IAM Identifiers - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the IAM User Guide. - // - // This parameter is optional. If it is not included, it defaults to a slash - // (/). - RolePath string `json:"rolePath,omitempty"` - - // RolePermissionsBoundary sets the ARN of the managed policy that is used - // to set the permissions boundary for the role. - // - // A permissions boundary policy defines the maximum permissions that identity-based - // policies can grant to an entity, but does not grant permissions. Permissions - // boundaries do not define the maximum permissions that a resource-based policy - // can grant to an entity. To learn more, see Permissions boundaries for IAM - // entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) - // in the IAM User Guide. - // - // For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types) - // in the IAM User Guide. - RolePermissionsBoundary string `json:"rolePermissionsBoundary,omitempty"` - - // AMIVersion defines the desired AMI release version. If no version number - // is supplied then the latest version for the Kubernetes version - // will be used - // +kubebuilder:validation:MinLength:=2 - // +optional - AMIVersion *string `json:"amiVersion,omitempty"` - - // AMIType defines the AMI type - // +kubebuilder:validation:Enum:=AL2_x86_64;AL2_x86_64_GPU;AL2_ARM_64;CUSTOM;BOTTLEROCKET_ARM_64;BOTTLEROCKET_x86_64;BOTTLEROCKET_ARM_64_FIPS;BOTTLEROCKET_x86_64_FIPS;BOTTLEROCKET_ARM_64_NVIDIA;BOTTLEROCKET_x86_64_NVIDIA;WINDOWS_CORE_2019_x86_64;WINDOWS_FULL_2019_x86_64;WINDOWS_CORE_2022_x86_64;WINDOWS_FULL_2022_x86_64;AL2023_x86_64_STANDARD;AL2023_ARM_64_STANDARD;AL2023_x86_64_NEURON;AL2023_x86_64_NVIDIA;AL2023_ARM_64_NVIDIA - // +kubebuilder:default:=AL2_x86_64 - // +optional - AMIType *ManagedMachineAMIType `json:"amiType,omitempty"` - - // Labels specifies labels for the Kubernetes node objects - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // Taints specifies the taints to apply to the nodes of the machine pool - // +optional - Taints Taints `json:"taints,omitempty"` - - // DiskSize specifies the root disk size - // +optional - DiskSize *int32 `json:"diskSize,omitempty"` - - // InstanceType specifies the AWS instance type - // +optional - InstanceType *string `json:"instanceType,omitempty"` - - // Scaling specifies scaling for the ASG behind this pool - // +optional - Scaling *ManagedMachinePoolScaling `json:"scaling,omitempty"` - - // RemoteAccess specifies how machines can be accessed remotely - // +optional - RemoteAccess *ManagedRemoteAccess `json:"remoteAccess,omitempty"` - - // ProviderIDList are the provider IDs of instances in the - // autoscaling group corresponding to the nodegroup represented by this - // machine pool - // +optional - ProviderIDList []string `json:"providerIDList,omitempty"` - - // CapacityType specifies the capacity type for the ASG behind this pool - // +kubebuilder:validation:Enum:=onDemand;spot - // +kubebuilder:default:=onDemand - // +optional - CapacityType *ManagedMachinePoolCapacityType `json:"capacityType,omitempty"` - - // UpdateConfig holds the optional config to control the behaviour of the update - // to the nodegroup. - // +optional - UpdateConfig *UpdateConfig `json:"updateConfig,omitempty"` - - // AWSLaunchTemplate specifies the launch template to use to create the managed node group. - // If AWSLaunchTemplate is specified, certain node group configuraions outside of launch template - // are prohibited (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html). - // +optional - AWSLaunchTemplate *AWSLaunchTemplate `json:"awsLaunchTemplate,omitempty"` - - // AWSLifecycleHooks specifies lifecycle hooks for the managed node group. - // +optional - AWSLifecycleHooks []AWSLifecycleHook `json:"lifecycleHooks,omitempty"` - - // NodeRepairConfig specifies the node auto repair configuration for the managed node group. - // +optional - NodeRepairConfig *NodeRepairConfig `json:"nodeRepairConfig,omitempty"` -} - -// ManagedMachinePoolScaling specifies scaling options. -type ManagedMachinePoolScaling struct { - MinSize *int32 `json:"minSize,omitempty"` - MaxSize *int32 `json:"maxSize,omitempty"` -} - -// ManagedRemoteAccess specifies remote access settings for EC2 instances. -type ManagedRemoteAccess struct { - // SSHKeyName specifies which EC2 SSH key can be used to access machines. - // If left empty, the key from the control plane is used. - SSHKeyName *string `json:"sshKeyName,omitempty"` - - // SourceSecurityGroups specifies which security groups are allowed access - SourceSecurityGroups []string `json:"sourceSecurityGroups,omitempty"` - - // Public specifies whether to open port 22 to the public internet - Public bool `json:"public,omitempty"` -} - -// AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool. -type AWSManagedMachinePoolStatus struct { - // Ready denotes that the AWSManagedMachinePool nodegroup has joined - // the cluster - // +kubebuilder:default=false - Ready bool `json:"ready"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas"` - - // The ID of the launch template - // +optional - LaunchTemplateID *string `json:"launchTemplateID,omitempty"` - - // The version of the launch template - // +optional - LaunchTemplateVersion *string `json:"launchTemplateVersion,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the MachinePool and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of MachinePools - // can be added as events to the MachinePool object and/or logged in the - // controller's output. - // +optional - FailureReason *string `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the MachinePool and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachinePool's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of MachinePools - // can be added as events to the MachinePool object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Conditions defines current service state of the managed machine pool - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// NodeRepairConfig defines the node auto repair configuration for managed node groups. -type NodeRepairConfig struct { - // Enabled specifies whether node auto repair is enabled for the node group. - // When enabled, EKS will automatically repair unhealthy nodes by replacing them. - // +optional - // +kubebuilder:default=false - Enabled *bool `json:"enabled,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=awsmanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmmp -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="MachinePool ready status" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Number of replicas" - -// AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API. -type AWSManagedMachinePool struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AWSManagedMachinePoolSpec `json:"spec,omitempty"` - Status AWSManagedMachinePoolStatus `json:"status,omitempty"` -} - -// GetConditions returns the observations of the operational state of the AWSManagedMachinePool resource. -func (r *AWSManagedMachinePool) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1beta1.Conditions. -func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// AWSManagedMachinePoolList contains a list of AWSManagedMachinePools. -type AWSManagedMachinePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AWSManagedMachinePool `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AWSManagedMachinePool{}, &AWSManagedMachinePoolList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_webhook.go deleted file mode 100644 index 38ceffe3f3b7..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/awsmanagedmachinepool_webhook.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "context" - "fmt" - "reflect" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/klog/v2" - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks" -) - -const ( - maxNodegroupNameLength = 64 -) - -// log is for logging in this package. -var mmpLog = ctrl.Log.WithName("awsmanagedmachinepool-resource") - -// SetupWebhookWithManager will setup the webhooks for the AWSManagedMachinePool. -func (r *AWSManagedMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(awsManagedMachinePoolWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-awsmanagedmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1beta2,name=validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-awsmanagedmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1beta2,name=default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type awsManagedMachinePoolWebhook struct{} - -var _ webhook.CustomDefaulter = &awsManagedMachinePoolWebhook{} -var _ webhook.CustomValidator = &awsManagedMachinePoolWebhook{} - -func (r *AWSManagedMachinePool) validateScaling() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.Scaling != nil { //nolint:nestif - minField := field.NewPath("spec", "scaling", "minSize") - maxField := field.NewPath("spec", "scaling", "maxSize") - minSize := r.Spec.Scaling.MinSize - maxSize := r.Spec.Scaling.MaxSize - if minSize != nil { - if *minSize < 0 { - allErrs = append(allErrs, field.Invalid(minField, *minSize, "must be greater or equal zero")) - } - if maxSize != nil && *maxSize < *minSize { - allErrs = append(allErrs, field.Invalid(maxField, *maxSize, fmt.Sprintf("must be greater than field %s", minField.String()))) - } - } - if maxSize != nil && *maxSize < 0 { - allErrs = append(allErrs, field.Invalid(maxField, *maxSize, "must be greater than zero")) - } - } - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -func (r *AWSManagedMachinePool) validateNodegroupUpdateConfig() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.UpdateConfig != nil { - nodegroupUpdateConfigField := field.NewPath("spec", "updateConfig") - - if r.Spec.UpdateConfig.MaxUnavailable == nil && r.Spec.UpdateConfig.MaxUnavailablePercentage == nil { - allErrs = append(allErrs, field.Invalid(nodegroupUpdateConfigField, r.Spec.UpdateConfig, "must specify one of maxUnavailable or maxUnavailablePercentage when using nodegroup updateconfig")) - } - - if r.Spec.UpdateConfig.MaxUnavailable != nil && r.Spec.UpdateConfig.MaxUnavailablePercentage != nil { - allErrs = append(allErrs, field.Invalid(nodegroupUpdateConfigField, r.Spec.UpdateConfig, "cannot specify both maxUnavailable and maxUnavailablePercentage")) - } - } - - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -func (r *AWSManagedMachinePool) validateRemoteAccess() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.RemoteAccess == nil { - return allErrs - } - remoteAccessPath := field.NewPath("spec", "remoteAccess") - sourceSecurityGroups := r.Spec.RemoteAccess.SourceSecurityGroups - - if public := r.Spec.RemoteAccess.Public; public && len(sourceSecurityGroups) > 0 { - allErrs = append( - allErrs, - field.Invalid(remoteAccessPath.Child("sourceSecurityGroups"), sourceSecurityGroups, "must be empty if public is set"), - ) - } - - return allErrs -} - -func (r *AWSManagedMachinePool) validateLaunchTemplate() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.AWSLaunchTemplate == nil { - return allErrs - } - - if r.Spec.InstanceType != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "InstanceType"), r.Spec.InstanceType, "InstanceType cannot be specified when LaunchTemplate is specified")) - } - if r.Spec.DiskSize != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "DiskSize"), r.Spec.DiskSize, "DiskSize cannot be specified when LaunchTemplate is specified")) - } - - if r.Spec.AWSLaunchTemplate.IamInstanceProfile != "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "AWSLaunchTemplate", "IamInstanceProfile"), r.Spec.AWSLaunchTemplate.IamInstanceProfile, "IAM instance profile in launch template is prohibited in EKS managed node group")) - } - - return allErrs -} - -func (r *AWSManagedMachinePool) validateLifecycleHooks() field.ErrorList { - return validateLifecycleHooks(r.Spec.AWSLifecycleHooks) -} - -// ValidateCreate will do any extra validation when creating a AWSManagedMachinePool. -func (*awsManagedMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*AWSManagedMachinePool) - if !ok { - return nil, fmt.Errorf("expected an AWSManagedMachinePool object but got %T", r) - } - - mmpLog.Info("AWSManagedMachinePool validate create", "managed-machine-pool", klog.KObj(r)) - - var allErrs field.ErrorList - - if r.Spec.EKSNodegroupName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.eksNodegroupName"), "eksNodegroupName is required")) - } - if errs := r.validateScaling(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateRemoteAccess(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateNodegroupUpdateConfig(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateLaunchTemplate(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateLifecycleHooks(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateUpdate will do any extra validation when updating a AWSManagedMachinePool. -func (*awsManagedMachinePoolWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*AWSManagedMachinePool) - if !ok { - return nil, fmt.Errorf("expected an AWSManagedMachinePool object but got %T", r) - } - - mmpLog.Info("AWSManagedMachinePool validate update", "managed-machine-pool", klog.KObj(r)) - oldPool, ok := oldObj.(*AWSManagedMachinePool) - if !ok { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("AWSManagedMachinePool").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.New("failed to convert old AWSManagedMachinePool to object")), - }) - } - - var allErrs field.ErrorList - allErrs = append(allErrs, r.validateImmutable(oldPool)...) - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - - if errs := r.validateScaling(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateNodegroupUpdateConfig(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateLaunchTemplate(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateLifecycleHooks(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete allows you to add any extra validation when deleting. -func (*awsManagedMachinePoolWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -func (r *AWSManagedMachinePool) validateImmutable(old *AWSManagedMachinePool) field.ErrorList { - var allErrs field.ErrorList - - appendErrorIfMutated := func(old, update interface{}, name string) { - if !cmp.Equal(old, update) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", name), update, "field is immutable"), - ) - } - } - appendErrorIfSetAndMutated := func(old, update interface{}, name string) { - if !reflect.ValueOf(old).IsZero() && !cmp.Equal(old, update) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", name), update, "field is immutable"), - ) - } - } - - if old.Spec.EKSNodegroupName != "" { - appendErrorIfMutated(old.Spec.EKSNodegroupName, r.Spec.EKSNodegroupName, "eksNodegroupName") - } - appendErrorIfMutated(old.Spec.SubnetIDs, r.Spec.SubnetIDs, "subnetIDs") - appendErrorIfSetAndMutated(old.Spec.RoleName, r.Spec.RoleName, "roleName") - appendErrorIfMutated(old.Spec.DiskSize, r.Spec.DiskSize, "diskSize") - appendErrorIfMutated(old.Spec.AMIType, r.Spec.AMIType, "amiType") - appendErrorIfMutated(old.Spec.RemoteAccess, r.Spec.RemoteAccess, "remoteAccess") - appendErrorIfSetAndMutated(old.Spec.CapacityType, r.Spec.CapacityType, "capacityType") - appendErrorIfMutated(old.Spec.AvailabilityZones, r.Spec.AvailabilityZones, "availabilityZones") - appendErrorIfMutated(old.Spec.AvailabilityZoneSubnetType, r.Spec.AvailabilityZoneSubnetType, "availabilityZoneSubnetType") - if (old.Spec.AWSLaunchTemplate != nil && r.Spec.AWSLaunchTemplate == nil) || - (old.Spec.AWSLaunchTemplate == nil && r.Spec.AWSLaunchTemplate != nil) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", "AWSLaunchTemplate"), old.Spec.AWSLaunchTemplate, "field is immutable"), - ) - } - if old.Spec.AWSLaunchTemplate != nil && r.Spec.AWSLaunchTemplate != nil { - appendErrorIfMutated(old.Spec.AWSLaunchTemplate.Name, r.Spec.AWSLaunchTemplate.Name, "awsLaunchTemplate.name") - } - - return allErrs -} - -// Default will set default values for the AWSManagedMachinePool. -func (*awsManagedMachinePoolWebhook) Default(_ context.Context, obj runtime.Object) error { - r, ok := obj.(*AWSManagedMachinePool) - if !ok { - return fmt.Errorf("expected an AWSManagedMachinePool object but got %T", r) - } - - mmpLog.Info("AWSManagedMachinePool setting defaults", "managed-machine-pool", klog.KObj(r)) - - if r.Spec.EKSNodegroupName == "" { - mmpLog.Info("EKSNodegroupName is empty, generating name") - name, err := eks.GenerateEKSName(r.Name, r.Namespace, maxNodegroupNameLength) - if err != nil { - mmpLog.Error(err, "failed to create EKS nodegroup name") - return nil - } - - mmpLog.Info("Generated EKSNodegroupName", "nodegroup", klog.KRef(r.Namespace, name)) - r.Spec.EKSNodegroupName = name - } - - if r.Spec.UpdateConfig == nil { - r.Spec.UpdateConfig = &UpdateConfig{ - MaxUnavailable: ptr.To[int](1), - } - } - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/conversion.go deleted file mode 100644 index 6d3544427df0..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/conversion.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -// Hub marks AWSMachinePool as a conversion hub. -func (*AWSMachinePool) Hub() {} - -// Hub marks AWSMachinePoolList as a conversion hub. -func (*AWSMachinePoolList) Hub() {} - -// Hub marks AWSManagedMachinePool as a conversion hub. -func (*AWSManagedMachinePool) Hub() {} - -// Hub marks AWSManagedMachinePoolList as a conversion hub. -func (*AWSManagedMachinePoolList) Hub() {} - -// Hub marks AWSFargateProfile as a conversion hub. -func (*AWSFargateProfile) Hub() {} - -// Hub marks AWSFargateProfileList as a conversion hub. -func (*AWSFargateProfileList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosacluster_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosacluster_types.go deleted file mode 100644 index 2b24e5f0e2dd..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosacluster_types.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// ROSAClusterSpec defines the desired state of ROSACluster. -type ROSAClusterSpec struct { - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint clusterv1beta1.APIEndpoint `json:"controlPlaneEndpoint"` -} - -// ROSAClusterStatus defines the observed state of ROSACluster. -type ROSAClusterStatus struct { - // Ready is when the ROSAControlPlane has a API server URL. - // +optional - Ready bool `json:"ready,omitempty"` - - // FailureDomains specifies a list fo available availability zones that can be used - // +optional - FailureDomains clusterv1beta1.FailureDomains `json:"failureDomains,omitempty"` - - // Conditions defines current service state of the ROSACluster. - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=rosaclusters,scope=Namespaced,categories=cluster-api,shortName=rosac -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSManagedControl belongs" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes" -// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1 - -// ROSACluster is the Schema for the ROSAClusters API. -type ROSACluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ROSAClusterSpec `json:"spec,omitempty"` - Status ROSAClusterStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ROSAClusterList contains a list of ROSACluster. -type ROSAClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ROSACluster `json:"items"` -} - -// GetConditions returns the observations of the operational state of the -// ROSACluster resource. -func (r *ROSACluster) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the ROSACluster to the -// predescribed clusterv1beta1.Conditions. -func (r *ROSACluster) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -func init() { - SchemeBuilder.Register(&ROSACluster{}, &ROSAClusterList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_types.go deleted file mode 100644 index 9c379586c69f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_types.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - rosacontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// RosaMachinePoolSpec defines the desired state of RosaMachinePool. -type RosaMachinePoolSpec struct { - // NodePoolName specifies the name of the nodepool in Rosa - // must be a valid DNS-1035 label, so it must consist of lower case alphanumeric and have a max length of 15 characters. - // - // +immutable - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="nodepoolName is immutable" - // +kubebuilder:validation:MaxLength:=15 - // +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$` - NodePoolName string `json:"nodePoolName"` - - // Version specifies the OpenShift version of the nodes associated with this machinepool. - // ROSAControlPlane version is used if not set. - // - // +optional - Version string `json:"version,omitempty"` - - // AvailabilityZone is an optinal field specifying the availability zone where instances of this machine pool should run - // For Multi-AZ clusters, you can create a machine pool in a Single-AZ of your choice. - // +optional - AvailabilityZone string `json:"availabilityZone,omitempty"` - - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="subnet is immutable" - // +immutable - // +optional - Subnet string `json:"subnet,omitempty"` - - // Labels specifies labels for the Kubernetes node objects - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // Taints specifies the taints to apply to the nodes of the machine pool - // +optional - Taints []RosaTaint `json:"taints,omitempty"` - - // AdditionalTags are user-defined tags to be added on the underlying EC2 instances associated with this machine pool. - // +immutable - // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` - - // AutoRepair specifies whether health checks should be enabled for machines - // in the NodePool. The default is true. - // +kubebuilder:default=true - // +optional - AutoRepair bool `json:"autoRepair,omitempty"` - - // InstanceType specifies the AWS instance type - // - // +kubebuilder:validation:Required - InstanceType string `json:"instanceType"` - - // Autoscaling specifies auto scaling behaviour for this MachinePool. - // required if Replicas is not configured - // +optional - Autoscaling *rosacontrolplanev1.AutoScaling `json:"autoscaling,omitempty"` - - // TuningConfigs specifies the names of the tuning configs to be applied to this MachinePool. - // Tuning configs must already exist. - // +optional - TuningConfigs []string `json:"tuningConfigs,omitempty"` - - // AdditionalSecurityGroups is an optional set of security groups to associate - // with all node instances of the machine pool. - // - // +immutable - // +optional - AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"` - - // VolumeSize set the disk volume size for the machine pool, in Gib. The default is 300 GiB. - // +kubebuilder:validation:Minimum=75 - // +kubebuilder:validation:Maximum=16384 - // +immutable - // +optional - VolumeSize int `json:"volumeSize,omitempty"` - - // ProviderIDList contain a ProviderID for each machine instance that's currently managed by this machine pool. - // +optional - ProviderIDList []string `json:"providerIDList,omitempty"` - - // NodeDrainGracePeriod is grace period for how long Pod Disruption Budget-protected workloads will be - // respected during upgrades. After this grace period, any workloads protected by Pod Disruption - // Budgets that have not been successfully drained from a node will be forcibly evicted. - // - // Valid values are from 0 to 1 week(10080m|168h) . - // 0 or empty value means that the MachinePool can be drained without any time limitation. - // - // +optional - NodeDrainGracePeriod *metav1.Duration `json:"nodeDrainGracePeriod,omitempty"` - - // UpdateConfig specifies update configurations. - // - // +optional - UpdateConfig *RosaUpdateConfig `json:"updateConfig,omitempty"` - - // CapacityReservationID specifies the ID of an AWS On-Demand Capacity Reservation and Capacity Blocks for ML. - // The CapacityReservationID must be pre-created in advance, before creating a NodePool. - // - // +optional - CapacityReservationID string `json:"capacityReservationID,omitempty"` -} - -// RosaTaint represents a taint to be applied to a node. -type RosaTaint struct { - // The taint key to be applied to a node. - // - // +kubebuilder:validation:Required - Key string `json:"key"` - // The taint value corresponding to the taint key. - // - // +kubebuilder:validation:Pattern:=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$` - // +optional - Value string `json:"value,omitempty"` - // The effect of the taint on pods that do not tolerate the taint. - // Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum=NoSchedule;PreferNoSchedule;NoExecute - Effect corev1.TaintEffect `json:"effect"` -} - -// RosaUpdateConfig specifies update configuration -type RosaUpdateConfig struct { - // RollingUpdate specifies MaxUnavailable & MaxSurge number of nodes during update. - // - // +optional - RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"` -} - -// RollingUpdate specifies MaxUnavailable & MaxSurge number of nodes during update. -type RollingUpdate struct { - // MaxUnavailable is the maximum number of nodes that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired nodes (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // - // MaxUnavailable can not be 0 if MaxSurge is 0, default is 0. - // Both MaxUnavailable & MaxSurge must use the same units (absolute value or percentage). - // - // Example: when MaxUnavailable is set to 30%, old nodes can be deleted down to 70% of - // desired nodes immediately when the rolling update starts. Once new nodes - // are ready, more old nodes be deleted, followed by provisioning new nodes, - // ensuring that the total number of nodes available at all times during the - // update is at least 70% of desired nodes. - // - // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" - // +kubebuilder:validation:XIntOrString - // +kubebuilder:default=0 - // +optional - MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - - // MaxSurge is the maximum number of nodes that can be provisioned above the desired number of nodes. - // Value can be an absolute number (ex: 5) or a percentage of desired nodes (ex: 10%). - // Absolute number is calculated from percentage by rounding up. - // - // MaxSurge can not be 0 if MaxUnavailable is 0, default is 1. - // Both MaxSurge & MaxUnavailable must use the same units (absolute value or percentage). - // - // Example: when MaxSurge is set to 30%, new nodes can be provisioned immediately - // when the rolling update starts, such that the total number of old and new - // nodes do not exceed 130% of desired nodes. Once old nodes have been - // deleted, new nodes can be provisioned, ensuring that total number of nodes - // running at any time during the update is at most 130% of desired nodes. - // - // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" - // +kubebuilder:validation:XIntOrString - // +kubebuilder:default=1 - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` -} - -// RosaMachinePoolStatus defines the observed state of RosaMachinePool. -type RosaMachinePoolStatus struct { - // Ready denotes that the RosaMachinePool nodepool has joined - // the cluster - // +kubebuilder:default=false - Ready bool `json:"ready"` - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas"` - // Conditions defines current service state of the managed machine pool - // +optional - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the state and will be set to a descriptive error message. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the spec or the configuration of - // the controller, and that manual intervention is required. - // - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // ID is the ID given by ROSA. - ID string `json:"id,omitempty"` - - // Available upgrades for the ROSA MachinePool. - AvailableUpgrades []string `json:"availableUpgrades,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=rosamachinepools,scope=Namespaced,categories=cluster-api,shortName=rosamp -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="MachinePool ready status" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Number of replicas" - -// ROSAMachinePool is the Schema for the rosamachinepools API. -type ROSAMachinePool struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec RosaMachinePoolSpec `json:"spec,omitempty"` - Status RosaMachinePoolStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ROSAMachinePoolList contains a list of RosaMachinePools. -type ROSAMachinePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ROSAMachinePool `json:"items"` -} - -// GetConditions returns the observations of the operational state of the RosaMachinePool resource. -func (r *ROSAMachinePool) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the RosaMachinePool to the predescribed clusterv1beta1.Conditions. -func (r *ROSAMachinePool) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -func init() { - SchemeBuilder.Register(&ROSAMachinePool{}, &ROSAMachinePoolList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_webhook.go deleted file mode 100644 index e0f1a9b0a818..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosamachinepool_webhook.go +++ /dev/null @@ -1,175 +0,0 @@ -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/blang/semver" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager will setup the webhooks for the ROSAMachinePool. -func (r *ROSAMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(rosaMachinePoolWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-rosamachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosamachinepools,versions=v1beta2,name=validation.rosamachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-rosamachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosamachinepools,versions=v1beta2,name=default.rosamachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type rosaMachinePoolWebhook struct{} - -var _ webhook.CustomDefaulter = &rosaMachinePoolWebhook{} -var _ webhook.CustomValidator = &rosaMachinePoolWebhook{} - -// ValidateCreate implements admission.Validator. -func (*rosaMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - r, ok := obj.(*ROSAMachinePool) - if !ok { - return nil, fmt.Errorf("expected an ROSAMachinePool object but got %T", r) - } - - var allErrs field.ErrorList - - if err := r.validateVersion(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateNodeDrainGracePeriod(); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, r.Spec.AdditionalTags.Validate()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateUpdate implements admission.Validator. -func (*rosaMachinePoolWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (warnings admission.Warnings, err error) { - r, ok := newObj.(*ROSAMachinePool) - if !ok { - return nil, fmt.Errorf("expected an ROSAMachinePool object but got %T", r) - } - - oldPool, ok := oldObj.(*ROSAMachinePool) - if !ok { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("ROSAMachinePool").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.New("failed to convert old ROSAMachinePool to object")), - }) - } - - var allErrs field.ErrorList - if err := r.validateVersion(); err != nil { - allErrs = append(allErrs, err) - } - - if err := r.validateNodeDrainGracePeriod(); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, validateImmutable(oldPool.Spec.AdditionalSecurityGroups, r.Spec.AdditionalSecurityGroups, "additionalSecurityGroups")...) - allErrs = append(allErrs, validateImmutable(oldPool.Spec.AdditionalTags, r.Spec.AdditionalTags, "additionalTags")...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete implements admission.Validator. -func (*rosaMachinePoolWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -func (r *ROSAMachinePool) validateVersion() *field.Error { - if r.Spec.Version == "" { - return nil - } - _, err := semver.Parse(r.Spec.Version) - if err != nil { - return field.Invalid(field.NewPath("spec.version"), r.Spec.Version, "must be a valid semantic version") - } - - return nil -} - -func (r *ROSAMachinePool) validateNodeDrainGracePeriod() *field.Error { - if r.Spec.NodeDrainGracePeriod == nil { - return nil - } - - if r.Spec.NodeDrainGracePeriod.Minutes() > 10080 { - return field.Invalid(field.NewPath("spec.nodeDrainGracePeriod"), r.Spec.NodeDrainGracePeriod, - "max supported duration is 1 week (10080m|168h)") - } - - return nil -} - -func validateImmutable(old, updated interface{}, name string) field.ErrorList { - var allErrs field.ErrorList - - if !cmp.Equal(old, updated) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", name), updated, "field is immutable"), - ) - } - - return allErrs -} - -// Default implements admission.Defaulter. -func (*rosaMachinePoolWebhook) Default(ctx context.Context, obj runtime.Object) error { - r, ok := obj.(*ROSAMachinePool) - if !ok { - return fmt.Errorf("expected an ROSAMachinePool object but got %T", r) - } - - r.Default() - return nil -} - -// Default satisfies the defaulting webhook interface. -func (r *ROSAMachinePool) Default() { - if r.Spec.NodeDrainGracePeriod == nil { - r.Spec.NodeDrainGracePeriod = &metav1.Duration{} - } - - if r.Spec.UpdateConfig == nil { - r.Spec.UpdateConfig = &RosaUpdateConfig{} - } - if r.Spec.UpdateConfig.RollingUpdate == nil { - r.Spec.UpdateConfig.RollingUpdate = &RollingUpdate{ - MaxUnavailable: ptr.To(intstr.FromInt32(0)), - MaxSurge: ptr.To(intstr.FromInt32(1)), - } - } -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_types.go deleted file mode 100644 index 0cb9922530d7..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_types.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// ROSANetworkFinalizer allows the controller to clean up resources on delete. -const ROSANetworkFinalizer = "rosanetwork.infrastructure.cluster.x-k8s.io" - -// ROSANetworkSpec defines the desired state of ROSANetwork -type ROSANetworkSpec struct { - // The name of the cloudformation stack under which the network infrastructure would be created - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="stackName is immutable" - // +kubebuilder:validation:Required - StackName string `json:"stackName"` - - // The AWS region in which the components of ROSA network infrastruture are to be crated - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="region is immutable" - // +kubebuilder:validation:Required - Region string `json:"region"` - - // The number of availability zones to be used for creation of the network infrastructure. - // You can specify anything between one and four, depending on the chosen AWS region. - // Either AvailabilityZoneCount OR AvailabilityZones must be set. - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="availabilityZoneCount is immutable" - // +optional - AvailabilityZoneCount int `json:"availabilityZoneCount,omitempty"` - - // The list of availability zones to be used for creation of the network infrastructure. - // You can specify anything between one and four valid availability zones from a given region. - // Either AvailabilityZones OR AvailabilityZoneCount must be set. - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="availabilityZones is immutable" - // +optional - AvailabilityZones []string `json:"availabilityZones,omitempty"` - - // CIDR block to be used for the VPC - // +kubebuilder:validation:Format=cidr - // +kubebuilder:validation:Required - CIDRBlock string `json:"cidrBlock"` - - // IdentityRef is a reference to an identity to be used when reconciling rosa network. - // If no identity is specified, the default identity for this controller will be used. - // +optional - IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` - - // StackTags is an optional set of tags to add to the created cloudformation stack. - // The stack tags will then be automatically applied to the supported AWS resources (VPC, subnets, ...). - // +optional - StackTags Tags `json:"stackTags,omitempty"` -} - -// ROSANetworkSubnet groups public and private subnet and the availability zone in which the two subnets got created -type ROSANetworkSubnet struct { - // Availability zone of the subnet pair, for example us-west-2a - AvailabilityZone string `json:"availabilityZone"` - - // ID of the public subnet, for example subnet-0f7e49a3ce68ff338 - PublicSubnet string `json:"publicSubnet"` - - // ID of the private subnet, for example subnet-07a20d6c41af2b725 - PrivateSubnet string `json:"privateSubnet"` -} - -// CFResource groups information pertaining to a resource created as a part of a cloudformation stack -type CFResource struct { - // Type of the created resource: AWS::EC2::VPC, AWS::EC2::Subnet, ... - ResourceType string `json:"resource"` - - // LogicalResourceID of the created resource. - LogicalID string `json:"logicalId"` - - // PhysicalResourceID of the created resource. - PhysicalID string `json:"physicalId"` - - // Status of the resource: CREATE_IN_PROGRESS, CREATE_COMPLETE, ... - Status string `json:"status"` - - // Message pertaining to the status of the resource - Reason string `json:"reason"` -} - -// ROSANetworkStatus defines the observed state of ROSANetwork -type ROSANetworkStatus struct { - // Array of created private, public subnets and availability zones, grouped by availability zones - Subnets []ROSANetworkSubnet `json:"subnets,omitempty"` - - // Resources created in the cloudformation stack - Resources []CFResource `json:"resources,omitempty"` - - // Conditions specifies the conditions for ROSANetwork - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=rosanetworks,shortName=rosanet,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:subresource:status - -// ROSANetwork is the schema for the rosanetworks API -type ROSANetwork struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ROSANetworkSpec `json:"spec,omitempty"` - Status ROSANetworkStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ROSANetworkList contains a list of ROSANetwork -type ROSANetworkList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ROSANetwork `json:"items"` -} - -// GetConditions returns the observations of the operational state of the ROSANetwork resource. -func (r *ROSANetwork) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// SetConditions sets the underlying service state of the ROSANetwork to the predescribed clusterv1beta1.Conditions. -func (r *ROSANetwork) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -func init() { - SchemeBuilder.Register(&ROSANetwork{}, &ROSANetworkList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_webhook.go deleted file mode 100644 index 0465d892a2fa..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosanetwork_webhook.go +++ /dev/null @@ -1,73 +0,0 @@ -package v1beta2 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - runtime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager will setup the webhooks for the ROSANetwork. -func (r *ROSANetwork) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(rosaNetworkWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-rosanetwork,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosanetworks,versions=v1beta2,name=validation.rosanetwork.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-rosanetwork,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosanetworks,versions=v1beta2,name=default.rosanetwork.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type rosaNetworkWebhook struct{} - -var _ webhook.CustomDefaulter = &rosaNetworkWebhook{} -var _ webhook.CustomValidator = &rosaNetworkWebhook{} - -// ValidateCreate implements admission.Validator. -func (r *rosaNetworkWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - rosaNet, ok := obj.(*ROSANetwork) - if !ok { - return nil, fmt.Errorf("expected an ROSANetwork object but got %T", rosaNet) - } - - var allErrs field.ErrorList - if rosaNet.Spec.AvailabilityZoneCount == 0 && len(rosaNet.Spec.AvailabilityZones) == 0 { - err := field.Invalid(field.NewPath("spec.AvailabilityZones"), rosaNet.Spec.AvailabilityZones, "Either AvailabilityZones OR AvailabilityZoneCount must be set.") - allErrs = append(allErrs, err) - } - if rosaNet.Spec.AvailabilityZoneCount != 0 && len(rosaNet.Spec.AvailabilityZones) > 0 { - err := field.Invalid(field.NewPath("spec.AvailabilityZones"), rosaNet.Spec.AvailabilityZones, "Either AvailabilityZones OR AvailabilityZoneCount can be set.") - allErrs = append(allErrs, err) - } - - if len(allErrs) > 0 { - return nil, apierrors.NewInvalid( - rosaNet.GroupVersionKind().GroupKind(), - rosaNet.Name, - allErrs) - } - - return nil, nil -} - -// ValidateUpdate implements admission.Validator. -func (r *rosaNetworkWebhook) ValidateUpdate(ctx context.Context, old runtime.Object, updated runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -// ValidateDelete implements admission.Validator. -func (r *rosaNetworkWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -// Default implements admission.Defaulter. -func (r *rosaNetworkWebhook) Default(ctx context.Context, obj runtime.Object) error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_types.go deleted file mode 100644 index 41e0c21addb3..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_types.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - rosacontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2" - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// OidcProviderType set to Managed or UnManaged -type OidcProviderType string - -const ( - // Managed OIDC Provider type - Managed OidcProviderType = "Managed" - - // Unmanaged OIDC Provider type - Unmanaged OidcProviderType = "Unmanaged" -) - -// Operator Role const -const ( - // IngressOperatorARNSuffix is the suffix for the ingress operator role. - IngressOperatorARNSuffix = "-openshift-ingress-operator-cloud-credentials" - - // ImageRegistryARNSuffix is the suffix for the image registry operator role. - ImageRegistryARNSuffix = "-openshift-image-registry-installer-cloud-credentials" - - // StorageARNSuffix is the suffix for the storage operator role. - StorageARNSuffix = "-openshift-cluster-csi-drivers-ebs-cloud-credentials" - - // NetworkARNSuffix is the suffix for the network operator role. - NetworkARNSuffix = "-openshift-cloud-network-config-controller-cloud-credentials" - - // KubeCloudControllerARNSuffix is the suffix for the kube cloud controller role. - KubeCloudControllerARNSuffix = "-kube-system-kube-controller-manager" - - // NodePoolManagementARNSuffix is the suffix for the node pool management role. - NodePoolManagementARNSuffix = "-kube-system-capa-controller-manager" - - // ControlPlaneOperatorARNSuffix is the suffix for the control plane operator role. - ControlPlaneOperatorARNSuffix = "-kube-system-control-plane-operator" - - // KMSProviderARNSuffix is the suffix for the kms provider role. - KMSProviderARNSuffix = "-kube-system-kms-provider" -) - -// Account Role const -const ( - // HCPROSAInstallerRole is the suffix for installer account role - HCPROSAInstallerRole = "-HCP-ROSA-Installer-Role" - - // HCPROSASupportRole is the suffix for support account role - HCPROSASupportRole = "-HCP-ROSA-Support-Role" - - // HCPROSAWorkerRole is the suffix for worker account role - HCPROSAWorkerRole = "-HCP-ROSA-Worker-Role" -) - -const ( - // RosaRoleConfigReadyCondition condition reports on the successful reconciliation of RosaRoleConfig. - RosaRoleConfigReadyCondition = "RosaRoleConfigReady" - - // RosaRoleConfigDeletionFailedReason used to report failures while deleting RosaRoleConfig. - RosaRoleConfigDeletionFailedReason = "DeletionFailed" - - // RosaRoleConfigReconciliationFailedReason used to report reconciliation failures. - RosaRoleConfigReconciliationFailedReason = "ReconciliationFailed" - - // RosaRoleConfigDeletionStarted used to indicate that the deletion of RosaRoleConfig has started. - RosaRoleConfigDeletionStarted = "DeletionStarted" - - // RosaRoleConfigCreatedReason used to indicate that the RosaRoleConfig has been created. - RosaRoleConfigCreatedReason = "Created" -) - -// ROSARoleConfigSpec defines the desired state of ROSARoleConfig -type ROSARoleConfigSpec struct { - // AccountRoleConfig defines account-wide IAM roles before creating your ROSA cluster. - AccountRoleConfig AccountRoleConfig `json:"accountRoleConfig"` - - // OperatorRoleConfig defines cluster-specific operator IAM roles based on your cluster configuration. - OperatorRoleConfig OperatorRoleConfig `json:"operatorRoleConfig"` - - // IdentityRef is a reference to an identity to be used when reconciling the ROSA Role Config. - // If no identity is specified, the default identity for this controller will be used. - // +optional - IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` - - // CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API. - // +optional - CredentialsSecretRef *corev1.LocalObjectReference `json:"credentialsSecretRef,omitempty"` - - // OIDC provider type values are Managed or UnManaged. When set to Unmanged OperatorRoleConfig OIDCID field must be provided. - // +kubebuilder:validation:Enum=Managed;Unmanaged - // +kubebuilder:default=Managed - OidcProviderType OidcProviderType `json:"oidcProviderType"` -} - -// AccountRoleConfig defines account IAM roles before creating your ROSA cluster. -type AccountRoleConfig struct { - // User-defined prefix for all generated AWS account role - // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength:=4 - // +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$` - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="prefix is immutable" - Prefix string `json:"prefix"` - - // The ARN of the policy that is used to set the permissions boundary for the account roles. - // +optional - PermissionsBoundaryARN string `json:"permissionsBoundaryARN,omitempty"` - - // The arn path for the account/operator roles as well as their policies. - // +optional - Path string `json:"path,omitempty"` - - // Version of OpenShift that will be used to the roles tag in formate of x.y.z example; "4.19.0" - // Setting the role OpenShift version tag does not affect the associated ROSAControlplane version. - // +kubebuilder:validation:Required - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="version is immutable" - Version string `json:"version"` - - // SharedVPCConfig is used to set up shared VPC. - // +optional - SharedVPCConfig SharedVPCConfig `json:"sharedVPCConfig,omitempty"` -} - -// OperatorRoleConfig defines cluster-specific operator IAM roles based on your cluster configuration. -type OperatorRoleConfig struct { - // User-defined prefix for generated AWS operator roles. - // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength:=4 - // +kubebuilder:validation:Pattern:=`^[a-z]([-a-z0-9]*[a-z0-9])?$` - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="prefix is immutable" - Prefix string `json:"prefix"` - - // The ARN of the policy that is used to set the permissions boundary for the operator roles. - // +optional - PermissionsBoundaryARN string `json:"permissionsBoundaryARN,omitempty"` - - // SharedVPCConfig is used to set up shared VPC. - // +optional - SharedVPCConfig SharedVPCConfig `json:"sharedVPCConfig,omitempty"` - - // OIDCID is the ID of the OIDC config that will be used to create the operator roles. - // Cannot be set when OidcProviderType set to Managed - // +optional - // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="oidcID is immutable" - OIDCID string `json:"oidcID,omitempty"` -} - -// SharedVPCConfig is used to set up shared VPC. -type SharedVPCConfig struct { - // Role ARN associated with the private hosted zone used for Hosted Control Plane cluster shared VPC, this role contains policies to be used with Route 53 - RouteRoleARN string `json:"routeRoleARN,omitempty"` - - // Role ARN associated with the shared VPC used for Hosted Control Plane clusters, this role contains policies to be used with the VPC endpoint - VPCEndpointRoleARN string `json:"vpcEndpointRoleArn,omitempty"` -} - -// ROSARoleConfigStatus defines the observed state of ROSARoleConfig -type ROSARoleConfigStatus struct { - // ID of created OIDC config - OIDCID string `json:"oidcID,omitempty"` - - // Create OIDC provider for operators to authenticate against in an STS cluster. - OIDCProviderARN string `json:"oidcProviderARN,omitempty"` - - // Created Account roles that can be used to - AccountRolesRef AccountRolesRef `json:"accountRolesRef,omitempty"` - - // AWS IAM roles used to perform credential requests by the openshift operators. - OperatorRolesRef rosacontrolplanev1.AWSRolesRef `json:"operatorRolesRef,omitempty"` - - // Conditions specifies the ROSARoleConfig conditions - Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` -} - -// AccountRolesRef defscribes ARNs used as Account roles. -type AccountRolesRef struct { - // InstallerRoleARN is an AWS IAM role that OpenShift Cluster Manager will assume to create the cluster.. - InstallerRoleARN string `json:"installerRoleARN,omitempty"` - - // SupportRoleARN is an AWS IAM role used by Red Hat SREs to enable - // access to the cluster account in order to provide support. - SupportRoleARN string `json:"supportRoleARN,omitempty"` - - // WorkerRoleARN is an AWS IAM role that will be attached to worker instances. - WorkerRoleARN string `json:"workerRoleARN,omitempty"` -} - -// ROSARoleConfig is the Schema for the rosaroleconfigs API -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=rosaroleconfigs,scope=Namespaced,categories=cluster-api,shortName=rosarole -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -type ROSARoleConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ROSARoleConfigSpec `json:"spec,omitempty"` - Status ROSARoleConfigStatus `json:"status,omitempty"` -} - -// ROSARoleConfigList contains a list of ROSARoleConfig -// +kubebuilder:object:root=true -type ROSARoleConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ROSARoleConfig `json:"items"` -} - -// SetConditions sets the conditions of the ROSARoleConfig. -func (r *ROSARoleConfig) SetConditions(conditions clusterv1beta1.Conditions) { - r.Status.Conditions = conditions -} - -// GetConditions returns the observations of the operational state of the RosaNetwork resource. -func (r *ROSARoleConfig) GetConditions() clusterv1beta1.Conditions { - return r.Status.Conditions -} - -// IsSharedVPC checks if the shared VPC config is set. -func (s SharedVPCConfig) IsSharedVPC() bool { - return s.VPCEndpointRoleARN != "" || s.RouteRoleARN != "" -} - -func init() { - SchemeBuilder.Register(&ROSARoleConfig{}, &ROSARoleConfigList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_webhook.go deleted file mode 100644 index 5e9d36a30b98..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/rosaroleconfig_webhook.go +++ /dev/null @@ -1,79 +0,0 @@ -package v1beta2 - -import ( - "context" - "fmt" - - "github.com/blang/semver" - apierrors "k8s.io/apimachinery/pkg/api/errors" - runtime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager will setup the webhooks for the ROSARoleConfig. -func (r *ROSARoleConfig) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(rosaRoleConfigWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-rosaroleconfig,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosaroleconfigs,versions=v1beta2,name=validation.rosaroleconfig.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-rosaroleconfig,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=rosaroleconfigs,versions=v1beta2,name=default.rosaroleconfig.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type rosaRoleConfigWebhook struct{} - -var _ webhook.CustomDefaulter = &rosaRoleConfigWebhook{} -var _ webhook.CustomValidator = &rosaRoleConfigWebhook{} - -// ValidateCreate implements admission.Validator. -func (r *rosaRoleConfigWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - roleConfig, ok := obj.(*ROSARoleConfig) - if !ok { - return nil, fmt.Errorf("expected an ROSARoleConfig object but got %T", roleConfig) - } - - var allErrs field.ErrorList - if roleConfig.Spec.OidcProviderType == Managed && roleConfig.Spec.OperatorRoleConfig.OIDCID != "" { - err := field.Invalid(field.NewPath("spec.operatorRoleConfig.oidcId"), roleConfig.Spec.OperatorRoleConfig.OIDCID, "cannot be set with Managed oidc provider type") - allErrs = append(allErrs, err) - } else if roleConfig.Spec.OidcProviderType == Unmanaged && roleConfig.Spec.OperatorRoleConfig.OIDCID == "" { - err := field.Invalid(field.NewPath("spec.operatorRoleConfig.oidcId"), roleConfig.Spec.OperatorRoleConfig.OIDCID, "must set operatorRoleConfig.oidcId with UnManaged oidc provider type") - allErrs = append(allErrs, err) - } - - _, vErr := semver.Parse(roleConfig.Spec.AccountRoleConfig.Version) - if vErr != nil { - err := field.Invalid(field.NewPath("spec.accountRoleConfig.version"), roleConfig.Spec.AccountRoleConfig.Version, "must be a valid semantic version") - allErrs = append(allErrs, err) - } - - if len(allErrs) > 0 { - return nil, apierrors.NewInvalid( - roleConfig.GroupVersionKind().GroupKind(), - roleConfig.Name, - allErrs) - } - - return nil, nil -} - -// ValidateUpdate implements admission.Validator. -func (r *rosaRoleConfigWebhook) ValidateUpdate(ctx context.Context, old runtime.Object, updated runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -// ValidateDelete implements admission.Validator. -func (r *rosaRoleConfigWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error) { - return nil, nil -} - -// Default implements admission.Defaulter. -func (r *rosaRoleConfigWebhook) Default(ctx context.Context, obj runtime.Object) error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.deepcopy.go deleted file mode 100644 index 592ec7d7fa8f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/exp/api/v1beta2/zz_generated.deepcopy.go +++ /dev/null @@ -1,1773 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta2 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - apiv1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - rosaapiv1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/controlplane/rosa/api/v1beta2" - "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSFargateProfile) DeepCopyInto(out *AWSFargateProfile) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSFargateProfile. -func (in *AWSFargateProfile) DeepCopy() *AWSFargateProfile { - if in == nil { - return nil - } - out := new(AWSFargateProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSFargateProfile) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSFargateProfileList) DeepCopyInto(out *AWSFargateProfileList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSFargateProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSFargateProfileList. -func (in *AWSFargateProfileList) DeepCopy() *AWSFargateProfileList { - if in == nil { - return nil - } - out := new(AWSFargateProfileList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSFargateProfileList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSLaunchTemplate) DeepCopyInto(out *AWSLaunchTemplate) { - *out = *in - in.AMI.DeepCopyInto(&out.AMI) - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(apiv1beta2.Volume) - (*in).DeepCopyInto(*out) - } - if in.NonRootVolumes != nil { - in, out := &in.NonRootVolumes, &out.NonRootVolumes - *out = make([]apiv1beta2.Volume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SSHKeyName != nil { - in, out := &in.SSHKeyName, &out.SSHKeyName - *out = new(string) - **out = **in - } - if in.VersionNumber != nil { - in, out := &in.VersionNumber, &out.VersionNumber - *out = new(int64) - **out = **in - } - if in.AdditionalSecurityGroups != nil { - in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]apiv1beta2.AWSResourceReference, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SpotMarketOptions != nil { - in, out := &in.SpotMarketOptions, &out.SpotMarketOptions - *out = new(apiv1beta2.SpotMarketOptions) - (*in).DeepCopyInto(*out) - } - if in.InstanceMetadataOptions != nil { - in, out := &in.InstanceMetadataOptions, &out.InstanceMetadataOptions - *out = new(apiv1beta2.InstanceMetadataOptions) - **out = **in - } - if in.PrivateDNSName != nil { - in, out := &in.PrivateDNSName, &out.PrivateDNSName - *out = new(apiv1beta2.PrivateDNSName) - (*in).DeepCopyInto(*out) - } - if in.CapacityReservationID != nil { - in, out := &in.CapacityReservationID, &out.CapacityReservationID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLaunchTemplate. -func (in *AWSLaunchTemplate) DeepCopy() *AWSLaunchTemplate { - if in == nil { - return nil - } - out := new(AWSLaunchTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSLifecycleHook) DeepCopyInto(out *AWSLifecycleHook) { - *out = *in - if in.NotificationTargetARN != nil { - in, out := &in.NotificationTargetARN, &out.NotificationTargetARN - *out = new(string) - **out = **in - } - if in.RoleARN != nil { - in, out := &in.RoleARN, &out.RoleARN - *out = new(string) - **out = **in - } - if in.HeartbeatTimeout != nil { - in, out := &in.HeartbeatTimeout, &out.HeartbeatTimeout - *out = new(v1.Duration) - **out = **in - } - if in.DefaultResult != nil { - in, out := &in.DefaultResult, &out.DefaultResult - *out = new(LifecycleHookDefaultResult) - **out = **in - } - if in.NotificationMetadata != nil { - in, out := &in.NotificationMetadata, &out.NotificationMetadata - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLifecycleHook. -func (in *AWSLifecycleHook) DeepCopy() *AWSLifecycleHook { - if in == nil { - return nil - } - out := new(AWSLifecycleHook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePool) DeepCopyInto(out *AWSMachinePool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePool. -func (in *AWSMachinePool) DeepCopy() *AWSMachinePool { - if in == nil { - return nil - } - out := new(AWSMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachinePool) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePoolInstanceStatus) DeepCopyInto(out *AWSMachinePoolInstanceStatus) { - *out = *in - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolInstanceStatus. -func (in *AWSMachinePoolInstanceStatus) DeepCopy() *AWSMachinePoolInstanceStatus { - if in == nil { - return nil - } - out := new(AWSMachinePoolInstanceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePoolList) DeepCopyInto(out *AWSMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolList. -func (in *AWSMachinePoolList) DeepCopy() *AWSMachinePoolList { - if in == nil { - return nil - } - out := new(AWSMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachinePoolList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePoolSpec) DeepCopyInto(out *AWSMachinePoolSpec) { - *out = *in - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AvailabilityZoneSubnetType != nil { - in, out := &in.AvailabilityZoneSubnetType, &out.AvailabilityZoneSubnetType - *out = new(AZSubnetType) - **out = **in - } - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]apiv1beta2.AWSResourceReference, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - in.AWSLaunchTemplate.DeepCopyInto(&out.AWSLaunchTemplate) - if in.MixedInstancesPolicy != nil { - in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy - *out = new(MixedInstancesPolicy) - (*in).DeepCopyInto(*out) - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.DefaultCoolDown = in.DefaultCoolDown - out.DefaultInstanceWarmup = in.DefaultInstanceWarmup - if in.RefreshPreferences != nil { - in, out := &in.RefreshPreferences, &out.RefreshPreferences - *out = new(RefreshPreferences) - (*in).DeepCopyInto(*out) - } - if in.SuspendProcesses != nil { - in, out := &in.SuspendProcesses, &out.SuspendProcesses - *out = new(SuspendProcessesTypes) - (*in).DeepCopyInto(*out) - } - if in.Ignition != nil { - in, out := &in.Ignition, &out.Ignition - *out = new(apiv1beta2.Ignition) - (*in).DeepCopyInto(*out) - } - if in.AWSLifecycleHooks != nil { - in, out := &in.AWSLifecycleHooks, &out.AWSLifecycleHooks - *out = make([]AWSLifecycleHook, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolSpec. -func (in *AWSMachinePoolSpec) DeepCopy() *AWSMachinePoolSpec { - if in == nil { - return nil - } - out := new(AWSMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePoolStatus) DeepCopyInto(out *AWSMachinePoolStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]AWSMachinePoolInstanceStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LaunchTemplateVersion != nil { - in, out := &in.LaunchTemplateVersion, &out.LaunchTemplateVersion - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.ASGStatus != nil { - in, out := &in.ASGStatus, &out.ASGStatus - *out = new(ASGStatus) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolStatus. -func (in *AWSMachinePoolStatus) DeepCopy() *AWSMachinePoolStatus { - if in == nil { - return nil - } - out := new(AWSMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachinePoolWebhook) DeepCopyInto(out *AWSMachinePoolWebhook) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolWebhook. -func (in *AWSMachinePoolWebhook) DeepCopy() *AWSMachinePoolWebhook { - if in == nil { - return nil - } - out := new(AWSMachinePoolWebhook) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePool) DeepCopyInto(out *AWSManagedMachinePool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePool. -func (in *AWSManagedMachinePool) DeepCopy() *AWSManagedMachinePool { - if in == nil { - return nil - } - out := new(AWSManagedMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedMachinePool) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolList) DeepCopyInto(out *AWSManagedMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSManagedMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolList. -func (in *AWSManagedMachinePoolList) DeepCopy() *AWSManagedMachinePoolList { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSManagedMachinePoolList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolSpec) DeepCopyInto(out *AWSManagedMachinePoolSpec) { - *out = *in - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AvailabilityZoneSubnetType != nil { - in, out := &in.AvailabilityZoneSubnetType, &out.AvailabilityZoneSubnetType - *out = new(AZSubnetType) - **out = **in - } - if in.SubnetIDs != nil { - in, out := &in.SubnetIDs, &out.SubnetIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RoleAdditionalPolicies != nil { - in, out := &in.RoleAdditionalPolicies, &out.RoleAdditionalPolicies - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AMIVersion != nil { - in, out := &in.AMIVersion, &out.AMIVersion - *out = new(string) - **out = **in - } - if in.AMIType != nil { - in, out := &in.AMIType, &out.AMIType - *out = new(ManagedMachineAMIType) - **out = **in - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make(Taints, len(*in)) - copy(*out, *in) - } - if in.DiskSize != nil { - in, out := &in.DiskSize, &out.DiskSize - *out = new(int32) - **out = **in - } - if in.InstanceType != nil { - in, out := &in.InstanceType, &out.InstanceType - *out = new(string) - **out = **in - } - if in.Scaling != nil { - in, out := &in.Scaling, &out.Scaling - *out = new(ManagedMachinePoolScaling) - (*in).DeepCopyInto(*out) - } - if in.RemoteAccess != nil { - in, out := &in.RemoteAccess, &out.RemoteAccess - *out = new(ManagedRemoteAccess) - (*in).DeepCopyInto(*out) - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.CapacityType != nil { - in, out := &in.CapacityType, &out.CapacityType - *out = new(ManagedMachinePoolCapacityType) - **out = **in - } - if in.UpdateConfig != nil { - in, out := &in.UpdateConfig, &out.UpdateConfig - *out = new(UpdateConfig) - (*in).DeepCopyInto(*out) - } - if in.AWSLaunchTemplate != nil { - in, out := &in.AWSLaunchTemplate, &out.AWSLaunchTemplate - *out = new(AWSLaunchTemplate) - (*in).DeepCopyInto(*out) - } - if in.AWSLifecycleHooks != nil { - in, out := &in.AWSLifecycleHooks, &out.AWSLifecycleHooks - *out = make([]AWSLifecycleHook, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.NodeRepairConfig != nil { - in, out := &in.NodeRepairConfig, &out.NodeRepairConfig - *out = new(NodeRepairConfig) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolSpec. -func (in *AWSManagedMachinePoolSpec) DeepCopy() *AWSManagedMachinePoolSpec { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSManagedMachinePoolStatus) DeepCopyInto(out *AWSManagedMachinePoolStatus) { - *out = *in - if in.LaunchTemplateID != nil { - in, out := &in.LaunchTemplateID, &out.LaunchTemplateID - *out = new(string) - **out = **in - } - if in.LaunchTemplateVersion != nil { - in, out := &in.LaunchTemplateVersion, &out.LaunchTemplateVersion - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolStatus. -func (in *AWSManagedMachinePoolStatus) DeepCopy() *AWSManagedMachinePoolStatus { - if in == nil { - return nil - } - out := new(AWSManagedMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccountRoleConfig) DeepCopyInto(out *AccountRoleConfig) { - *out = *in - out.SharedVPCConfig = in.SharedVPCConfig -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccountRoleConfig. -func (in *AccountRoleConfig) DeepCopy() *AccountRoleConfig { - if in == nil { - return nil - } - out := new(AccountRoleConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AccountRolesRef) DeepCopyInto(out *AccountRolesRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccountRolesRef. -func (in *AccountRolesRef) DeepCopy() *AccountRolesRef { - if in == nil { - return nil - } - out := new(AccountRolesRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DesiredCapacity != nil { - in, out := &in.DesiredCapacity, &out.DesiredCapacity - *out = new(int32) - **out = **in - } - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.DefaultCoolDown = in.DefaultCoolDown - out.DefaultInstanceWarmup = in.DefaultInstanceWarmup - if in.MixedInstancesPolicy != nil { - in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy - *out = new(MixedInstancesPolicy) - (*in).DeepCopyInto(*out) - } - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]apiv1beta2.Instance, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.CurrentlySuspendProcesses != nil { - in, out := &in.CurrentlySuspendProcesses, &out.CurrentlySuspendProcesses - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalingGroup. -func (in *AutoScalingGroup) DeepCopy() *AutoScalingGroup { - if in == nil { - return nil - } - out := new(AutoScalingGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockDeviceMapping) DeepCopyInto(out *BlockDeviceMapping) { - *out = *in - out.Ebs = in.Ebs -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceMapping. -func (in *BlockDeviceMapping) DeepCopy() *BlockDeviceMapping { - if in == nil { - return nil - } - out := new(BlockDeviceMapping) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CFResource) DeepCopyInto(out *CFResource) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CFResource. -func (in *CFResource) DeepCopy() *CFResource { - if in == nil { - return nil - } - out := new(CFResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EBS) DeepCopyInto(out *EBS) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EBS. -func (in *EBS) DeepCopy() *EBS { - if in == nil { - return nil - } - out := new(EBS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateProfileSpec) DeepCopyInto(out *FargateProfileSpec) { - *out = *in - if in.SubnetIDs != nil { - in, out := &in.SubnetIDs, &out.SubnetIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Selectors != nil { - in, out := &in.Selectors, &out.Selectors - *out = make([]FargateSelector, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileSpec. -func (in *FargateProfileSpec) DeepCopy() *FargateProfileSpec { - if in == nil { - return nil - } - out := new(FargateProfileSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateProfileStatus) DeepCopyInto(out *FargateProfileStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileStatus. -func (in *FargateProfileStatus) DeepCopy() *FargateProfileStatus { - if in == nil { - return nil - } - out := new(FargateProfileStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FargateSelector) DeepCopyInto(out *FargateSelector) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateSelector. -func (in *FargateSelector) DeepCopy() *FargateSelector { - if in == nil { - return nil - } - out := new(FargateSelector) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstancesDistribution) DeepCopyInto(out *InstancesDistribution) { - *out = *in - if in.OnDemandBaseCapacity != nil { - in, out := &in.OnDemandBaseCapacity, &out.OnDemandBaseCapacity - *out = new(int64) - **out = **in - } - if in.OnDemandPercentageAboveBaseCapacity != nil { - in, out := &in.OnDemandPercentageAboveBaseCapacity, &out.OnDemandPercentageAboveBaseCapacity - *out = new(int64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancesDistribution. -func (in *InstancesDistribution) DeepCopy() *InstancesDistribution { - if in == nil { - return nil - } - out := new(InstancesDistribution) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { - *out = *in - if in.MinSize != nil { - in, out := &in.MinSize, &out.MinSize - *out = new(int32) - **out = **in - } - if in.MaxSize != nil { - in, out := &in.MaxSize, &out.MaxSize - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. -func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { - if in == nil { - return nil - } - out := new(ManagedMachinePoolScaling) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedRemoteAccess) DeepCopyInto(out *ManagedRemoteAccess) { - *out = *in - if in.SSHKeyName != nil { - in, out := &in.SSHKeyName, &out.SSHKeyName - *out = new(string) - **out = **in - } - if in.SourceSecurityGroups != nil { - in, out := &in.SourceSecurityGroups, &out.SourceSecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedRemoteAccess. -func (in *ManagedRemoteAccess) DeepCopy() *ManagedRemoteAccess { - if in == nil { - return nil - } - out := new(ManagedRemoteAccess) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MixedInstancesPolicy) DeepCopyInto(out *MixedInstancesPolicy) { - *out = *in - if in.InstancesDistribution != nil { - in, out := &in.InstancesDistribution, &out.InstancesDistribution - *out = new(InstancesDistribution) - (*in).DeepCopyInto(*out) - } - if in.Overrides != nil { - in, out := &in.Overrides, &out.Overrides - *out = make([]Overrides, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixedInstancesPolicy. -func (in *MixedInstancesPolicy) DeepCopy() *MixedInstancesPolicy { - if in == nil { - return nil - } - out := new(MixedInstancesPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeRepairConfig) DeepCopyInto(out *NodeRepairConfig) { - *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRepairConfig. -func (in *NodeRepairConfig) DeepCopy() *NodeRepairConfig { - if in == nil { - return nil - } - out := new(NodeRepairConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OperatorRoleConfig) DeepCopyInto(out *OperatorRoleConfig) { - *out = *in - out.SharedVPCConfig = in.SharedVPCConfig -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorRoleConfig. -func (in *OperatorRoleConfig) DeepCopy() *OperatorRoleConfig { - if in == nil { - return nil - } - out := new(OperatorRoleConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Overrides) DeepCopyInto(out *Overrides) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overrides. -func (in *Overrides) DeepCopy() *Overrides { - if in == nil { - return nil - } - out := new(Overrides) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Processes) DeepCopyInto(out *Processes) { - *out = *in - if in.Launch != nil { - in, out := &in.Launch, &out.Launch - *out = new(bool) - **out = **in - } - if in.Terminate != nil { - in, out := &in.Terminate, &out.Terminate - *out = new(bool) - **out = **in - } - if in.AddToLoadBalancer != nil { - in, out := &in.AddToLoadBalancer, &out.AddToLoadBalancer - *out = new(bool) - **out = **in - } - if in.AlarmNotification != nil { - in, out := &in.AlarmNotification, &out.AlarmNotification - *out = new(bool) - **out = **in - } - if in.AZRebalance != nil { - in, out := &in.AZRebalance, &out.AZRebalance - *out = new(bool) - **out = **in - } - if in.HealthCheck != nil { - in, out := &in.HealthCheck, &out.HealthCheck - *out = new(bool) - **out = **in - } - if in.InstanceRefresh != nil { - in, out := &in.InstanceRefresh, &out.InstanceRefresh - *out = new(bool) - **out = **in - } - if in.ReplaceUnhealthy != nil { - in, out := &in.ReplaceUnhealthy, &out.ReplaceUnhealthy - *out = new(bool) - **out = **in - } - if in.ScheduledActions != nil { - in, out := &in.ScheduledActions, &out.ScheduledActions - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Processes. -func (in *Processes) DeepCopy() *Processes { - if in == nil { - return nil - } - out := new(Processes) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSACluster) DeepCopyInto(out *ROSACluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSACluster. -func (in *ROSACluster) DeepCopy() *ROSACluster { - if in == nil { - return nil - } - out := new(ROSACluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSACluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAClusterList) DeepCopyInto(out *ROSAClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ROSACluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAClusterList. -func (in *ROSAClusterList) DeepCopy() *ROSAClusterList { - if in == nil { - return nil - } - out := new(ROSAClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSAClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAClusterSpec) DeepCopyInto(out *ROSAClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAClusterSpec. -func (in *ROSAClusterSpec) DeepCopy() *ROSAClusterSpec { - if in == nil { - return nil - } - out := new(ROSAClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAClusterStatus) DeepCopyInto(out *ROSAClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(v1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAClusterStatus. -func (in *ROSAClusterStatus) DeepCopy() *ROSAClusterStatus { - if in == nil { - return nil - } - out := new(ROSAClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAMachinePool) DeepCopyInto(out *ROSAMachinePool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAMachinePool. -func (in *ROSAMachinePool) DeepCopy() *ROSAMachinePool { - if in == nil { - return nil - } - out := new(ROSAMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSAMachinePool) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSAMachinePoolList) DeepCopyInto(out *ROSAMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ROSAMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSAMachinePoolList. -func (in *ROSAMachinePoolList) DeepCopy() *ROSAMachinePoolList { - if in == nil { - return nil - } - out := new(ROSAMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSAMachinePoolList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSANetwork) DeepCopyInto(out *ROSANetwork) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSANetwork. -func (in *ROSANetwork) DeepCopy() *ROSANetwork { - if in == nil { - return nil - } - out := new(ROSANetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSANetwork) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSANetworkList) DeepCopyInto(out *ROSANetworkList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ROSANetwork, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSANetworkList. -func (in *ROSANetworkList) DeepCopy() *ROSANetworkList { - if in == nil { - return nil - } - out := new(ROSANetworkList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSANetworkList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSANetworkSpec) DeepCopyInto(out *ROSANetworkSpec) { - *out = *in - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(apiv1beta2.AWSIdentityReference) - **out = **in - } - if in.StackTags != nil { - in, out := &in.StackTags, &out.StackTags - *out = make(Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSANetworkSpec. -func (in *ROSANetworkSpec) DeepCopy() *ROSANetworkSpec { - if in == nil { - return nil - } - out := new(ROSANetworkSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSANetworkStatus) DeepCopyInto(out *ROSANetworkStatus) { - *out = *in - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]ROSANetworkSubnet, len(*in)) - copy(*out, *in) - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]CFResource, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSANetworkStatus. -func (in *ROSANetworkStatus) DeepCopy() *ROSANetworkStatus { - if in == nil { - return nil - } - out := new(ROSANetworkStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSANetworkSubnet) DeepCopyInto(out *ROSANetworkSubnet) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSANetworkSubnet. -func (in *ROSANetworkSubnet) DeepCopy() *ROSANetworkSubnet { - if in == nil { - return nil - } - out := new(ROSANetworkSubnet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSARoleConfig) DeepCopyInto(out *ROSARoleConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSARoleConfig. -func (in *ROSARoleConfig) DeepCopy() *ROSARoleConfig { - if in == nil { - return nil - } - out := new(ROSARoleConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSARoleConfig) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSARoleConfigList) DeepCopyInto(out *ROSARoleConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ROSARoleConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSARoleConfigList. -func (in *ROSARoleConfigList) DeepCopy() *ROSARoleConfigList { - if in == nil { - return nil - } - out := new(ROSARoleConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ROSARoleConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSARoleConfigSpec) DeepCopyInto(out *ROSARoleConfigSpec) { - *out = *in - out.AccountRoleConfig = in.AccountRoleConfig - out.OperatorRoleConfig = in.OperatorRoleConfig - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(apiv1beta2.AWSIdentityReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(corev1.LocalObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSARoleConfigSpec. -func (in *ROSARoleConfigSpec) DeepCopy() *ROSARoleConfigSpec { - if in == nil { - return nil - } - out := new(ROSARoleConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ROSARoleConfigStatus) DeepCopyInto(out *ROSARoleConfigStatus) { - *out = *in - out.AccountRolesRef = in.AccountRolesRef - out.OperatorRolesRef = in.OperatorRolesRef - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ROSARoleConfigStatus. -func (in *ROSARoleConfigStatus) DeepCopy() *ROSARoleConfigStatus { - if in == nil { - return nil - } - out := new(ROSARoleConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RefreshPreferences) DeepCopyInto(out *RefreshPreferences) { - *out = *in - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(string) - **out = **in - } - if in.InstanceWarmup != nil { - in, out := &in.InstanceWarmup, &out.InstanceWarmup - *out = new(int64) - **out = **in - } - if in.MinHealthyPercentage != nil { - in, out := &in.MinHealthyPercentage, &out.MinHealthyPercentage - *out = new(int64) - **out = **in - } - if in.MaxHealthyPercentage != nil { - in, out := &in.MaxHealthyPercentage, &out.MaxHealthyPercentage - *out = new(int64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefreshPreferences. -func (in *RefreshPreferences) DeepCopy() *RefreshPreferences { - if in == nil { - return nil - } - out := new(RefreshPreferences) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RollingUpdate) DeepCopyInto(out *RollingUpdate) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdate. -func (in *RollingUpdate) DeepCopy() *RollingUpdate { - if in == nil { - return nil - } - out := new(RollingUpdate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaMachinePoolSpec) DeepCopyInto(out *RosaMachinePoolSpec) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]RosaTaint, len(*in)) - copy(*out, *in) - } - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta2.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Autoscaling != nil { - in, out := &in.Autoscaling, &out.Autoscaling - *out = new(rosaapiv1beta2.AutoScaling) - **out = **in - } - if in.TuningConfigs != nil { - in, out := &in.TuningConfigs, &out.TuningConfigs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AdditionalSecurityGroups != nil { - in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NodeDrainGracePeriod != nil { - in, out := &in.NodeDrainGracePeriod, &out.NodeDrainGracePeriod - *out = new(v1.Duration) - **out = **in - } - if in.UpdateConfig != nil { - in, out := &in.UpdateConfig, &out.UpdateConfig - *out = new(RosaUpdateConfig) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaMachinePoolSpec. -func (in *RosaMachinePoolSpec) DeepCopy() *RosaMachinePoolSpec { - if in == nil { - return nil - } - out := new(RosaMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaMachinePoolStatus) DeepCopyInto(out *RosaMachinePoolStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.AvailableUpgrades != nil { - in, out := &in.AvailableUpgrades, &out.AvailableUpgrades - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaMachinePoolStatus. -func (in *RosaMachinePoolStatus) DeepCopy() *RosaMachinePoolStatus { - if in == nil { - return nil - } - out := new(RosaMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaTaint) DeepCopyInto(out *RosaTaint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaTaint. -func (in *RosaTaint) DeepCopy() *RosaTaint { - if in == nil { - return nil - } - out := new(RosaTaint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RosaUpdateConfig) DeepCopyInto(out *RosaUpdateConfig) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RosaUpdateConfig. -func (in *RosaUpdateConfig) DeepCopy() *RosaUpdateConfig { - if in == nil { - return nil - } - out := new(RosaUpdateConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SharedVPCConfig) DeepCopyInto(out *SharedVPCConfig) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedVPCConfig. -func (in *SharedVPCConfig) DeepCopy() *SharedVPCConfig { - if in == nil { - return nil - } - out := new(SharedVPCConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SuspendProcessesTypes) DeepCopyInto(out *SuspendProcessesTypes) { - *out = *in - if in.Processes != nil { - in, out := &in.Processes, &out.Processes - *out = new(Processes) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SuspendProcessesTypes. -func (in *SuspendProcessesTypes) DeepCopy() *SuspendProcessesTypes { - if in == nil { - return nil - } - out := new(SuspendProcessesTypes) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Tags) DeepCopyInto(out *Tags) { - { - in := &in - *out = make(Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. -func (in Tags) DeepCopy() Tags { - if in == nil { - return nil - } - out := new(Tags) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Taint) DeepCopyInto(out *Taint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. -func (in *Taint) DeepCopy() *Taint { - if in == nil { - return nil - } - out := new(Taint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Taints) DeepCopyInto(out *Taints) { - { - in := &in - *out = make(Taints, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. -func (in Taints) DeepCopy() Taints { - if in == nil { - return nil - } - out := new(Taints) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpdateConfig) DeepCopyInto(out *UpdateConfig) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(int) - **out = **in - } - if in.MaxUnavailablePercentage != nil { - in, out := &in.MaxUnavailablePercentage, &out.MaxUnavailablePercentage - *out = new(int) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateConfig. -func (in *UpdateConfig) DeepCopy() *UpdateConfig { - if in == nil { - return nil - } - out := new(UpdateConfig) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/feature.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/feature.go deleted file mode 100644 index 0fef03479029..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/feature.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package feature provides a feature-gate implementation for capa. -package feature - -import ( - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/component-base/featuregate" -) - -const ( - // Every capa-specific feature gate should add method here following this template: - // - // // owner: @username - // // alpha: v1.X - // MyFeature featuregate.Feature = "MyFeature". - - // EKS is used to enable EKS support - // owner: @richardcase - // alpha: v0.4 - EKS featuregate.Feature = "EKS" - - // EKSEnableIAM will enable the IAM resource creation/modification - // owner: @richardcase - // alpha: v0.4 - EKSEnableIAM featuregate.Feature = "EKSEnableIAM" - - // EKSAllowAddRoles is used to enable the usage of additional IAM roles - // owner: @richardcase - // alpha: v0.4 - EKSAllowAddRoles featuregate.Feature = "EKSAllowAddRoles" - - // EKSFargate is used to enable the usage of EKS fargate profiles - // owner: @richardcase - // alpha: v0.4 - EKSFargate featuregate.Feature = "EKSFargate" - - // MachinePool is used to enable ASG support - // owner: @mytunguyen - // alpha: v0.1 - MachinePool featuregate.Feature = "MachinePool" - - // MachinePoolMachines is a feature gate that enables creation of AWSMachine objects for AWSMachinePool and AWSManagedMachinePool. - // - // owner: @AndiDog - // alpha: v2.8 - MachinePoolMachines featuregate.Feature = "MachinePoolMachines" - - // EventBridgeInstanceState will use Event Bridge and notifications to keep instance state up-to-date - // owner: @gab-satchi - // alpha: v0.7? - EventBridgeInstanceState featuregate.Feature = "EventBridgeInstanceState" - - // AutoControllerIdentityCreator will create AWSClusterControllerIdentity instance that allows all namespaces to use it. - // owner: @sedefsavas - // alpha: v0.6 - AutoControllerIdentityCreator featuregate.Feature = "AutoControllerIdentityCreator" - - // BootstrapFormatIgnition will allow an user to enable alternate machine bootstrap format, viz. Ignition. - BootstrapFormatIgnition featuregate.Feature = "BootstrapFormatIgnition" - - // ExternalResourceGC is used to enable the garbage collection of external resources like NLB/ALB on deletion - // owner: @richardcase - // alpha: v1.5 - ExternalResourceGC featuregate.Feature = "ExternalResourceGC" - - // AlternativeGCStrategy is used to enable garbage collection of external resources to be performed without resource group tagging API. It is usually needed in airgap env when tagging API is not available. - // owner: @wyike - // alpha: v2.0 - AlternativeGCStrategy featuregate.Feature = "AlternativeGCStrategy" - - // TagUnmanagedNetworkResources is used to disable tagging unmanaged networking resources. - // owner: @skarlso - // alpha: v2.0 - TagUnmanagedNetworkResources featuregate.Feature = "TagUnmanagedNetworkResources" - - // ROSA is used to enable ROSA support - // owner: @enxebre - // alpha: v2.2 - ROSA featuregate.Feature = "ROSA" -) - -func init() { - runtime.Must(MutableGates.Add(defaultCAPAFeatureGates)) -} - -// defaultCAPAFeatureGates consists of all known capa-specific feature keys. -// To add a new feature, define a key for it above and add it here. -var defaultCAPAFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ - // Every feature should be initiated here: - EKS: {Default: true, PreRelease: featuregate.Beta}, - EKSEnableIAM: {Default: false, PreRelease: featuregate.Beta}, - EKSAllowAddRoles: {Default: false, PreRelease: featuregate.Beta}, - EKSFargate: {Default: false, PreRelease: featuregate.Alpha}, - EventBridgeInstanceState: {Default: false, PreRelease: featuregate.Alpha}, - MachinePool: {Default: true, PreRelease: featuregate.Beta}, - MachinePoolMachines: {Default: false, PreRelease: featuregate.Alpha}, - AutoControllerIdentityCreator: {Default: true, PreRelease: featuregate.Alpha}, - BootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha}, - ExternalResourceGC: {Default: true, PreRelease: featuregate.Beta}, - AlternativeGCStrategy: {Default: false, PreRelease: featuregate.Beta}, - TagUnmanagedNetworkResources: {Default: true, PreRelease: featuregate.Alpha}, - ROSA: {Default: false, PreRelease: featuregate.Alpha}, -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/gates.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/gates.go deleted file mode 100644 index 20597a7394dc..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/feature/gates.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package feature - -import ( - "k8s.io/component-base/featuregate" - - "sigs.k8s.io/cluster-api/feature" -) - -var ( - // MutableGates is a mutable version of DefaultFeatureGate. - // Only top-level commands/options setup and the k8s.io/component-base/featuregate/testing package should make use of this. - // Tests that need to modify featuregate gates for the duration of their test should use: - // featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features., ) - MutableGates featuregate.MutableFeatureGate = feature.MutableGates - - // Gates is a shared global FeatureGate. - // Top-level commands/options setup that needs to modify this featuregate gate should use DefaultMutableFeatureGate. - Gates featuregate.FeatureGate = MutableGates -) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/types.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/types.go deleted file mode 100644 index 527c857be979..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/types.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the iam v1beta1 API group. -// +k8s:deepcopy-gen=package,register -// +k8s:defaulter-gen=TypeMeta -// +groupName=iam.aws.infrastructure.cluster.x-k8s.io -// +gencrdrefdocs:force -package v1beta1 - -import ( - "encoding/json" - - "github.com/pkg/errors" -) - -type ( - // Effect defines an AWS IAM effect. - Effect string - - // ConditionOperator defines an AWS condition operator. - ConditionOperator string - - // PrincipalType defines an AWS principle type. - PrincipalType string -) - -const ( - - // Any is the AWS IAM policy grammar wildcard. - Any = "*" - - // CurrentVersion is the latest version of the AWS IAM policy grammar. - CurrentVersion = "2012-10-17" - - // EffectAllow is the Allow effect in an AWS IAM policy statement entry. - EffectAllow Effect = "Allow" - - // EffectDeny is the Deny effect in an AWS IAM policy statement entry. - EffectDeny Effect = "Deny" - - // PrincipalAWS is the identity type covering AWS ARNs. - PrincipalAWS PrincipalType = "AWS" - - // PrincipalFederated is the identity type covering federated identities. - PrincipalFederated PrincipalType = "Federated" - - // PrincipalService is the identity type covering AWS services. - PrincipalService PrincipalType = "Service" - - // StringEquals is an AWS IAM policy condition operator. - StringEquals ConditionOperator = "StringEquals" - - // StringNotEquals is an AWS IAM policy condition operator. - StringNotEquals ConditionOperator = "StringNotEquals" - - // StringEqualsIgnoreCase is an AWS IAM policy condition operator. - StringEqualsIgnoreCase ConditionOperator = "StringEqualsIgnoreCase" - - // StringLike is an AWS IAM policy condition operator. - StringLike ConditionOperator = "StringLike" - - // StringNotLike is an AWS IAM policy condition operator. - StringNotLike ConditionOperator = "StringNotLike" - - // DefaultNameSuffix is the default suffix appended to all AWS IAM roles created by clusterawsadm. - DefaultNameSuffix = ".cluster-api-provider-aws.sigs.k8s.io" -) - -// PolicyDocument represents an AWS IAM policy document, and can be -// converted into JSON using "sigs.k8s.io/cluster-api-provider-aws/v2/cmd/clusterawsadm/converters". -type PolicyDocument struct { - Version string `json:"Version,omitempty"` - Statement Statements `json:"Statement,omitempty"` - ID string `json:"Id,omitempty"` -} - -// StatementEntry represents each "statement" block in an AWS IAM policy document. -type StatementEntry struct { - Sid string `json:",omitempty"` - Principal Principals `json:",omitempty"` - NotPrincipal Principals `json:",omitempty"` - Effect Effect `json:"Effect"` - Action Actions `json:"Action"` - Resource Resources `json:",omitempty"` - Condition Conditions `json:"Condition,omitempty"` -} - -// Statements is the list of StatementEntries. -type Statements []StatementEntry - -// Principals is the map of all identities a statement entry refers to. -type Principals map[PrincipalType]PrincipalID - -// Actions is the list of actions. -type Actions []string - -// UnmarshalJSON is an Actions Unmarshaler. -func (actions *Actions) UnmarshalJSON(data []byte) error { - var ids []string - if err := json.Unmarshal(data, &ids); err == nil { - *actions = Actions(ids) - return nil - } - var id string - if err := json.Unmarshal(data, &id); err != nil { - return errors.Wrap(err, "couldn't unmarshal as either []string or string") - } - *actions = []string{id} - return nil -} - -// Resources is the list of resources. -type Resources []string - -// PrincipalID represents the list of all identities, such as ARNs. -type PrincipalID []string - -// UnmarshalJSON defines an Unmarshaler for a PrincipalID. -func (identityID *PrincipalID) UnmarshalJSON(data []byte) error { - var ids []string - if err := json.Unmarshal(data, &ids); err == nil { - *identityID = PrincipalID(ids) - return nil - } - var id string - if err := json.Unmarshal(data, &id); err != nil { - return errors.Wrap(err, "couldn't unmarshal as either []string or string") - } - *identityID = []string{id} - return nil -} - -// Conditions is the map of all conditions in the statement entry. -type Conditions map[ConditionOperator]interface{} - -// DeepCopyInto copies the receiver, writing into out. in must be non-nil. -func (in Conditions) DeepCopyInto(out *Conditions) { - { - in := &in - *out = make(Conditions, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy copies the receiver, creating a new Conditions. -func (in Conditions) DeepCopy() Conditions { - if in == nil { - return nil - } - out := new(Conditions) - in.DeepCopyInto(out) - return *out -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index b9b8d625128e..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/iam/api/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta1 - -import () - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Actions) DeepCopyInto(out *Actions) { - { - in := &in - *out = make(Actions, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions. -func (in Actions) DeepCopy() Actions { - if in == nil { - return nil - } - out := new(Actions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyDocument) DeepCopyInto(out *PolicyDocument) { - *out = *in - if in.Statement != nil { - in, out := &in.Statement, &out.Statement - *out = make(Statements, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyDocument. -func (in *PolicyDocument) DeepCopy() *PolicyDocument { - if in == nil { - return nil - } - out := new(PolicyDocument) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in PrincipalID) DeepCopyInto(out *PrincipalID) { - { - in := &in - *out = make(PrincipalID, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrincipalID. -func (in PrincipalID) DeepCopy() PrincipalID { - if in == nil { - return nil - } - out := new(PrincipalID) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Principals) DeepCopyInto(out *Principals) { - { - in := &in - *out = make(Principals, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - inVal := (*in)[key] - in, out := &inVal, &outVal - *out = make(PrincipalID, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principals. -func (in Principals) DeepCopy() Principals { - if in == nil { - return nil - } - out := new(Principals) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Resources) DeepCopyInto(out *Resources) { - { - in := &in - *out = make(Resources, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources. -func (in Resources) DeepCopy() Resources { - if in == nil { - return nil - } - out := new(Resources) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StatementEntry) DeepCopyInto(out *StatementEntry) { - *out = *in - if in.Principal != nil { - in, out := &in.Principal, &out.Principal - *out = make(Principals, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - inVal := (*in)[key] - in, out := &inVal, &outVal - *out = make(PrincipalID, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } - if in.NotPrincipal != nil { - in, out := &in.NotPrincipal, &out.NotPrincipal - *out = make(Principals, len(*in)) - for key, val := range *in { - var outVal []string - if val == nil { - (*out)[key] = nil - } else { - inVal := (*in)[key] - in, out := &inVal, &outVal - *out = make(PrincipalID, len(*in)) - copy(*out, *in) - } - (*out)[key] = outVal - } - } - if in.Action != nil { - in, out := &in.Action, &out.Action - *out = make(Actions, len(*in)) - copy(*out, *in) - } - if in.Resource != nil { - in, out := &in.Resource, &out.Resource - *out = make(Resources, len(*in)) - copy(*out, *in) - } - out.Condition = in.Condition.DeepCopy() -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatementEntry. -func (in *StatementEntry) DeepCopy() *StatementEntry { - if in == nil { - return nil - } - out := new(StatementEntry) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Statements) DeepCopyInto(out *Statements) { - { - in := &in - *out = make(Statements, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statements. -func (in Statements) DeepCopy() Statements { - if in == nil { - return nil - } - out := new(Statements) - in.DeepCopyInto(out) - return *out -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks/eks.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks/eks.go deleted file mode 100644 index fd20a913e9bd..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/eks/eks.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package eks contains the EKS API implementation. -package eks - -import ( - "context" - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/service/eks" - "github.com/pkg/errors" - - "sigs.k8s.io/cluster-api-provider-aws/v2/pkg/hash" -) - -const ( - resourcePrefix = "capa_" -) - -// Client implements EKSAPI as it can not be imported from pkg/cloud/services/eks/service.go due to import cycle. -type Client interface { - AssociateIdentityProviderConfig(ctx context.Context, params *eks.AssociateIdentityProviderConfigInput, optFns ...func(*eks.Options)) (*eks.AssociateIdentityProviderConfigOutput, error) - DisassociateIdentityProviderConfig(ctx context.Context, params *eks.DisassociateIdentityProviderConfigInput, optFns ...func(*eks.Options)) (*eks.DisassociateIdentityProviderConfigOutput, error) - DescribeIdentityProviderConfig(ctx context.Context, params *eks.DescribeIdentityProviderConfigInput, optFns ...func(*eks.Options)) (*eks.DescribeIdentityProviderConfigOutput, error) - TagResource(ctx context.Context, params *eks.TagResourceInput, optFns ...func(*eks.Options)) (*eks.TagResourceOutput, error) - UntagResource(ctx context.Context, params *eks.UntagResourceInput, optFns ...func(*eks.Options)) (*eks.UntagResourceOutput, error) - CreateAddon(ctx context.Context, params *eks.CreateAddonInput, optFns ...func(*eks.Options)) (*eks.CreateAddonOutput, error) - DeleteAddon(ctx context.Context, params *eks.DeleteAddonInput, optFns ...func(*eks.Options)) (*eks.DeleteAddonOutput, error) - UpdateAddon(ctx context.Context, params *eks.UpdateAddonInput, optFns ...func(*eks.Options)) (*eks.UpdateAddonOutput, error) - DescribeAddon(ctx context.Context, params *eks.DescribeAddonInput, optFns ...func(*eks.Options)) (*eks.DescribeAddonOutput, error) - WaitUntilAddonDeleted(ctx context.Context, params *eks.DescribeAddonInput, maxWait time.Duration) error -} - -// GenerateEKSName generates a name of an EKS resources. -func GenerateEKSName(resourceName, namespace string, maxLength int) (string, error) { - escapedName := strings.ReplaceAll(resourceName, ".", "_") - eksName := fmt.Sprintf("%s_%s", namespace, escapedName) - - if len(eksName) < maxLength { - return eksName, nil - } - - hashLength := 32 - len(resourcePrefix) - hashedName, err := hash.Base36TruncatedHash(eksName, hashLength) - if err != nil { - return "", errors.Wrap(err, "creating hash from name") - } - - return fmt.Sprintf("%s%s", resourcePrefix, hashedName), nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/hash/base36.go b/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/hash/base36.go deleted file mode 100644 index f03f515001ae..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-aws/v2/pkg/hash/base36.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package hash provides a consistent hash function using blake2b. -package hash - -import ( - "github.com/pkg/errors" - "golang.org/x/crypto/blake2b" - _ "k8s.io/apimachinery/pkg/util/intstr" // keep the blank import to include intstr. -) - -const base36set = "0123456789abcdefghijklmnopqrstuvwxyz" - -// Base36TruncatedHash returns a consistent hash using blake2b -// and truncating the byte values to alphanumeric only -// of a fixed length specified by the consumer. -func Base36TruncatedHash(str string, length int) (string, error) { - hasher, err := blake2b.New(length, nil) - if err != nil { - return "", errors.Wrap(err, "unable to create hash function") - } - - if _, err := hasher.Write([]byte(str)); err != nil { - return "", errors.Wrap(err, "unable to write hash") - } - return base36Truncate(hasher.Sum(nil)), nil -} - -// base36Truncate returns a string that is base36 compliant -// It is not an encoding since it returns a same-length string -// for any byte value. -func base36Truncate(bytes []byte) string { - var chars string - for _, bite := range bytes { - idx := int(bite) % 36 - chars += string(base36set[idx]) - } - - return chars -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-azure/LICENSE deleted file mode 100644 index 8dada3edaf50..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcluster_webhook.go deleted file mode 100644 index b51413608a1f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcluster_webhook.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/feature" -) - -// SetupAzureASOManagedClusterWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureASOManagedClusterWebhookWithManager(mgr ctrl.Manager) error { - azureASOManagedClusterWebhook := &azureASOManagedClusterWebhook{} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureASOManagedCluster{}). - WithValidator(azureASOManagedClusterWebhook). - Complete() -} - -// azureASOManagedClusterWebhook implements a validating and defaulting webhook for AzureASOManagedCluster. -type azureASOManagedClusterWebhook struct { -} - -// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureasomanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedclusters,versions=v1beta1,name=validation.azureasomanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - _, ok := obj.(*AzureASOManagedCluster) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureASOManagedCluster") - } - if !feature.Gates.Enabled(feature.ASOAPI) { - return nil, field.Forbidden( - field.NewPath("spec"), - fmt.Sprintf("can be set only if the %s feature flag is enabled", feature.ASOAPI), - ) - } - return nil, nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedClusterWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcontrolplane_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcontrolplane_webhook.go deleted file mode 100644 index 261e0c2e8b8a..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedcontrolplane_webhook.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/feature" -) - -// SetupAzureASOManagedControlPlaneWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureASOManagedControlPlaneWebhookWithManager(mgr ctrl.Manager) error { - azureASOManagedControlPlaneWebhook := &azureASOManagedControlPlaneWebhook{} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureASOManagedControlPlane{}). - WithValidator(azureASOManagedControlPlaneWebhook). - Complete() -} - -// azureASOManagedControlPlaneWebhook implements a validating webhook for AzureASOManagedControlPlane. -type azureASOManagedControlPlaneWebhook struct { -} - -// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureasomanagedcontrolplane,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedcontrolplanes,versions=v1beta1,name=validation.azureasomanagedcontrolplane.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedControlPlaneWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - _, ok := obj.(*AzureASOManagedControlPlane) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureASOManagedControlPlane") - } - if !feature.Gates.Enabled(feature.ASOAPI) { - return nil, field.Forbidden( - field.NewPath("spec"), - fmt.Sprintf("can be set only if the %s feature flag is enabled", feature.ASOAPI), - ) - } - return nil, nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedControlPlaneWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedControlPlaneWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedmachinepool_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedmachinepool_webhook.go deleted file mode 100644 index 821f4fc55336..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureasomanagedmachinepool_webhook.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/feature" -) - -// SetupAzureASOManagedMachinePoolWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureASOManagedMachinePoolWebhookWithManager(mgr ctrl.Manager) error { - azureASOManagedMachinePoolWebhook := &azureASOManagedMachinePoolWebhook{} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureASOManagedMachinePool{}). - WithValidator(azureASOManagedMachinePoolWebhook). - Complete() -} - -// azureASOManagedMachinePoolWebhook implements a validating and defaulting webhook for AzureASOManagedMachinePool. -type azureASOManagedMachinePoolWebhook struct { -} - -// +kubebuilder:webhook:verbs=create,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureasomanagedmachinepool,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azureasomanagedmachinepools,versions=v1beta1,name=validation.azureasomanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - _, ok := obj.(*AzureASOManagedMachinePool) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureASOManagedMachinePool") - } - if !feature.Gates.Enabled(feature.ASOAPI) { - return nil, field.Forbidden( - field.NewPath("spec"), - fmt.Sprintf("can be set only if the %s feature flag is enabled", feature.ASOAPI), - ) - } - return nil, nil -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedMachinePoolWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (ampw *azureASOManagedMachinePoolWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_conversion.go deleted file mode 100644 index 40b5a0e13a34..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// Hub marks AzureCluster as a conversion hub. -func (*AzureCluster) Hub() {} - -// Hub marks AzureClusterList as a conversion hub. -func (*AzureClusterList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_default.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_default.go index 25c072c827c1..e21c6deccb4a 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_default.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_default.go @@ -20,8 +20,6 @@ import ( "fmt" "k8s.io/utils/ptr" - - "sigs.k8s.io/cluster-api-provider-azure/feature" ) const ( @@ -49,29 +47,6 @@ const ( DefaultAzureCloud = "AzurePublicCloud" ) -func (c *AzureCluster) setDefaults() { - c.Spec.AzureClusterClassSpec.setDefaults() - c.setResourceGroupDefault() - c.setNetworkSpecDefaults() -} - -func (c *AzureCluster) setNetworkSpecDefaults() { - c.setVnetDefaults() - c.setBastionDefaults() - c.setSubnetDefaults() - c.setVnetPeeringDefaults() - if c.Spec.ControlPlaneEnabled { - c.setAPIServerLBDefaults() - } - c.SetNodeOutboundLBDefaults() - if c.Spec.ControlPlaneEnabled { - c.SetControlPlaneOutboundLBDefaults() - } - if !c.Spec.ControlPlaneEnabled { - c.Spec.NetworkSpec.APIServerLB = nil - } -} - func (c *AzureCluster) setResourceGroupDefault() { if c.Spec.ResourceGroup == "" { c.Spec.ResourceGroup = c.Name @@ -84,150 +59,36 @@ func (c *AzureCluster) setAzureEnvironmentDefault() { } } -func (c *AzureCluster) setVnetDefaults() { - if c.Spec.NetworkSpec.Vnet.ResourceGroup == "" { - c.Spec.NetworkSpec.Vnet.ResourceGroup = c.Spec.ResourceGroup - } - if c.Spec.NetworkSpec.Vnet.Name == "" { - c.Spec.NetworkSpec.Vnet.Name = generateVnetName(c.ObjectMeta.Name) - } - c.Spec.NetworkSpec.Vnet.VnetClassSpec.setDefaults() -} - // setSubnetDefaults ensures a fully populated, default subnet configuration // and in certain scenarios creates new, default subnet configurations. -func (c *AzureCluster) setSubnetDefaults() { - clusterSubnet, err := c.Spec.NetworkSpec.GetSubnet(SubnetCluster) - clusterSubnetExists := err == nil - // If we already have a cluster subnet defined, ensure it has sensible defaults - // for all properties. - if clusterSubnetExists { - clusterSubnet.setClusterSubnetDefaults(c.ObjectMeta.Name) - c.Spec.NetworkSpec.UpdateSubnet(clusterSubnet, SubnetCluster) - } - if c.Spec.ControlPlaneEnabled { - cpSubnet, errcp := c.Spec.NetworkSpec.GetSubnet(SubnetControlPlane) - // If we already have a control plane subnet defined, ensure it has sensible defaults - // for all properties. - if errcp == nil { - cpSubnet.setControlPlaneSubnetDefaults(c.ObjectMeta.Name) - c.Spec.NetworkSpec.UpdateSubnet(cpSubnet, SubnetControlPlane) - // If we don't have either a control plane subnet or a cluster subnet, - // create a new control plane subnet from scratch and populate with sensible defaults. - } else if !clusterSubnetExists { - cpSubnet = SubnetSpec{SubnetClassSpec: SubnetClassSpec{Role: SubnetControlPlane}} - cpSubnet.setControlPlaneSubnetDefaults(c.ObjectMeta.Name) - c.Spec.NetworkSpec.Subnets = append(c.Spec.NetworkSpec.Subnets, cpSubnet) - } - } +// If we already have a cluster subnet defined, ensure it has sensible defaults +// for all properties. - // anyNodeSubnetFound tracks whether or not we have one or more node subnets defined. - var anyNodeSubnetFound bool - // nodeSubnetCounter tracks all node subnets to aid automatic CIDR configuration. - var nodeSubnetCounter int - for i, subnet := range c.Spec.NetworkSpec.Subnets { - // Skip all non-node subnets - if subnet.Role != SubnetNode { - continue - } - nodeSubnetCounter++ - anyNodeSubnetFound = true - // Set has sensible defaults for this existing node subnet. - subnet.setNodeSubnetDefaults(c.ObjectMeta.Name, nodeSubnetCounter) - // Because there can be multiple node subnets, we have to update any changes - // after applying defaults to the explicit item at the current index. - c.Spec.NetworkSpec.Subnets[i] = subnet - } +// If we already have a control plane subnet defined, ensure it has sensible defaults +// for all properties. - // We need at least one subnet for nodes. - // If no node subnets are defined, and there is no cluster subnet defined, - // create a default 10.1.0.0/16 node subnet. - if !anyNodeSubnetFound && !clusterSubnetExists { - nodeSubnet := SubnetSpec{ - SubnetClassSpec: SubnetClassSpec{ - Role: SubnetNode, - CIDRBlocks: []string{DefaultNodeSubnetCIDR}, - Name: generateNodeSubnetName(c.ObjectMeta.Name), - }, - SecurityGroup: SecurityGroup{ - Name: generateNodeSecurityGroupName(c.ObjectMeta.Name), - }, - RouteTable: RouteTable{ - Name: generateNodeRouteTableName(c.ObjectMeta.Name), - }, - NatGateway: NatGateway{ - NatGatewayClassSpec: NatGatewayClassSpec{ - Name: generateNatGatewayName(c.ObjectMeta.Name), - }, - }, - } - c.Spec.NetworkSpec.Subnets = append(c.Spec.NetworkSpec.Subnets, nodeSubnet) - } -} +// If we don't have either a control plane subnet or a cluster subnet, +// create a new control plane subnet from scratch and populate with sensible defaults. -func (s *SubnetSpec) setNodeSubnetDefaults(clusterName string, index int) { - if s.Name == "" { - s.Name = withIndex(generateNodeSubnetName(clusterName), index) - } - s.SubnetClassSpec.setDefaults(fmt.Sprintf(DefaultNodeSubnetCIDRPattern, index)) +// anyNodeSubnetFound tracks whether or not we have one or more node subnets defined. - if s.SecurityGroup.Name == "" { - s.SecurityGroup.Name = generateNodeSecurityGroupName(clusterName) - } - s.SecurityGroup.SecurityGroupClass.setDefaults() +// nodeSubnetCounter tracks all node subnets to aid automatic CIDR configuration. - if s.RouteTable.Name == "" { - s.RouteTable.Name = generateNodeRouteTableName(clusterName) - } +// Skip all non-node subnets - // NAT gateway only supports the use of IPv4 public IP addresses for outbound connectivity. - // So default use the NAT gateway for outbound traffic in IPv4 cluster instead of loadbalancer. - // We assume that if the ID is set, the subnet already exists so we shouldn't add a NAT gateway. - if !s.IsIPv6Enabled() && s.ID == "" { - if s.NatGateway.Name == "" { - s.NatGateway.Name = withIndex(generateNatGatewayName(clusterName), index) - } - if s.NatGateway.NatGatewayIP.Name == "" { - s.NatGateway.NatGatewayIP.Name = generateNatGatewayIPName(s.NatGateway.Name) - } - } -} +// Set has sensible defaults for this existing node subnet. -func (s *SubnetSpec) setControlPlaneSubnetDefaults(clusterName string) { - if s.Name == "" { - s.Name = generateControlPlaneSubnetName(clusterName) - } +// Because there can be multiple node subnets, we have to update any changes +// after applying defaults to the explicit item at the current index. - s.SubnetClassSpec.setDefaults(DefaultControlPlaneSubnetCIDR) +// We need at least one subnet for nodes. +// If no node subnets are defined, and there is no cluster subnet defined, +// create a default 10.1.0.0/16 node subnet. - if s.SecurityGroup.Name == "" { - s.SecurityGroup.Name = generateControlPlaneSecurityGroupName(clusterName) - } - s.SecurityGroup.SecurityGroupClass.setDefaults() -} - -func (s *SubnetSpec) setClusterSubnetDefaults(clusterName string) { - if s.Name == "" { - s.Name = generateClusterSubnetSubnetName(clusterName) - } - if s.SecurityGroup.Name == "" { - s.SecurityGroup.Name = generateClusterSecurityGroupName(clusterName) - } - if s.RouteTable.Name == "" { - s.RouteTable.Name = generateClusterRouteTableName(clusterName) - } - if s.ID == "" { - if s.NatGateway.Name == "" { - s.NatGateway.Name = generateClusterNatGatewayName(clusterName) - } - if !s.IsIPv6Enabled() && s.NatGateway.NatGatewayIP.Name == "" { - s.NatGateway.NatGatewayIP.Name = generateNatGatewayIPName(s.NatGateway.Name) - } - } - s.setDefaults(DefaultClusterSubnetCIDR) - s.SecurityGroup.SecurityGroupClass.setDefaults() -} +// NAT gateway only supports the use of IPv4 public IP addresses for outbound connectivity. +// So default use the NAT gateway for outbound traffic in IPv4 cluster instead of loadbalancer. +// We assume that if the ID is set, the subnet already exists so we shouldn't add a NAT gateway. func (c *AzureCluster) setVnetPeeringDefaults() { for i, peering := range c.Spec.NetworkSpec.Vnet.Peerings { @@ -237,73 +98,9 @@ func (c *AzureCluster) setVnetPeeringDefaults() { } } -func (c *AzureCluster) setAPIServerLBDefaults() { - if c.Spec.NetworkSpec.APIServerLB == nil { - lbSpec := LoadBalancerSpec{ - LoadBalancerClassSpec: LoadBalancerClassSpec{ - Type: "Public", - }, - } - c.Spec.NetworkSpec.APIServerLB = &lbSpec - } - lb := c.Spec.NetworkSpec.APIServerLB - - lb.LoadBalancerClassSpec.setAPIServerLBDefaults() +// If the API Server ILB feature is enabled, create a default internal LB IP or use the specified one - if lb.Type == Public { - if lb.Name == "" { - lb.Name = generatePublicLBName(c.ObjectMeta.Name) - } - if len(lb.FrontendIPs) == 0 { - lb.FrontendIPs = []FrontendIP{ - { - Name: generateFrontendIPConfigName(lb.Name), - PublicIP: &PublicIPSpec{ - Name: generatePublicIPName(c.ObjectMeta.Name), - }, - }, - } - } - // If the API Server ILB feature is enabled, create a default internal LB IP or use the specified one - if feature.Gates.Enabled(feature.APIServerILB) { - privateIPFound := false - for i := range lb.FrontendIPs { - if lb.FrontendIPs[i].FrontendIPClass.PrivateIPAddress != "" { - if lb.FrontendIPs[i].Name == "" { - lb.FrontendIPs[i].Name = generatePrivateIPConfigName(lb.Name) - } - privateIPFound = true - break - } - } - // if no private IP is found, we should create a default internal LB IP - if !privateIPFound { - privateIP := FrontendIP{ - Name: generatePrivateIPConfigName(lb.Name), - FrontendIPClass: FrontendIPClass{ - PrivateIPAddress: DefaultInternalLBIPAddress, - }, - } - lb.FrontendIPs = append(lb.FrontendIPs, privateIP) - } - } - } else if lb.Type == Internal { - if lb.Name == "" { - lb.Name = generateInternalLBName(c.ObjectMeta.Name) - } - if len(lb.FrontendIPs) == 0 { - lb.FrontendIPs = []FrontendIP{ - { - Name: generateFrontendIPConfigName(lb.Name), - FrontendIPClass: FrontendIPClass{ - PrivateIPAddress: DefaultInternalLBIPAddress, - }, - }, - } - } - } - c.SetAPIServerLBBackendPoolNameDefault() -} +// if no private IP is found, we should create a default internal LB IP // SetNodeOutboundLBDefaults sets the default values for the NodeOutboundLB. func (c *AzureCluster) SetNodeOutboundLBDefaults() { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_validation.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_validation.go index 479e9cddd4b8..3f2b8584a1df 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_validation.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_validation.go @@ -22,15 +22,10 @@ import ( "reflect" "regexp" - valid "github.com/asaskevich/govalidator/v11" corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/ptr" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/feature" ) const ( @@ -71,51 +66,10 @@ var ( ) // validateCluster validates a cluster. -func (c *AzureCluster) validateCluster(old *AzureCluster) (admission.Warnings, error) { - var allErrs field.ErrorList - allErrs = append(allErrs, c.validateClusterName()...) - allErrs = append(allErrs, c.validateClusterSpec(old)...) - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - schema.GroupKind{Group: "infrastructure.cluster.x-k8s.io", Kind: AzureClusterKind}, - c.Name, allErrs) -} // validateClusterSpec validates a ClusterSpec. -func (c *AzureCluster) validateClusterSpec(old *AzureCluster) field.ErrorList { - var allErrs field.ErrorList - var oldNetworkSpec NetworkSpec - if old != nil { - oldNetworkSpec = old.Spec.NetworkSpec - } - allErrs = append(allErrs, validateNetworkSpec(c.Spec.ControlPlaneEnabled, c.Spec.NetworkSpec, oldNetworkSpec, field.NewPath("spec").Child("networkSpec"))...) - - var oldCloudProviderConfigOverrides *CloudProviderConfigOverrides - if old != nil { - oldCloudProviderConfigOverrides = old.Spec.CloudProviderConfigOverrides - } - allErrs = append(allErrs, validateCloudProviderConfigOverrides(c.Spec.CloudProviderConfigOverrides, oldCloudProviderConfigOverrides, - field.NewPath("spec").Child("cloudProviderConfigOverrides"))...) - - // If ClusterSpec has non-nil ExtendedLocation field but not enable EdgeZone feature gate flag, ClusterSpec validation failed. - if !feature.Gates.Enabled(feature.EdgeZone) && c.Spec.ExtendedLocation != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "extendedLocation"), "can be set only if the EdgeZone feature flag is enabled")) - } - - if err := validateBastionSpec(c.Spec.BastionSpec, field.NewPath("spec").Child("azureBastion").Child("bastionSpec")); err != nil { - allErrs = append(allErrs, err) - } - - if err := validateIdentityRef(c.Spec.IdentityRef, field.NewPath("spec").Child("identityRef")); err != nil { - allErrs = append(allErrs, err) - } - - return allErrs -} +// If ClusterSpec has non-nil ExtendedLocation field but not enable EdgeZone feature gate flag, ClusterSpec validation failed. // validateClusterName validates ClusterName. func (c *AzureCluster) validateClusterName() field.ErrorList { @@ -156,60 +110,10 @@ func validateIdentityRef(identityRef *corev1.ObjectReference, fldPath *field.Pat } // validateNetworkSpec validates a NetworkSpec. -func validateNetworkSpec(controlPlaneEnabled bool, networkSpec NetworkSpec, old NetworkSpec, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - // If the user specifies a resourceGroup for vnet, it means - // that they intend to use a pre-existing vnet. In this case, - // we need to verify the information they provide - if networkSpec.Vnet.ResourceGroup != "" { - if err := validateResourceGroup(networkSpec.Vnet.ResourceGroup, - fldPath.Child("vnet").Child("resourceGroup")); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, validateVnetCIDR(networkSpec.Vnet.CIDRBlocks, fldPath.Child("cidrBlocks"))...) - - allErrs = append(allErrs, validateSubnets(controlPlaneEnabled, networkSpec.Subnets, networkSpec.Vnet, fldPath.Child("subnets"))...) - - allErrs = append(allErrs, validateVnetPeerings(networkSpec.Vnet.Peerings, fldPath.Child("peerings"))...) - } - - var cidrBlocks []string - if controlPlaneEnabled { - controlPlaneSubnet, err := networkSpec.GetControlPlaneSubnet() - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("subnets"), networkSpec.Subnets, "ControlPlaneSubnet invalid")) - } - cidrBlocks = controlPlaneSubnet.CIDRBlocks - allErrs = append(allErrs, validateAPIServerLB(networkSpec.APIServerLB, old.APIServerLB, cidrBlocks, fldPath.Child("apiServerLB"))...) - } - - var needOutboundLB bool - for _, subnet := range networkSpec.Subnets { - if (subnet.Role == SubnetNode || subnet.Role == SubnetCluster) && subnet.IsIPv6Enabled() { - needOutboundLB = true - break - } - } - if needOutboundLB { - allErrs = append(allErrs, validateNodeOutboundLB(networkSpec.NodeOutboundLB, old.NodeOutboundLB, networkSpec.APIServerLB, fldPath.Child("nodeOutboundLB"))...) - } - if controlPlaneEnabled { - allErrs = append(allErrs, validateControlPlaneOutboundLB(networkSpec.ControlPlaneOutboundLB, networkSpec.APIServerLB, fldPath.Child("controlPlaneOutboundLB"))...) - } - var lbType = Internal - if networkSpec.APIServerLB != nil { - lbType = networkSpec.APIServerLB.Type - } - allErrs = append(allErrs, validatePrivateDNSZoneName(networkSpec.PrivateDNSZoneName, controlPlaneEnabled, lbType, fldPath.Child("privateDNSZoneName"))...) - allErrs = append(allErrs, validatePrivateDNSZoneResourceGroup(networkSpec.PrivateDNSZoneName, networkSpec.PrivateDNSZoneResourceGroup, fldPath.Child("privateDNSZoneResourceGroup"))...) - - if len(allErrs) == 0 { - return nil - } - return allErrs -} +// If the user specifies a resourceGroup for vnet, it means +// that they intend to use a pre-existing vnet. In this case, +// we need to verify the information they provide // validateResourceGroup validates a ResourceGroup. func validateResourceGroup(resourceGroup string, fldPath *field.Path) *field.Error { @@ -391,79 +295,17 @@ func validateSecurityRule(rule SecurityRule, fldPath *field.Path) (allErrs field return allErrs } -func validateAPIServerLB(lb *LoadBalancerSpec, old *LoadBalancerSpec, cidrs []string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - lbClassSpec := lb.LoadBalancerClassSpec - var olLBClassSpec LoadBalancerClassSpec - if old != nil { - olLBClassSpec = old.LoadBalancerClassSpec - } +// Name should be valid. - allErrs = append(allErrs, validateClassSpecForAPIServerLB(lbClassSpec, &olLBClassSpec, fldPath)...) +// Name should be immutable. - // Name should be valid. - if err := validateLoadBalancerName(lb.Name, fldPath.Child("name")); err != nil { - allErrs = append(allErrs, err) - } - // Name should be immutable. - if old != nil && old.Name != "" && old.Name != lb.Name { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("name"), "API Server load balancer name should not be modified after AzureCluster creation.")) - } +// there should be one public IP for public LB. - publicIPCount, privateIPCount := 0, 0 - privateIP := "" - for i := range lb.FrontendIPs { - if lb.FrontendIPs[i].PublicIP != nil { - publicIPCount++ - } - if lb.FrontendIPs[i].PrivateIPAddress != "" { - privateIPCount++ - privateIP = lb.FrontendIPs[i].PrivateIPAddress - } - } - if lb.Type == Public { - // there should be one public IP for public LB. - if publicIPCount != 1 || ptr.Deref[int32](lb.FrontendIPsCount, 1) != 1 { - // Note: FrontendIPsCount creates public IPs when set. Therefore, we check for both publicIPCount and FrontendIPsCount to be 1. - allErrs = append(allErrs, field.Invalid(fldPath.Child("frontendIPConfigs"), lb.FrontendIPs, - "API Server Load balancer should have 1 Frontend IP")) - } - if feature.Gates.Enabled(feature.APIServerILB) { - if err := validateInternalLBIPAddress(privateIP, cidrs, fldPath.Child("frontendIPConfigs").Index(0).Child("privateIP")); err != nil { - allErrs = append(allErrs, err) - } - } else { - // API Server LB should not have a Private IP if APIServerILB feature is disabled. - if privateIPCount > 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("frontendIPConfigs").Index(0).Child("privateIP"), - "Public Load Balancers cannot have a Private IP")) - } - } - } +// Note: FrontendIPsCount creates public IPs when set. Therefore, we check for both publicIPCount and FrontendIPsCount to be 1. - // internal LB should not have a public IP. - if lb.Type == Internal { - if publicIPCount != 0 { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("frontendIPConfigs").Index(0).Child("publicIP"), - "Internal Load Balancers cannot have a Public IP")) - } - if privateIPCount != 1 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("frontendIPConfigs"), lb.FrontendIPs, - "API Server Load balancer of type private should have 1 frontend private IP")) - } else { - if err := validateInternalLBIPAddress(lb.FrontendIPs[0].PrivateIPAddress, cidrs, - fldPath.Child("frontendIPConfigs").Index(0).Child("privateIP")); err != nil { - allErrs = append(allErrs, err) - } +// API Server LB should not have a Private IP if APIServerILB feature is disabled. - if old != nil && len(old.FrontendIPs) != 0 && old.FrontendIPs[0].PrivateIPAddress != lb.FrontendIPs[0].PrivateIPAddress { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("name"), "API Server load balancer private IP should not be modified after AzureCluster creation.")) - } - } - } - return allErrs -} +// internal LB should not have a public IP. func validateNodeOutboundLB(lb *LoadBalancerSpec, old *LoadBalancerSpec, apiserverLB *LoadBalancerSpec, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList @@ -537,23 +379,6 @@ func validateControlPlaneOutboundLB(lb *LoadBalancerSpec, apiserverLB *LoadBalan } // validatePrivateDNSZoneName validates the PrivateDNSZoneName. -func validatePrivateDNSZoneName(privateDNSZoneName string, controlPlaneEnabled bool, apiserverLBType LBType, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if privateDNSZoneName != "" { - if controlPlaneEnabled && apiserverLBType != Internal { - allErrs = append(allErrs, field.Invalid(fldPath, apiserverLBType, - "PrivateDNSZoneName is available only if APIServerLB.Type is Internal")) - } - if !valid.IsDNSName(privateDNSZoneName) { - allErrs = append(allErrs, field.Invalid(fldPath, privateDNSZoneName, - "PrivateDNSZoneName can only contain alphanumeric characters, underscores and dashes, must end with an alphanumeric character", - )) - } - } - - return allErrs -} // validatePrivateDNSZoneResourceGroup validates the PrivateDNSZoneResourceGroup. // A private DNS Zone's resource group is valid as long as privateDNSZoneName is provided with the private dns resource group name. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_webhook.go deleted file mode 100644 index def1503c053c..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azurecluster_webhook.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (c *AzureCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(AzureClusterWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(c). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=validation.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azurecluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusters,versions=v1beta1,name=default.azurecluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// AzureClusterWebhook implements validating and mutating webhook for AzureCluster. -type AzureClusterWebhook struct{} - -var _ webhook.CustomValidator = &AzureClusterWebhook{} -var _ webhook.CustomDefaulter = &AzureClusterWebhook{} - -// Default implements webhook.CustomDefaulter so a webhook will be registered for the type. -func (*AzureClusterWebhook) Default(_ context.Context, obj runtime.Object) error { - c, ok := obj.(*AzureCluster) - if !ok { - return fmt.Errorf("expected an AzureCluster object but got %T", c) - } - - c.setDefaults() - return nil -} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*AzureClusterWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - c, ok := obj.(*AzureCluster) - if !ok { - return nil, fmt.Errorf("expected an AzureCluster object but got %T", c) - } - - return c.validateCluster(nil) -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*AzureClusterWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) { - c, ok := newObj.(*AzureCluster) - if !ok { - return nil, fmt.Errorf("expected an AzureCluster object but got %T", c) - } - - var allErrs field.ErrorList - old := oldRaw.(*AzureCluster) - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "resourceGroup"), - old.Spec.ResourceGroup, - c.Spec.ResourceGroup); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "subscriptionID"), - old.Spec.SubscriptionID, - c.Spec.SubscriptionID); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "location"), - old.Spec.Location, - c.Spec.Location); err != nil { - allErrs = append(allErrs, err) - } - - if old.Spec.ControlPlaneEndpoint.Host != "" && c.Spec.ControlPlaneEndpoint.Host != old.Spec.ControlPlaneEndpoint.Host { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneEndpoint", "host"), - c.Spec.ControlPlaneEndpoint.Host, "field is immutable"), - ) - } - - if old.Spec.ControlPlaneEndpoint.Port != 0 && c.Spec.ControlPlaneEndpoint.Port != old.Spec.ControlPlaneEndpoint.Port { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneEndpoint", "port"), - c.Spec.ControlPlaneEndpoint.Port, "field is immutable"), - ) - } - - if !reflect.DeepEqual(c.Spec.AzureEnvironment, old.Spec.AzureEnvironment) { - // The equality failure could be because of default mismatch between v1alpha3 and v1beta1. This happens because - // the new object `r` will have run through the default webhooks but the old object `old` would not have so. - // This means if the old object was in v1alpha3, it would not get the new defaults set in v1beta1 resulting - // in object inequality. To workaround this, we set the v1beta1 defaults here so that the old object also gets - // the new defaults. - old.setAzureEnvironmentDefault() - - // if it's still not equal, return error. - if !reflect.DeepEqual(c.Spec.AzureEnvironment, old.Spec.AzureEnvironment) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "azureEnvironment"), - c.Spec.AzureEnvironment, "field is immutable"), - ) - } - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "networkSpec", "privateDNSZoneName"), - old.Spec.NetworkSpec.PrivateDNSZoneName, - c.Spec.NetworkSpec.PrivateDNSZoneName); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "networkSpec", "privateDNSZoneResourceGroup"), - old.Spec.NetworkSpec.PrivateDNSZoneResourceGroup, - c.Spec.NetworkSpec.PrivateDNSZoneResourceGroup); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "networkSpec", "privateDNSZone"), - old.Spec.NetworkSpec.PrivateDNSZone, - c.Spec.NetworkSpec.PrivateDNSZone); err != nil { - allErrs = append(allErrs, err) - } - - // Allow enabling azure bastion but avoid disabling it. - if old.Spec.BastionSpec.AzureBastion != nil && !reflect.DeepEqual(old.Spec.BastionSpec.AzureBastion, c.Spec.BastionSpec.AzureBastion) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "bastionSpec", "azureBastion"), - c.Spec.BastionSpec.AzureBastion, "azure bastion cannot be removed from a cluster"), - ) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "networkSpec", "controlPlaneOutboundLB"), - old.Spec.NetworkSpec.ControlPlaneOutboundLB, - c.Spec.NetworkSpec.ControlPlaneOutboundLB); err != nil { - allErrs = append(allErrs, err) - } - - allErrs = append(allErrs, c.validateSubnetUpdate(old)...) - - if len(allErrs) == 0 { - return c.validateCluster(old) - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterKind).GroupKind(), c.Name, allErrs) -} - -// validateSubnetUpdate validates a ClusterSpec.NetworkSpec.Subnets for immutability. -func (c *AzureCluster) validateSubnetUpdate(old *AzureCluster) field.ErrorList { - var allErrs field.ErrorList - - oldSubnetMap := make(map[string]SubnetSpec, len(old.Spec.NetworkSpec.Subnets)) - oldSubnetIndex := make(map[string]int, len(old.Spec.NetworkSpec.Subnets)) - for i, subnet := range old.Spec.NetworkSpec.Subnets { - oldSubnetMap[subnet.Name] = subnet - oldSubnetIndex[subnet.Name] = i - } - for i, subnet := range c.Spec.NetworkSpec.Subnets { - if oldSubnet, ok := oldSubnetMap[subnet.Name]; ok { - // Verify the CIDR blocks haven't changed for an owned Vnet. - // A non-owned Vnet's CIDR block can change based on what's - // defined in the spec vs what's been loaded from Azure directly. - // This technically allows the cidr block to be modified in the brief - // moments before the Vnet is created (because the tags haven't been - // set yet) but once the Vnet has been created it becomes immutable. - if old.Spec.NetworkSpec.Vnet.Tags.HasOwned(old.Name) && !reflect.DeepEqual(subnet.CIDRBlocks, oldSubnet.CIDRBlocks) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "networkSpec", "subnets").Index(oldSubnetIndex[subnet.Name]).Child("CIDRBlocks"), - c.Spec.NetworkSpec.Subnets[i].CIDRBlocks, "field is immutable"), - ) - } - if subnet.RouteTable.Name != oldSubnet.RouteTable.Name { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "networkSpec", "subnets").Index(oldSubnetIndex[subnet.Name]).Child("RouteTable").Child("Name"), - c.Spec.NetworkSpec.Subnets[i].RouteTable.Name, "field is immutable"), - ) - } - if (subnet.NatGateway.Name != oldSubnet.NatGateway.Name) && (oldSubnet.NatGateway.Name != "") { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "networkSpec", "subnets").Index(oldSubnetIndex[subnet.Name]).Child("NatGateway").Child("Name"), - c.Spec.NetworkSpec.Subnets[i].NatGateway.Name, "field is immutable"), - ) - } - if subnet.SecurityGroup.Name != oldSubnet.SecurityGroup.Name { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "networkSpec", "subnets").Index(oldSubnetIndex[subnet.Name]).Child("SecurityGroup").Child("Name"), - c.Spec.NetworkSpec.Subnets[i].SecurityGroup.Name, "field is immutable"), - ) - } - } - } - - return allErrs -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*AzureClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_conversion.go deleted file mode 100644 index 2ef52e0c14e8..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// Hub marks AzureClusterIdentity as a conversion hub. -func (*AzureClusterIdentity) Hub() {} - -// Hub marks AzureClusterIdentityList as a conversion hub. -func (*AzureClusterIdentityList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_validation.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_validation.go deleted file mode 100644 index 51b1842e5422..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_validation.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -func (c *AzureClusterIdentity) validateClusterIdentity() (admission.Warnings, error) { - var allErrs field.ErrorList - if c.Spec.Type != UserAssignedMSI && c.Spec.ResourceID != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "resourceID"), c.Spec.ResourceID)) - } - if c.Spec.Type != UserAssignedIdentityCredential && (c.Spec.UserAssignedIdentityCredentialsPath != "" || c.Spec.UserAssignedIdentityCredentialsCloudType != "") { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "userAssignedIdentityCredentialsPath"), fmt.Sprintf("%s can only be set when AzureClusterIdentity is of type UserAssignedIdentityCredential", c.Spec.UserAssignedIdentityCredentialsPath))) - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "userAssignedIdentityCredentialsCloudType"), fmt.Sprintf("%s can only be set when AzureClusterIdentity is of type UserAssignedIdentityCredential ", c.Spec.UserAssignedIdentityCredentialsCloudType))) - } - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_webhook.go deleted file mode 100644 index 7ecc650c4a62..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclusteridentity_webhook.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (c *AzureClusterIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(azureClusterIdentityWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(c). - WithValidator(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclusteridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities,versions=v1beta1,name=validation.azureclusteridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureClusterIdentityWebhook struct{} - -var _ webhook.CustomValidator = &azureClusterIdentityWebhook{} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterIdentityWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - c, ok := obj.(*AzureClusterIdentity) - if !ok { - return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c) - } - - return c.validateClusterIdentity() -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterIdentityWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) { - c, ok := newObj.(*AzureClusterIdentity) - if !ok { - return nil, fmt.Errorf("expected an AzureClusterIdentity object but got %T", c) - } - - var allErrs field.ErrorList - old := oldRaw.(*AzureClusterIdentity) - if err := webhookutils.ValidateImmutable( - field.NewPath("Spec", "Type"), - old.Spec.Type, - c.Spec.Type); err != nil { - allErrs = append(allErrs, err) - } - if len(allErrs) == 0 { - return c.validateClusterIdentity() - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterIdentityKind).GroupKind(), c.Name, allErrs) -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterIdentityWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_default.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_default.go index 99facc26afa3..dda62db634d3 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_default.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_default.go @@ -16,30 +16,6 @@ limitations under the License. package v1beta1 -import ( - "fmt" -) - -func (c *AzureClusterTemplate) setDefaults() { - c.Spec.Template.Spec.AzureClusterClassSpec.setDefaults() - c.setNetworkTemplateSpecDefaults() -} - -func (c *AzureClusterTemplate) setNetworkTemplateSpecDefaults() { - c.setVnetTemplateDefaults() - c.setBastionTemplateDefaults() - c.setSubnetsTemplateDefaults() - - apiServerLB := &c.Spec.Template.Spec.NetworkSpec.APIServerLB - apiServerLB.setAPIServerLBDefaults() - c.setNodeOutboundLBDefaults() - c.setControlPlaneOutboundLBDefaults() -} - -func (c *AzureClusterTemplate) setVnetTemplateDefaults() { - c.Spec.Template.Spec.NetworkSpec.Vnet.VnetClassSpec.setDefaults() -} - func (c *AzureClusterTemplate) setBastionTemplateDefaults() { if c.Spec.Template.Spec.BastionSpec.AzureBastion != nil { // Ensure defaults for Subnet settings. @@ -52,51 +28,6 @@ func (c *AzureClusterTemplate) setBastionTemplateDefaults() { } } -func (c *AzureClusterTemplate) setSubnetsTemplateDefaults() { - clusterSubnet, err := c.Spec.Template.Spec.NetworkSpec.GetSubnetTemplate(SubnetCluster) - clusterSubnetExists := err == nil - if clusterSubnetExists { - clusterSubnet.SubnetClassSpec.setDefaults(DefaultClusterSubnetCIDR) - clusterSubnet.SecurityGroup.setDefaults() - c.Spec.Template.Spec.NetworkSpec.UpdateSubnetTemplate(clusterSubnet, SubnetCluster) - } - - cpSubnet, errcp := c.Spec.Template.Spec.NetworkSpec.GetSubnetTemplate(SubnetControlPlane) - if errcp == nil { - cpSubnet.SubnetClassSpec.setDefaults(DefaultControlPlaneSubnetCIDR) - cpSubnet.SecurityGroup.setDefaults() - c.Spec.Template.Spec.NetworkSpec.UpdateSubnetTemplate(cpSubnet, SubnetControlPlane) - } else if errcp != nil && !clusterSubnetExists { - cpSubnet = SubnetTemplateSpec{SubnetClassSpec: SubnetClassSpec{Role: SubnetControlPlane}} - cpSubnet.SubnetClassSpec.setDefaults(DefaultControlPlaneSubnetCIDR) - cpSubnet.SecurityGroup.setDefaults() - c.Spec.Template.Spec.NetworkSpec.Subnets = append(c.Spec.Template.Spec.NetworkSpec.Subnets, cpSubnet) - } - - var nodeSubnetFound bool - var nodeSubnetCounter int - for i, subnet := range c.Spec.Template.Spec.NetworkSpec.Subnets { - if subnet.Role != SubnetNode { - continue - } - nodeSubnetCounter++ - nodeSubnetFound = true - subnet.SubnetClassSpec.setDefaults(fmt.Sprintf(DefaultNodeSubnetCIDRPattern, nodeSubnetCounter)) - subnet.SecurityGroup.setDefaults() - c.Spec.Template.Spec.NetworkSpec.Subnets[i] = subnet - } - - if !nodeSubnetFound && !clusterSubnetExists { - nodeSubnet := SubnetTemplateSpec{ - SubnetClassSpec: SubnetClassSpec{ - Role: SubnetNode, - CIDRBlocks: []string{DefaultNodeSubnetCIDR}, - }, - } - c.Spec.Template.Spec.NetworkSpec.Subnets = append(c.Spec.Template.Spec.NetworkSpec.Subnets, nodeSubnet) - } -} - func (c *AzureClusterTemplate) setNodeOutboundLBDefaults() { if c.Spec.Template.Spec.NetworkSpec.NodeOutboundLB == nil { if c.Spec.Template.Spec.NetworkSpec.APIServerLB.Type == Internal { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_validation.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_validation.go index fe078960b97b..d8ec35557814 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_validation.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_validation.go @@ -19,54 +19,9 @@ package v1beta1 import ( "fmt" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) -func (c *AzureClusterTemplate) validateClusterTemplate() (admission.Warnings, error) { - var allErrs field.ErrorList - allErrs = append(allErrs, c.validateClusterTemplateSpec()...) - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid( - schema.GroupKind{Group: "infrastructure.cluster.x-k8s.io", Kind: "AzureClusterTemplate"}, - c.Name, allErrs) -} - -func (c *AzureClusterTemplate) validateClusterTemplateSpec() field.ErrorList { - var allErrs field.ErrorList - - allErrs = append(allErrs, validateVnetCIDR( - c.Spec.Template.Spec.NetworkSpec.Vnet.CIDRBlocks, - field.NewPath("spec").Child("template").Child("spec"). - Child("networkSpec").Child("vnet").Child("cidrBlocks"))...) - - allErrs = append(allErrs, validateSubnetTemplates( - c.Spec.Template.Spec.NetworkSpec.Subnets, - c.Spec.Template.Spec.NetworkSpec.Vnet, - field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("subnets"), - )...) - - allErrs = append(allErrs, c.validateAPIServerLB( - field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("apiServerLB"), - )...) - - allErrs = append(allErrs, c.validateNetworkSpec()...) - - allErrs = append(allErrs, c.validateControlPlaneOutboundLB()...) - - allErrs = append(allErrs, c.validatePrivateDNSZoneName()...) - - allErrs = append(allErrs, c.validatePrivateDNSZoneResourceGroup()...) - - return allErrs -} - func (c *AzureClusterTemplate) validateNetworkSpec() field.ErrorList { var allErrs field.ErrorList @@ -156,22 +111,6 @@ func (c *AzureClusterTemplate) validateControlPlaneOutboundLB() field.ErrorList return allErrs } -func (c *AzureClusterTemplate) validatePrivateDNSZoneName() field.ErrorList { - var allErrs field.ErrorList - - fldPath := field.NewPath("spec").Child("template").Child("spec").Child("networkSpec").Child("privateDNSZoneName") - networkSpec := c.Spec.Template.Spec.NetworkSpec - - allErrs = append(allErrs, validatePrivateDNSZoneName( - networkSpec.PrivateDNSZoneName, - true, - networkSpec.APIServerLB.Type, - fldPath, - )...) - - return allErrs -} - func (c *AzureClusterTemplate) validatePrivateDNSZoneResourceGroup() field.ErrorList { var allErrs field.ErrorList diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_webhook.go deleted file mode 100644 index 3f9c0fe82c14..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azureclustertemplate_webhook.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// AzureClusterTemplateImmutableMsg is the message used for errors on fields that are immutable. -const AzureClusterTemplateImmutableMsg = "AzureClusterTemplate spec.template.spec field is immutable. Please create new resource instead. ref doc: https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/change-clusterclass.html" - -// SetupWebhookWithManager will set up the webhook to be managed by the specified manager. -func (c *AzureClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(azureClusterTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(c). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=validation.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azureclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azureclustertemplates,versions=v1beta1,name=default.azureclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureClusterTemplateWebhook struct{} - -var _ webhook.CustomDefaulter = &azureClusterTemplateWebhook{} - -// Default implements webhook.CustomDefaulter so a webhook will be registered for the type. -func (*azureClusterTemplateWebhook) Default(_ context.Context, obj runtime.Object) error { - c, ok := obj.(*AzureClusterTemplate) - if !ok { - return fmt.Errorf("expected an AzureClusterTemplate object but got %T", c) - } - - c.setDefaults() - return nil -} - -var _ webhook.CustomValidator = &azureClusterTemplateWebhook{} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - c, ok := obj.(*AzureClusterTemplate) - if !ok { - return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c) - } - - return c.validateClusterTemplate() -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterTemplateWebhook) ValidateUpdate(_ context.Context, oldRaw, newObj runtime.Object) (admission.Warnings, error) { - c, ok := newObj.(*AzureClusterTemplate) - if !ok { - return nil, fmt.Errorf("expected an AzureClusterTemplate object but got %T", c) - } - - var allErrs field.ErrorList - old := oldRaw.(*AzureClusterTemplate) - if !reflect.DeepEqual(c.Spec.Template.Spec, old.Spec.Template.Spec) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("AzureClusterTemplate", "spec", "template", "spec"), c, AzureClusterTemplateImmutableMsg), - ) - } - - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureClusterTemplateKind).GroupKind(), c.Name, allErrs) -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_default.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_default.go index 7e216e82e6e7..cbc506ce6cdb 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_default.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_default.go @@ -17,69 +17,21 @@ limitations under the License. package v1beta1 import ( - "context" - "encoding/base64" "fmt" - "time" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5" - "github.com/pkg/errors" - "golang.org/x/crypto/ssh" - kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/uuid" - clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" - "sigs.k8s.io/controller-runtime/pkg/client" - - utilSSH "sigs.k8s.io/cluster-api-provider-azure/util/ssh" ) // ContributorRoleID is the ID of the built-in "Contributor" role. const ContributorRoleID = "b24988ac-6180-42a0-ab88-20f7382dd24c" // SetDefaultSSHPublicKey sets the default SSHPublicKey for an AzureMachine. -func (s *AzureMachineSpec) SetDefaultSSHPublicKey() error { - if sshKeyData := s.SSHPublicKey; sshKeyData == "" { - _, publicRsaKey, err := utilSSH.GenerateSSHKey() - if err != nil { - return err - } - - s.SSHPublicKey = base64.StdEncoding.EncodeToString(ssh.MarshalAuthorizedKey(publicRsaKey)) - } - return nil -} // SetDataDisksDefaults sets the data disk defaults for an AzureMachine. -func (s *AzureMachineSpec) SetDataDisksDefaults() { - set := make(map[int32]struct{}) - // populate all the existing values in the set - for _, disk := range s.DataDisks { - if disk.Lun != nil { - set[*disk.Lun] = struct{}{} - } - } - // Look for unique values for unassigned LUNs - for i, disk := range s.DataDisks { - if disk.Lun == nil { - for l := range s.DataDisks { - lun := int32(l) - if _, ok := set[lun]; !ok { - s.DataDisks[i].Lun = &lun - set[lun] = struct{}{} - break - } - } - } - if disk.CachingType == "" { - if s.DataDisks[i].ManagedDisk != nil && - s.DataDisks[i].ManagedDisk.StorageAccountType == string(armcompute.StorageAccountTypesUltraSSDLRS) { - s.DataDisks[i].CachingType = string(armcompute.CachingTypesNone) - } else { - s.DataDisks[i].CachingType = string(armcompute.CachingTypesReadWrite) - } - } - } -} + +// populate all the existing values in the set + +// Look for unique values for unassigned LUNs // SetIdentityDefaults sets the defaults for VM Identity. func (s *AzureMachineSpec) SetIdentityDefaults(subscriptionID string) { @@ -169,80 +121,9 @@ func (s *AzureMachineSpec) SetNetworkInterfacesDefaults() { } // GetOwnerAzureClusterNameAndNamespace returns the owner azure cluster's name and namespace for the given cluster name and namespace. -func GetOwnerAzureClusterNameAndNamespace(cli client.Client, clusterName string, namespace string, maxAttempts int) (azureClusterName string, azureClusterNamespace string, err error) { - ctx := context.Background() - - ownerCluster := &clusterv1.Cluster{} - key := client.ObjectKey{ - Namespace: namespace, - Name: clusterName, - } - - for i := 1; ; i++ { - if err := cli.Get(ctx, key, ownerCluster); err != nil { - if i > maxAttempts { - return "", "", errors.Wrapf(err, "failed to find owner cluster for %s/%s", namespace, clusterName) - } - time.Sleep(1 * time.Second) - continue - } - break - } - - return ownerCluster.Spec.InfrastructureRef.Name, ownerCluster.Namespace, nil -} // GetSubscriptionID returns the subscription ID for the AzureCluster given the cluster name and namespace. -func GetSubscriptionID(cli client.Client, ownerAzureClusterName string, ownerAzureClusterNamespace string, maxAttempts int) (string, error) { - ctx := context.Background() - - ownerAzureCluster := &AzureCluster{} - key := client.ObjectKey{ - Namespace: ownerAzureClusterNamespace, - Name: ownerAzureClusterName, - } - for i := 1; ; i++ { - if err := cli.Get(ctx, key, ownerAzureCluster); err != nil { - if i >= maxAttempts { - return "", errors.Wrapf(err, "failed to find AzureCluster for owner cluster %s/%s", ownerAzureClusterNamespace, ownerAzureClusterName) - } - time.Sleep(1 * time.Second) - continue - } - break - } - - return ownerAzureCluster.Spec.SubscriptionID, nil -} // SetDefaults sets to the defaults for the AzureMachineSpec. -func (m *AzureMachine) SetDefaults(client client.Client) error { - var errs []error - if err := m.Spec.SetDefaultSSHPublicKey(); err != nil { - errs = append(errs, errors.Wrap(err, "failed to set default SSH public key")) - } - // Fetch the Cluster. - clusterName, ok := m.Labels[clusterv1.ClusterNameLabel] - if !ok { - errs = append(errs, errors.Errorf("failed to fetch ClusterName for AzureMachine %s/%s", m.Namespace, m.Name)) - } - - ownerAzureClusterName, ownerAzureClusterNamespace, err := GetOwnerAzureClusterNameAndNamespace(client, clusterName, m.Namespace, 5) - if err != nil { - errs = append(errs, errors.Wrapf(err, "failed to fetch owner cluster for AzureMachine %s/%s", m.Namespace, m.Name)) - } - - subscriptionID, err := GetSubscriptionID(client, ownerAzureClusterName, ownerAzureClusterNamespace, 5) - if err != nil { - errs = append(errs, errors.Wrapf(err, "failed to fetch subscription ID for AzureMachine %s/%s", m.Namespace, m.Name)) - } - - m.Spec.SetDataDisksDefaults() - m.Spec.SetIdentityDefaults(subscriptionID) - m.Spec.SetSpotEvictionPolicyDefaults() - m.Spec.SetDiagnosticsDefaults() - m.Spec.SetNetworkInterfacesDefaults() - - return kerrors.NewAggregate(errs) -} +// Fetch the Cluster. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_validation.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_validation.go index d370f3eb590f..14958524a04a 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_validation.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_validation.go @@ -17,68 +17,13 @@ limitations under the License. package v1beta1 import ( - "encoding/base64" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5" - "github.com/google/uuid" - "golang.org/x/crypto/ssh" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/ptr" - - azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" ) // ValidateAzureMachineSpec checks an AzureMachineSpec and returns any validation errors. -func ValidateAzureMachineSpec(spec AzureMachineSpec) field.ErrorList { - var allErrs field.ErrorList - - if errs := ValidateImage(spec.Image, field.NewPath("image")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateOSDisk(spec.OSDisk, field.NewPath("osDisk")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateConfidentialCompute(spec.OSDisk.ManagedDisk, spec.SecurityProfile, field.NewPath("securityProfile")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateSSHKey(spec.SSHPublicKey, field.NewPath("sshPublicKey")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateUserAssignedIdentity(spec.Identity, spec.UserAssignedIdentities, field.NewPath("userAssignedIdentities")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateDataDisks(spec.DataDisks, field.NewPath("dataDisks")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateDiagnostics(spec.Diagnostics, field.NewPath("diagnostics")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateNetwork(spec.SubnetName, spec.AcceleratedNetworking, spec.NetworkInterfaces, field.NewPath("networkInterfaces")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateSystemAssignedIdentityRole(spec.Identity, spec.RoleAssignmentName, spec.SystemAssignedIdentityRole, field.NewPath("systemAssignedIdentityRole")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateCapacityReservationGroupID(spec.CapacityReservationGroupID, field.NewPath("capacityReservationGroupID")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := ValidateVMExtensions(spec.DisableExtensionOperations, spec.VMExtensions, field.NewPath("vmExtensions")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - return allErrs -} // ValidateNetwork validates the network configuration. func ValidateNetwork(subnetName string, acceleratedNetworking *bool, networkInterfaces []NetworkInterface, fldPath *field.Path) field.ErrorList { @@ -100,64 +45,10 @@ func ValidateNetwork(subnetName string, acceleratedNetworking *bool, networkInte } // ValidateSSHKey validates an SSHKey. -func ValidateSSHKey(sshKey string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - decoded, err := base64.StdEncoding.DecodeString(sshKey) - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, sshKey, "the SSH public key is not properly base64 encoded")) - return allErrs - } - - if _, _, _, _, err := ssh.ParseAuthorizedKey(decoded); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, sshKey, "the SSH public key is not valid")) - return allErrs - } - - return allErrs -} // ValidateSystemAssignedIdentity validates the system-assigned identities list. -func ValidateSystemAssignedIdentity(identityType VMIdentity, oldIdentity, newIdentity string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if identityType == VMIdentitySystemAssigned { - if _, err := uuid.Parse(newIdentity); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, newIdentity, "Role assignment name must be a valid GUID. It is optional and will be auto-generated when not specified.")) - } - if oldIdentity != "" && oldIdentity != newIdentity { - allErrs = append(allErrs, field.Invalid(fldPath, newIdentity, "Role assignment name should not be modified after AzureMachine creation.")) - } - } else if newIdentity != "" { - allErrs = append(allErrs, field.Forbidden(fldPath, "Role assignment name should only be set when using system assigned identity.")) - } - - return allErrs -} // ValidateUserAssignedIdentity validates the user-assigned identities list. -func ValidateUserAssignedIdentity(identityType VMIdentity, userAssignedIdentities []UserAssignedIdentity, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if len(userAssignedIdentities) > 0 && identityType != VMIdentityUserAssigned { - allErrs = append(allErrs, field.Invalid(fldPath, identityType, "must be set to 'UserAssigned' when assigning any user identity to the machine")) - } - - if identityType == VMIdentityUserAssigned { - if len(userAssignedIdentities) == 0 { - allErrs = append(allErrs, field.Required(fldPath, "must be specified for the 'UserAssigned' identity type")) - } - for _, identity := range userAssignedIdentities { - if identity.ProviderID != "" { - if _, err := azureutil.ParseResourceID(identity.ProviderID); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, identity.ProviderID, "must be a valid Azure resource ID")) - } - } - } - } - - return allErrs -} // ValidateSystemAssignedIdentityRole validates the system-assigned identity role. func ValidateSystemAssignedIdentityRole(identityType VMIdentity, roleAssignmentName string, role *SystemAssignedIdentityRole, fldPath *field.Path) field.ErrorList { @@ -180,114 +71,23 @@ func ValidateSystemAssignedIdentityRole(identityType VMIdentity, roleAssignmentN } // ValidateDataDisks validates a list of data disks. -func ValidateDataDisks(dataDisks []DataDisk, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - lunSet := make(map[int32]struct{}) - nameSet := make(map[string]struct{}) - for _, disk := range dataDisks { - // validate that the disk size is between 4 and 32767. - if disk.DiskSizeGB < 4 || disk.DiskSizeGB > 32767 { - allErrs = append(allErrs, field.Invalid(fieldPath.Child("DiskSizeGB"), "", "the disk size should be a value between 4 and 32767")) - } - - // validate that all names are unique - if disk.NameSuffix == "" { - allErrs = append(allErrs, field.Required(fieldPath.Child("NameSuffix"), "the name suffix cannot be empty")) - } - if _, ok := nameSet[disk.NameSuffix]; ok { - allErrs = append(allErrs, field.Duplicate(fieldPath, disk.NameSuffix)) - } else { - nameSet[disk.NameSuffix] = struct{}{} - } - // validate optional managed disk option - if disk.ManagedDisk != nil { - if errs := validateManagedDisk(disk.ManagedDisk, fieldPath.Child("managedDisk"), false); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - } - - // validate that all LUNs are unique and between 0 and 63. - if disk.Lun == nil { - allErrs = append(allErrs, field.Required(fieldPath, "LUN should not be nil")) - } else if *disk.Lun < 0 || *disk.Lun > 63 { - allErrs = append(allErrs, field.Invalid(fieldPath, disk.Lun, "logical unit number must be between 0 and 63")) - } else if _, ok := lunSet[*disk.Lun]; ok { - allErrs = append(allErrs, field.Duplicate(fieldPath, disk.Lun)) - } else { - lunSet[*disk.Lun] = struct{}{} - } - - // validate cachingType - allErrs = append(allErrs, validateCachingType(disk.CachingType, fieldPath, disk.ManagedDisk)...) - } - return allErrs -} +// validate that the disk size is between 4 and 32767. -// ValidateOSDisk validates the OSDisk spec. -func ValidateOSDisk(osDisk OSDisk, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} +// validate that all names are unique - if osDisk.DiskSizeGB != nil { - if *osDisk.DiskSizeGB <= 0 || *osDisk.DiskSizeGB > 2048 { - allErrs = append(allErrs, field.Invalid(fieldPath.Child("DiskSizeGB"), "", "the Disk size should be a value between 1 and 2048")) - } - } +// validate optional managed disk option - if osDisk.OSType == "" { - allErrs = append(allErrs, field.Required(fieldPath.Child("OSType"), "the OS type cannot be empty")) - } +// validate that all LUNs are unique and between 0 and 63. - allErrs = append(allErrs, validateCachingType(osDisk.CachingType, fieldPath, osDisk.ManagedDisk)...) +// validate cachingType - if osDisk.ManagedDisk != nil { - if errs := validateManagedDisk(osDisk.ManagedDisk, fieldPath.Child("managedDisk"), true); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - } - - if osDisk.DiffDiskSettings != nil && osDisk.ManagedDisk != nil && osDisk.ManagedDisk.DiskEncryptionSet != nil { - allErrs = append(allErrs, field.Invalid( - fieldPath.Child("managedDisks").Child("diskEncryptionSet"), - osDisk.ManagedDisk.DiskEncryptionSet.ID, - "diskEncryptionSet is not supported when diffDiskSettings.option is 'Local'", - )) - } - if osDisk.DiffDiskSettings != nil && osDisk.DiffDiskSettings.Placement != nil { - if osDisk.DiffDiskSettings.Option != string(armcompute.DiffDiskOptionsLocal) { - allErrs = append(allErrs, field.Invalid( - fieldPath.Child("diffDiskSettings"), - osDisk.DiffDiskSettings, - "placement is only supported when diffDiskSettings.option is 'Local'", - )) - } - } - - return allErrs -} +// ValidateOSDisk validates the OSDisk spec. // validateManagedDisk validates updates to the ManagedDiskParameters field. -func validateManagedDisk(m *ManagedDiskParameters, fieldPath *field.Path, isOSDisk bool) field.ErrorList { - allErrs := field.ErrorList{} - if m != nil { - allErrs = append(allErrs, validateStorageAccountType(m.StorageAccountType, fieldPath.Child("StorageAccountType"), isOSDisk)...) - - // DiskEncryptionSet can only be set when SecurityEncryptionType is set to DiskWithVMGuestState - // https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#securityencryptiontypes - if isOSDisk && m.SecurityProfile != nil && m.SecurityProfile.DiskEncryptionSet != nil { - if m.SecurityProfile.SecurityEncryptionType != SecurityEncryptionTypeDiskWithVMGuestState { - allErrs = append(allErrs, field.Invalid( - fieldPath.Child("securityProfile").Child("diskEncryptionSet"), - m.SecurityProfile.DiskEncryptionSet.ID, - "diskEncryptionSet is only supported when securityEncryptionType is set to DiskWithVMGuestState", - )) - } - } - } - - return allErrs -} +// DiskEncryptionSet can only be set when SecurityEncryptionType is set to DiskWithVMGuestState +// https://learn.microsoft.com/en-us/rest/api/compute/virtual-machines/create-or-update?tabs=HTTP#securityencryptiontypes // ValidateDataDisksUpdate validates updates to Data disks. func ValidateDataDisksUpdate(oldDataDisks, newDataDisks []DataDisk, fieldPath *field.Path) field.ErrorList { @@ -354,47 +154,6 @@ func validateManagedDisksUpdate(oldDiskParams, newDiskParams *ManagedDiskParamet return allErrs } -func validateStorageAccountType(storageAccountType string, fieldPath *field.Path, isOSDisk bool) field.ErrorList { - allErrs := field.ErrorList{} - - if isOSDisk && storageAccountType == string(armcompute.StorageAccountTypesUltraSSDLRS) { - allErrs = append(allErrs, field.Invalid(fieldPath.Child("managedDisks").Child("storageAccountType"), storageAccountType, "UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disks")) - } - - if storageAccountType == "" { - allErrs = append(allErrs, field.Required(fieldPath, "the Storage Account Type for Managed Disk cannot be empty")) - return allErrs - } - - for _, possibleStorageAccountType := range armcompute.PossibleDiskStorageAccountTypesValues() { - if string(possibleStorageAccountType) == storageAccountType { - return allErrs - } - } - allErrs = append(allErrs, field.Invalid(fieldPath, "", fmt.Sprintf("allowed values are %v", armcompute.PossibleDiskStorageAccountTypesValues()))) - return allErrs -} - -func validateCachingType(cachingType string, fieldPath *field.Path, managedDisk *ManagedDiskParameters) field.ErrorList { - allErrs := field.ErrorList{} - cachingTypeChildPath := fieldPath.Child("CachingType") - - if managedDisk != nil && managedDisk.StorageAccountType == string(armcompute.StorageAccountTypesUltraSSDLRS) { - if cachingType != string(armcompute.CachingTypesNone) { - allErrs = append(allErrs, field.Invalid(cachingTypeChildPath, cachingType, fmt.Sprintf("cachingType '%s' is not supported when storageAccountType is '%s'. Allowed values are: '%s'", cachingType, armcompute.StorageAccountTypesUltraSSDLRS, armcompute.CachingTypesNone))) - } - } - - for _, possibleCachingType := range armcompute.PossibleCachingTypesValues() { - if string(possibleCachingType) == cachingType { - return allErrs - } - } - - allErrs = append(allErrs, field.Invalid(cachingTypeChildPath, cachingType, fmt.Sprintf("allowed values are %v", armcompute.PossibleCachingTypesValues()))) - return allErrs -} - // ValidateDiagnostics validates the Diagnostic spec. func ValidateDiagnostics(diagnostics *Diagnostics, fieldPath *field.Path) field.ErrorList { var allErrs field.ErrorList @@ -479,17 +238,6 @@ func ValidateConfidentialCompute(managedDisk *ManagedDiskParameters, profile *Se } // ValidateCapacityReservationGroupID validates the capacity reservation group id. -func ValidateCapacityReservationGroupID(capacityReservationGroupID *string, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if capacityReservationGroupID != nil { - if _, err := azureutil.ParseResourceID(*capacityReservationGroupID); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, capacityReservationGroupID, "must be a valid Azure resource ID")) - } - } - - return allErrs -} // ValidateVMExtensions validates the VMExtensions spec. func ValidateVMExtensions(disableExtensionOperations *bool, vmExtensions []VMExtension, _ *field.Path) field.ErrorList { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_webhook.go deleted file mode 100644 index 246d160da245..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachine_webhook.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -// SetupAzureMachineWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureMachineWebhookWithManager(mgr ctrl.Manager) error { - mw := &azureMachineWebhook{Client: mgr.GetClient()} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureMachine{}). - WithDefaulter(mw). - WithValidator(mw). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachines,versions=v1beta1,name=validation.azuremachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachines,versions=v1beta1,name=default.azuremachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// azureMachineWebhook implements a validating and defaulting webhook for AzureMachines. -type azureMachineWebhook struct { - Client client.Client -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureMachineWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - m, ok := obj.(*AzureMachine) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureMachine resource") - } - spec := m.Spec - - allErrs := ValidateAzureMachineSpec(spec) - - roleAssignmentName := "" - if spec.SystemAssignedIdentityRole != nil { - roleAssignmentName = spec.SystemAssignedIdentityRole.Name - } - - if errs := ValidateSystemAssignedIdentity(spec.Identity, "", roleAssignmentName, field.NewPath("roleAssignmentName")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineKind).GroupKind(), m.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureMachineWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - old, ok := oldObj.(*AzureMachine) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureMachine resource") - } - m, ok := newObj.(*AzureMachine) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureMachine resource") - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "image"), - old.Spec.Image, - m.Spec.Image); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "identity"), - old.Spec.Identity, - m.Spec.Identity); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "systemAssignedIdentityRole"), - old.Spec.SystemAssignedIdentityRole, - m.Spec.SystemAssignedIdentityRole); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "userAssignedIdentities"), - old.Spec.UserAssignedIdentities, - m.Spec.UserAssignedIdentities); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "roleAssignmentName"), - old.Spec.RoleAssignmentName, - m.Spec.RoleAssignmentName); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "osDisk"), - old.Spec.OSDisk, - m.Spec.OSDisk); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "dataDisks"), - old.Spec.DataDisks, - m.Spec.DataDisks); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "sshPublicKey"), - old.Spec.SSHPublicKey, - m.Spec.SSHPublicKey); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "allocatePublicIP"), - old.Spec.AllocatePublicIP, - m.Spec.AllocatePublicIP); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "enableIPForwarding"), - old.Spec.EnableIPForwarding, - m.Spec.EnableIPForwarding); err != nil { - allErrs = append(allErrs, err) - } - - // Spec.AcceleratedNetworking can only be reset to nil and no other changes apart from that - // is accepted if the field is set. - // Ref issue #3518 - if err := webhookutils.ValidateZeroTransition( - field.NewPath("Spec", "AcceleratedNetworking"), - old.Spec.AcceleratedNetworking, - m.Spec.AcceleratedNetworking); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("Spec", "SpotVMOptions"), - old.Spec.SpotVMOptions, - m.Spec.SpotVMOptions); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("Spec", "SecurityProfile"), - old.Spec.SecurityProfile, - m.Spec.SecurityProfile); err != nil { - allErrs = append(allErrs, err) - } - - if old.Spec.Diagnostics != nil { - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "diagnostics"), - old.Spec.Diagnostics, - m.Spec.Diagnostics); err != nil { - allErrs = append(allErrs, err) - } - } - - if !reflect.DeepEqual(m.Spec.NetworkInterfaces, old.Spec.NetworkInterfaces) { - // The defaulting webhook may have migrated values from the old SubnetName field to the new NetworkInterfaces format. - old.Spec.SetNetworkInterfacesDefaults() - - // The reconciler will populate the SubnetName on the first interface if the user left it blank. - if old.Spec.NetworkInterfaces[0].SubnetName == "" && m.Spec.NetworkInterfaces[0].SubnetName != "" { - old.Spec.NetworkInterfaces[0].SubnetName = m.Spec.NetworkInterfaces[0].SubnetName - } - - // Enforce immutability for all other changes to NetworkInterfaces. - if !reflect.DeepEqual(m.Spec.NetworkInterfaces, old.Spec.NetworkInterfaces) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "networkInterfaces"), - m.Spec.NetworkInterfaces, "field is immutable"), - ) - } - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "capacityReservationGroupID"), - old.Spec.CapacityReservationGroupID, - m.Spec.CapacityReservationGroupID); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "disableExtensionOperations"), - old.Spec.DisableExtensionOperations, - m.Spec.DisableExtensionOperations); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "disableVMBootstrapExtension"), - old.Spec.DisableVMBootstrapExtension, - m.Spec.DisableVMBootstrapExtension); err != nil { - allErrs = append(allErrs, err) - } - - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineKind).GroupKind(), m.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureMachineWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (mw *azureMachineWebhook) Default(_ context.Context, obj runtime.Object) error { - m, ok := obj.(*AzureMachine) - if !ok { - return apierrors.NewBadRequest("expected an AzureMachine resource") - } - return m.SetDefaults(mw.Client) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_conversion.go deleted file mode 100644 index 2df32c10379c..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// Hub marks AzureMachineTemplate as a conversion hub. -func (*AzureMachineTemplate) Hub() {} - -// Hub marks AzureMachineTemplateList as a conversion hub. -func (*AzureMachineTemplateList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_webhook.go deleted file mode 100644 index e135e209db39..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremachinetemplate_webhook.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - "sigs.k8s.io/cluster-api/util/topology" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// AzureMachineTemplateImmutableMsg ... -const ( - AzureMachineTemplateImmutableMsg = "AzureMachineTemplate spec.template.spec field is immutable. Please create new resource instead. ref doc: https://cluster-api.sigs.k8s.io/tasks/updating-machine-templates.html" - AzureMachineTemplateRoleAssignmentNameMsg = "AzureMachineTemplate spec.template.spec.roleAssignmentName field can't be set" - AzureMachineTemplateSystemAssignedIdentityRoleNameMsg = "AzureMachineTemplate spec.template.spec.systemAssignedIdentityRole.name field can't be set" -) - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (r *AzureMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(azureMachineTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachinetemplates,versions=v1beta1,name=default.azuremachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremachinetemplates,versions=v1beta1,name=validation.azuremachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureMachineTemplateWebhook struct{} - -var _ webhook.CustomDefaulter = &azureMachineTemplateWebhook{} -var _ webhook.CustomValidator = &azureMachineTemplateWebhook{} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*azureMachineTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r := obj.(*AzureMachineTemplate) - spec := r.Spec.Template.Spec - - allErrs := ValidateAzureMachineSpec(spec) - - if spec.RoleAssignmentName != "" { - allErrs = append(allErrs, - field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "roleAssignmentName"), r, AzureMachineTemplateRoleAssignmentNameMsg), - ) - } - - if spec.SystemAssignedIdentityRole != nil && spec.SystemAssignedIdentityRole.Name != "" { - allErrs = append(allErrs, - field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "systemAssignedIdentityRole", "name"), r, AzureMachineTemplateSystemAssignedIdentityRoleNameMsg), - ) - } - - if (r.Spec.Template.Spec.NetworkInterfaces != nil) && len(r.Spec.Template.Spec.NetworkInterfaces) > 0 && r.Spec.Template.Spec.SubnetName != "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "networkInterfaces"), r.Spec.Template.Spec.NetworkInterfaces, "cannot set both NetworkInterfaces and machine SubnetName")) - } - - if (r.Spec.Template.Spec.NetworkInterfaces != nil) && len(r.Spec.Template.Spec.NetworkInterfaces) > 0 && r.Spec.Template.Spec.AcceleratedNetworking != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "acceleratedNetworking"), r.Spec.Template.Spec.NetworkInterfaces, "cannot set both NetworkInterfaces and machine AcceleratedNetworking")) - } - - for i, networkInterface := range r.Spec.Template.Spec.NetworkInterfaces { - if networkInterface.PrivateIPConfigs < 1 { - allErrs = append(allErrs, field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "networkInterfaces", "privateIPConfigs"), r.Spec.Template.Spec.NetworkInterfaces[i].PrivateIPConfigs, "networkInterface privateIPConfigs must be set to a minimum value of 1")) - } - } - - if ptr.Deref(r.Spec.Template.Spec.DisableExtensionOperations, false) && len(r.Spec.Template.Spec.VMExtensions) > 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("AzureMachineTemplate", "spec", "template", "spec", "vmExtensions"), "VMExtensions must be empty when DisableExtensionOperations is true")) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineTemplateKind).GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *azureMachineTemplateWebhook) ValidateUpdate(ctx context.Context, oldRaw runtime.Object, newRaw runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - old := oldRaw.(*AzureMachineTemplate) - t := newRaw.(*AzureMachineTemplate) - - req, err := admission.RequestFromContext(ctx) - if err != nil { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a admission.Request inside context: %v", err)) - } - - if !topology.IsDryRunRequest(req, t) && - !reflect.DeepEqual(t.Spec.Template.Spec, old.Spec.Template.Spec) { - // The equality failure could be because of default mismatch between v1alpha3 and v1beta1. This happens because - // the new object `r` will have run through the default webhooks but the old object `old` would not have so. - // This means if the old object was in v1alpha3, it would not get the new defaults set in v1beta1 resulting - // in object inequality. To workaround this, we set the v1beta1 defaults here so that the old object also gets - // the new defaults. - - // We need to set ssh key explicitly, otherwise Default() will create a new one. - if old.Spec.Template.Spec.SSHPublicKey == "" { - old.Spec.Template.Spec.SSHPublicKey = t.Spec.Template.Spec.SSHPublicKey - } - - if err := r.Default(ctx, old); err != nil { - allErrs = append(allErrs, - field.Invalid(field.NewPath("AzureMachineTemplate"), t, fmt.Sprintf("Unable to apply defaults: %v", err)), - ) - } - - // if it's still not equal, return error. - if !reflect.DeepEqual(t.Spec.Template.Spec, old.Spec.Template.Spec) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("AzureMachineTemplate", "spec", "template", "spec"), t, AzureMachineTemplateImmutableMsg), - ) - } - } - - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureMachineTemplateKind).GroupKind(), t.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*azureMachineTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default implements webhookutil.defaulter so a webhook will be registered for the type. -func (*azureMachineTemplateWebhook) Default(_ context.Context, obj runtime.Object) error { - t := obj.(*AzureMachineTemplate) - if err := t.Spec.Template.Spec.SetDefaultSSHPublicKey(); err != nil { - ctrl.Log.WithName("SetDefault").Error(err, "SetDefaultSSHPublicKey failed") - } - t.Spec.Template.Spec.SetDataDisksDefaults() - t.Spec.Template.Spec.SetNetworkInterfacesDefaults() - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_webhook.go deleted file mode 100644 index 78c6fe90398a..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcluster_webhook.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (r *AzureManagedCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(azureManagedClusterWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - Complete() -} - -type azureManagedClusterWebhook struct{} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclusters,versions=v1beta1,name=validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -var _ webhook.CustomValidator = &azureManagedClusterWebhook{} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterWebhook) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedclustertemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedclustertemplate_webhook.go deleted file mode 100644 index 84888c102c70..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedclustertemplate_webhook.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (r *AzureManagedClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(azureManagedClusterTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - Complete() -} - -// +kubebuilder:webhook:verbs=update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedclustertemplate,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedclustertemplates,versions=v1beta1,name=validation.azuremanagedclustertemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureManagedClusterTemplateWebhook struct{} - -var _ webhook.CustomValidator = &azureManagedClusterTemplateWebhook{} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterTemplateWebhook) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterTemplateWebhook) ValidateUpdate(_ context.Context, _, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (r *azureManagedClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_conversion.go deleted file mode 100644 index 56ddef15f026..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// Hub marks AzureManagedControlPlane as a conversion hub. -func (*AzureManagedControlPlane) Hub() {} - -// Hub marks AzureManagedControlPlaneList as a conversion hub. -func (*AzureManagedControlPlaneList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_default.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_default.go index 65275a89be1e..de83cc0221c5 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_default.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_default.go @@ -17,16 +17,11 @@ limitations under the License. package v1beta1 import ( - "encoding/base64" "fmt" "strings" - "golang.org/x/crypto/ssh" "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" - ctrl "sigs.k8s.io/controller-runtime" - - utilSSH "sigs.k8s.io/cluster-api-provider-azure/util/ssh" ) const ( @@ -50,18 +45,6 @@ func (m *AzureManagedControlPlane) setDefaultResourceGroupName() { } // setDefaultSSHPublicKey sets the default SSHPublicKey for an AzureManagedControlPlane. -func (m *AzureManagedControlPlane) setDefaultSSHPublicKey() error { - if sshKey := m.Spec.SSHPublicKey; sshKey != nil && *sshKey == "" { - _, publicRsaKey, err := utilSSH.GenerateSSHKey() - if err != nil { - return err - } - - m.Spec.SSHPublicKey = ptr.To(base64.StdEncoding.EncodeToString(ssh.MarshalAuthorizedKey(publicRsaKey))) - } - - return nil -} // setDefaultNodeResourceGroupName sets the default NodeResourceGroup for an AzureManagedControlPlane. func (m *AzureManagedControlPlane) setDefaultNodeResourceGroupName() { @@ -110,18 +93,6 @@ func setDefaultFleetsMember(fleetsMember *FleetsMember, labels map[string]string return result } -func setDefaultSku(sku *AKSSku) *AKSSku { - result := sku.DeepCopy() - if sku == nil { - result = new(AKSSku) - result.Tier = FreeManagedControlPlaneTier - } else if sku.Tier == PaidManagedControlPlaneTier { - result.Tier = StandardManagedControlPlaneTier - ctrl.Log.WithName("AzureManagedControlPlaneWebHookLogger").Info("Paid SKU tier is deprecated and has been replaced by Standard") - } - return result -} - func setDefaultVersion(version string) string { if version != "" && !strings.HasPrefix(version, "v") { normalizedVersion := "v" + version diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_webhook.go deleted file mode 100644 index 40a1a0f52437..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplane_webhook.go +++ /dev/null @@ -1,1259 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "net" - "reflect" - "regexp" - "strconv" - "strings" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/util/versions" - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -var ( - kubeSemver = regexp.MustCompile(`^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`) - rMaxNodeProvisionTime = regexp.MustCompile(`^(\d+)m$`) - rScaleDownTime = regexp.MustCompile(`^(\d+)m$`) - rScaleDownDelayAfterDelete = regexp.MustCompile(`^(\d+)s$`) - rScanInterval = regexp.MustCompile(`^(\d+)s$`) -) - -// SetupAzureManagedControlPlaneWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureManagedControlPlaneWebhookWithManager(mgr ctrl.Manager) error { - mw := &azureManagedControlPlaneWebhook{Client: mgr.GetClient()} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureManagedControlPlane{}). - WithDefaulter(mw). - WithValidator(mw). - Complete() -} - -// +kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedcontrolplanes,verbs=create;update,versions=v1beta1,name=default.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// azureManagedControlPlaneWebhook implements a validating and defaulting webhook for AzureManagedControlPlane. -type azureManagedControlPlaneWebhook struct { - Client client.Client -} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (mw *azureManagedControlPlaneWebhook) Default(_ context.Context, obj runtime.Object) error { - m, ok := obj.(*AzureManagedControlPlane) - if !ok { - return apierrors.NewBadRequest("expected an AzureManagedControlPlane") - } - - m.Spec.Version = setDefaultVersion(m.Spec.Version) - m.Spec.SKU = setDefaultSku(m.Spec.SKU) - m.Spec.FleetsMember = setDefaultFleetsMember(m.Spec.FleetsMember, m.Labels) - - if err := m.setDefaultSSHPublicKey(); err != nil { - ctrl.Log.WithName("AzureManagedControlPlaneWebHookLogger").Error(err, "setDefaultSSHPublicKey failed") - } - - m.setDefaultResourceGroupName() - m.setDefaultNodeResourceGroupName() - m.setDefaultVirtualNetwork() - m.setDefaultSubnet() - m.setDefaultOIDCIssuerProfile() - m.setDefaultDNSPrefix() - m.setDefaultAKSExtensions() - - return nil -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedcontrolplanes,versions=v1beta1,name=validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedControlPlaneWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - m, ok := obj.(*AzureManagedControlPlane) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlane") - } - - return nil, m.Validate(mw.Client) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedControlPlaneWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - old, ok := oldObj.(*AzureManagedControlPlane) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlane") - } - m, ok := newObj.(*AzureManagedControlPlane) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlane") - } - - immutableFields := []struct { - path *field.Path - old any - new any - }{ - {field.NewPath("spec", "subscriptionID"), old.Spec.SubscriptionID, m.Spec.SubscriptionID}, - {field.NewPath("spec", "resourceGroupName"), old.Spec.ResourceGroupName, m.Spec.ResourceGroupName}, - {field.NewPath("spec", "nodeResourceGroupName"), old.Spec.NodeResourceGroupName, m.Spec.NodeResourceGroupName}, - {field.NewPath("spec", "location"), old.Spec.Location, m.Spec.Location}, - {field.NewPath("spec", "sshPublicKey"), old.Spec.SSHPublicKey, m.Spec.SSHPublicKey}, - {field.NewPath("spec", "dnsServiceIP"), old.Spec.DNSServiceIP, m.Spec.DNSServiceIP}, - {field.NewPath("spec", "networkPlugin"), old.Spec.NetworkPlugin, m.Spec.NetworkPlugin}, - {field.NewPath("spec", "networkPolicy"), old.Spec.NetworkPolicy, m.Spec.NetworkPolicy}, - {field.NewPath("spec", "networkDataplane"), old.Spec.NetworkDataplane, m.Spec.NetworkDataplane}, - {field.NewPath("spec", "loadBalancerSKU"), old.Spec.LoadBalancerSKU, m.Spec.LoadBalancerSKU}, - {field.NewPath("spec", "httpProxyConfig"), old.Spec.HTTPProxyConfig, m.Spec.HTTPProxyConfig}, - {field.NewPath("spec", "azureEnvironment"), old.Spec.AzureEnvironment, m.Spec.AzureEnvironment}, - } - - for _, f := range immutableFields { - if err := webhookutils.ValidateImmutable(f.path, f.old, f.new); err != nil { - allErrs = append(allErrs, err) - } - } - - // This nil check is only to streamline tests from having to define this correctly in every test case. - // Normally, the defaulting webhooks will always set the new DNSPrefix so users can never entirely unset it. - if m.Spec.DNSPrefix != nil { - // Pre-1.12 versions of CAPZ do not set this field while 1.12+ defaults it, so emulate the current - // defaulting here to avoid unrelated updates from failing this immutability check due to the - // nil -> non-nil transition. - oldDNSPrefix := old.Spec.DNSPrefix - if oldDNSPrefix == nil { - oldDNSPrefix = ptr.To(old.Name) - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "dnsPrefix"), - oldDNSPrefix, - m.Spec.DNSPrefix, - ); err != nil { - allErrs = append(allErrs, err) - } - } - - // Consider removing this once moves out of preview - // Updating outboundType after cluster creation (PREVIEW) - // https://learn.microsoft.com/en-us/azure/aks/egress-outboundtype#updating-outboundtype-after-cluster-creation-preview - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "outboundType"), - old.Spec.OutboundType, - m.Spec.OutboundType); err != nil { - allErrs = append(allErrs, err) - } - - if errs := m.validateVirtualNetworkUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateAddonProfilesUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateAPIServerAccessProfileUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateNetworkPluginModeUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateAADProfileUpdateAndLocalAccounts(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateAutoUpgradeProfile(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateK8sVersionUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateOIDCIssuerProfileUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.validateFleetsMemberUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateAKSExtensionsUpdate(old.Spec.Extensions, m.Spec.Extensions); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := m.Spec.AzureManagedControlPlaneClassSpec.validateSecurityProfileUpdate(&old.Spec.AzureManagedControlPlaneClassSpec); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil, m.Validate(mw.Client) - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedControlPlaneKind).GroupKind(), m.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedControlPlaneWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Validate the Azure Managed Control Plane and return an aggregate error. -func (m *AzureManagedControlPlane) Validate(cli client.Client) error { - var allErrs field.ErrorList - validators := []func(client client.Client) field.ErrorList{ - m.validateSSHKey, - m.validateIdentity, - m.validateNetworkPluginMode, - m.validateDNSPrefix, - m.validateDisableLocalAccounts, - } - for _, validator := range validators { - if err := validator(cli); err != nil { - allErrs = append(allErrs, err...) - } - } - - allErrs = append(allErrs, validateVersion( - m.Spec.Version, - field.NewPath("spec").Child("version"))...) - - allErrs = append(allErrs, validateLoadBalancerProfile( - m.Spec.LoadBalancerProfile, - field.NewPath("spec").Child("loadBalancerProfile"))...) - - allErrs = append(allErrs, validateManagedClusterNetwork( - cli, - m.Labels, - m.Namespace, - m.Spec.DNSServiceIP, - m.Spec.VirtualNetwork.Subnet, - field.NewPath("spec"))...) - - allErrs = append(allErrs, validateName(m.Name, field.NewPath("name"))...) - - allErrs = append(allErrs, validateAutoScalerProfile(m.Spec.AutoScalerProfile, field.NewPath("spec").Child("autoScalerProfile"))...) - - allErrs = append(allErrs, validateAKSExtensions(m.Spec.Extensions, field.NewPath("spec").Child("aksExtensions"))...) - - allErrs = append(allErrs, m.Spec.AzureManagedControlPlaneClassSpec.validateSecurityProfile()...) - - allErrs = append(allErrs, validateNetworkPolicy(m.Spec.NetworkPolicy, m.Spec.NetworkDataplane, field.NewPath("spec").Child("networkPolicy"))...) - - allErrs = append(allErrs, validateNetworkDataplane(m.Spec.NetworkDataplane, m.Spec.NetworkPolicy, m.Spec.NetworkPluginMode, field.NewPath("spec").Child("networkDataplane"))...) - - allErrs = append(allErrs, validateAPIServerAccessProfile(m.Spec.APIServerAccessProfile, field.NewPath("spec").Child("apiServerAccessProfile"))...) - - allErrs = append(allErrs, validateAMCPVirtualNetwork(m.Spec.VirtualNetwork, field.NewPath("spec").Child("virtualNetwork"))...) - - allErrs = append(allErrs, validateFleetsMember(m.Spec.FleetsMember, field.NewPath("spec").Child("fleetsMember"))...) - - return allErrs.ToAggregate() -} - -func (m *AzureManagedControlPlane) validateDNSPrefix(_ client.Client) field.ErrorList { - if m.Spec.DNSPrefix == nil { - return nil - } - - // Regex pattern for DNS prefix validation - // 1. Between 1 and 54 characters long: {1,54} - // 2. Alphanumerics and hyphens: [a-zA-Z0-9-] - // 3. Start and end with alphanumeric: ^[a-zA-Z0-9].*[a-zA-Z0-9]$ - pattern := `^[a-zA-Z0-9][a-zA-Z0-9-]{0,52}[a-zA-Z0-9]$` - regex := regexp.MustCompile(pattern) - if regex.MatchString(ptr.Deref(m.Spec.DNSPrefix, "")) { - return nil - } - allErrs := field.ErrorList{ - field.Invalid(field.NewPath("spec", "dnsPrefix"), *m.Spec.DNSPrefix, "DNSPrefix is invalid, does not match regex: "+pattern), - } - return allErrs -} - -// validateSecurityProfile validates SecurityProfile. -func (m *AzureManagedControlPlaneClassSpec) validateSecurityProfile() field.ErrorList { - allErrs := field.ErrorList{} - if err := m.validateAzureKeyVaultKms(); err != nil { - allErrs = append(allErrs, err...) - } - if err := m.validateWorkloadIdentity(); err != nil { - allErrs = append(allErrs, err...) - } - return allErrs -} - -// validateAzureKeyVaultKms validates AzureKeyVaultKms. -func (m *AzureManagedControlPlaneClassSpec) validateAzureKeyVaultKms() field.ErrorList { - if m.SecurityProfile != nil && m.SecurityProfile.AzureKeyVaultKms != nil { - if !m.isUserManagedIdentityEnabled() { - allErrs := field.ErrorList{ - field.Invalid(field.NewPath("spec", "securityProfile", "azureKeyVaultKms", "keyVaultResourceID"), - m.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID, - "Spec.SecurityProfile.AzureKeyVaultKms can be set only when Spec.Identity.Type is UserAssigned"), - } - return allErrs - } - keyVaultNetworkAccess := ptr.Deref(m.SecurityProfile.AzureKeyVaultKms.KeyVaultNetworkAccess, KeyVaultNetworkAccessTypesPublic) - keyVaultResourceID := ptr.Deref(m.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID, "") - if keyVaultNetworkAccess == KeyVaultNetworkAccessTypesPrivate && keyVaultResourceID == "" { - allErrs := field.ErrorList{ - field.Invalid(field.NewPath("spec", "securityProfile", "azureKeyVaultKms", "keyVaultResourceID"), - m.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID, - "Spec.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID cannot be empty when Spec.SecurityProfile.AzureKeyVaultKms.KeyVaultNetworkAccess is Private"), - } - return allErrs - } - if keyVaultNetworkAccess == KeyVaultNetworkAccessTypesPublic && keyVaultResourceID != "" { - allErrs := field.ErrorList{ - field.Invalid(field.NewPath("spec", "securityProfile", "azureKeyVaultKms", "keyVaultResourceID"), m.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID, - "Spec.SecurityProfile.AzureKeyVaultKms.KeyVaultResourceID should be empty when Spec.SecurityProfile.AzureKeyVaultKms.KeyVaultNetworkAccess is Public"), - } - return allErrs - } - } - return nil -} - -// validateWorkloadIdentity validates WorkloadIdentity. -func (m *AzureManagedControlPlaneClassSpec) validateWorkloadIdentity() field.ErrorList { - if m.SecurityProfile != nil && m.SecurityProfile.WorkloadIdentity != nil && !m.isOIDCEnabled() { - allErrs := field.ErrorList{ - field.Invalid(field.NewPath("spec", "securityProfile", "workloadIdentity"), m.SecurityProfile.WorkloadIdentity, - "Spec.SecurityProfile.WorkloadIdentity cannot be enabled when Spec.OIDCIssuerProfile is disabled"), - } - return allErrs - } - return nil -} - -// validateDisableLocalAccounts disabling local accounts for AAD based clusters. -func (m *AzureManagedControlPlane) validateDisableLocalAccounts(_ client.Client) field.ErrorList { - if m.Spec.DisableLocalAccounts != nil && m.Spec.AADProfile == nil { - return field.ErrorList{ - field.Invalid(field.NewPath("spec", "disableLocalAccounts"), *m.Spec.DisableLocalAccounts, "DisableLocalAccounts should be set only for AAD enabled clusters"), - } - } - return nil -} - -// validateVersion validates the Kubernetes version. -func validateVersion(version string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if !kubeSemver.MatchString(version) { - allErrs = append(allErrs, field.Invalid(fldPath, version, "must be a valid semantic version")) - } - - return allErrs -} - -// validateSSHKey validates an SSHKey. -func (m *AzureManagedControlPlane) validateSSHKey(_ client.Client) field.ErrorList { - if sshKey := m.Spec.SSHPublicKey; sshKey != nil && *sshKey != "" { - if errs := ValidateSSHKey(*sshKey, field.NewPath("sshKey")); len(errs) > 0 { - return errs - } - } - - return nil -} - -// validateLoadBalancerProfile validates a LoadBalancerProfile. -func validateLoadBalancerProfile(loadBalancerProfile *LoadBalancerProfile, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if loadBalancerProfile != nil { - numOutboundIPTypes := 0 - - if loadBalancerProfile.ManagedOutboundIPs != nil { - if *loadBalancerProfile.ManagedOutboundIPs < 1 || *loadBalancerProfile.ManagedOutboundIPs > 100 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ManagedOutboundIPs"), *loadBalancerProfile.ManagedOutboundIPs, "value should be in between 1 and 100")) - } - } - - if loadBalancerProfile.AllocatedOutboundPorts != nil { - if *loadBalancerProfile.AllocatedOutboundPorts < 0 || *loadBalancerProfile.AllocatedOutboundPorts > 64000 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("AllocatedOutboundPorts"), *loadBalancerProfile.AllocatedOutboundPorts, "value should be in between 0 and 64000")) - } - } - - if loadBalancerProfile.IdleTimeoutInMinutes != nil { - if *loadBalancerProfile.IdleTimeoutInMinutes < 4 || *loadBalancerProfile.IdleTimeoutInMinutes > 120 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("IdleTimeoutInMinutes"), *loadBalancerProfile.IdleTimeoutInMinutes, "value should be in between 4 and 120")) - } - } - - if loadBalancerProfile.ManagedOutboundIPs != nil { - numOutboundIPTypes++ - } - if len(loadBalancerProfile.OutboundIPPrefixes) > 0 { - numOutboundIPTypes++ - } - if len(loadBalancerProfile.OutboundIPs) > 0 { - numOutboundIPTypes++ - } - if numOutboundIPTypes > 1 { - allErrs = append(allErrs, field.Forbidden(fldPath, "load balancer profile must specify at most one of ManagedOutboundIPs, OutboundIPPrefixes and OutboundIPs")) - } - } - - return allErrs -} - -func validateAMCPVirtualNetwork(virtualNetwork ManagedControlPlaneVirtualNetwork, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - // VirtualNetwork and the CIDR blocks get defaulted in the defaulting webhook, so we can assume they are always set. - if !reflect.DeepEqual(virtualNetwork, ManagedControlPlaneVirtualNetwork{}) { - _, parentNet, vnetErr := net.ParseCIDR(virtualNetwork.CIDRBlock) - if vnetErr != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("CIDRBlock"), virtualNetwork.CIDRBlock, "pre-existing virtual networks CIDR block is invalid")) - } - subnetIP, _, subnetErr := net.ParseCIDR(virtualNetwork.Subnet.CIDRBlock) - if subnetErr != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("Subnet", "CIDRBlock"), virtualNetwork.CIDRBlock, "pre-existing subnets CIDR block is invalid")) - } - if vnetErr == nil && subnetErr == nil && !parentNet.Contains(subnetIP) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("CIDRBlock"), virtualNetwork.CIDRBlock, "pre-existing virtual networks CIDR block should contain the subnet CIDR block")) - } - } - return allErrs -} - -func validateFleetsMember(fleetsMember *FleetsMember, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if fleetsMember != nil && fleetsMember.Name != "" { - match, _ := regexp.MatchString(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`, fleetsMember.Name) - if !match { - allErrs = append(allErrs, - field.Invalid( - fldPath.Child("Name"), - fleetsMember.Name, - "Name must match ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", - ), - ) - } - } - - return allErrs -} - -// validateAPIServerAccessProfile validates an APIServerAccessProfile. -func validateAPIServerAccessProfile(apiServerAccessProfile *APIServerAccessProfile, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if apiServerAccessProfile != nil { - for _, ipRange := range apiServerAccessProfile.AuthorizedIPRanges { - if _, _, err := net.ParseCIDR(ipRange); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, ipRange, "invalid CIDR format")) - } - } - - // privateDNSZone should either be "System" or "None" or the private dns zone name should be in either of these - // formats: 'private..azmk8s.io,privatelink..azmk8s.io,[a-zA-Z0-9-]{1,32}.private..azmk8s.io, - // [a-zA-Z0-9-]{1,32}.privatelink..azmk8s.io'. The validation below follows the guidelines mentioned at - // https://learn.microsoft.com/azure/aks/private-clusters?tabs=azure-portal#configure-a-private-dns-zone. - // Performing a lower case comparison to avoid case sensitivity. - if apiServerAccessProfile.PrivateDNSZone != nil { - privateDNSZone := strings.ToLower(ptr.Deref(apiServerAccessProfile.PrivateDNSZone, "")) - if !strings.EqualFold(strings.ToLower(privateDNSZone), "system") && - !strings.EqualFold(strings.ToLower(privateDNSZone), "none") { - // Extract substring starting from "privatednszones/" - startIndex := strings.Index(strings.ToLower(privateDNSZone), "privatednszones/") - if startIndex == -1 { - allErrs = append(allErrs, field.Invalid(fldPath, privateDNSZone, "invalid private DNS zone")) - return allErrs - } - - // Private DNS Zones can only be used by private clusters. - if !ptr.Deref(apiServerAccessProfile.EnablePrivateCluster, false) { - allErrs = append(allErrs, field.Invalid(fldPath, apiServerAccessProfile.EnablePrivateCluster, "Private Cluster should be enabled to use PrivateDNSZone")) - return allErrs - } - - extractedPrivateDNSZone := privateDNSZone[startIndex+len("privatednszones/"):] - - patternWithLocation := `^(privatelink|private)\.[a-zA-Z0-9]+\.(azmk8s\.io)$` - locationRegex := regexp.MustCompile(patternWithLocation) - patternWithSubzone := `^[a-zA-Z0-9-]{1,32}\.(privatelink|private)\.[a-zA-Z0-9]+\.(azmk8s\.io)$` - subzoneRegex := regexp.MustCompile(patternWithSubzone) - - // check if privateDNSZone is a valid resource ID - if !locationRegex.MatchString(extractedPrivateDNSZone) && !subzoneRegex.MatchString(extractedPrivateDNSZone) { - allErrs = append(allErrs, field.Invalid(fldPath, privateDNSZone, "invalid privateDnsZone resource ID. Each label the private dns zone name should be in either of these formats: 'private..azmk8s.io,privatelink..azmk8s.io,[a-zA-Z0-9-]{1,32}.private..azmk8s.io,[a-zA-Z0-9-]{1,32}.privatelink..azmk8s.io'")) - } - } - } - } - return allErrs -} - -// validateManagedClusterNetwork validates the Cluster network values. -func validateManagedClusterNetwork(cli client.Client, labels map[string]string, namespace string, dnsServiceIP *string, subnet ManagedControlPlaneSubnet, fldPath *field.Path) field.ErrorList { - var ( - allErrs field.ErrorList - serviceCIDR string - ) - - ctx := context.Background() - - // Fetch the Cluster. - clusterName, ok := labels[clusterv1.ClusterNameLabel] - if !ok { - return nil - } - - ownerCluster := &clusterv1.Cluster{} - key := client.ObjectKey{ - Namespace: namespace, - Name: clusterName, - } - - if err := cli.Get(ctx, key, ownerCluster); err != nil { - allErrs = append(allErrs, field.InternalError(field.NewPath("Cluster", "spec", "clusterNetwork"), err)) - return allErrs - } - - clusterNetwork := ownerCluster.Spec.ClusterNetwork - // A user may provide zero or one CIDR blocks. If they provide an empty array, - // we ignore it and use the default. AKS doesn't support > 1 Service/Pod CIDR. - if len(clusterNetwork.Services.CIDRBlocks) > 1 { - allErrs = append(allErrs, field.TooMany(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "cidrBlocks"), len(clusterNetwork.Services.CIDRBlocks), 1)) - } - if len(clusterNetwork.Services.CIDRBlocks) == 1 { - serviceCIDR = clusterNetwork.Services.CIDRBlocks[0] - } - // A user may provide zero or one CIDR blocks. If they provide an empty array, - // we ignore it and use the default. AKS doesn't support > 1 Service/Pod CIDR. - if len(clusterNetwork.Pods.CIDRBlocks) > 1 { - allErrs = append(allErrs, field.TooMany(field.NewPath("Cluster", "spec", "clusterNetwork", "pods", "cidrBlocks"), len(clusterNetwork.Pods.CIDRBlocks), 1)) - } - - if dnsServiceIP != nil { - if serviceCIDR == "" { - allErrs = append(allErrs, field.Required(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "cidrBlocks"), "service CIDR must be specified if specifying DNSServiceIP")) - } - _, cidr, err := net.ParseCIDR(serviceCIDR) - if err != nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "cidrBlocks"), serviceCIDR, fmt.Sprintf("failed to parse cluster service cidr: %v", err))) - } - - dnsIP := net.ParseIP(*dnsServiceIP) - if dnsIP == nil { // dnsIP will be nil if the string is not a valid IP - allErrs = append(allErrs, field.Invalid(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "dnsServiceIP"), *dnsServiceIP, "must be a valid IP address")) - } - - if dnsIP != nil && !cidr.Contains(dnsIP) { - allErrs = append(allErrs, field.Invalid(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "cidrBlocks"), serviceCIDR, "DNSServiceIP must reside within the associated cluster serviceCIDR")) - } - - // AKS only supports .10 as the last octet for the DNSServiceIP. - // Refer to: https://learn.microsoft.com/en-us/azure/aks/configure-kubenet#create-an-aks-cluster-with-system-assigned-managed-identities - targetSuffix := ".10" - if dnsIP != nil && !strings.HasSuffix(dnsIP.String(), targetSuffix) { - allErrs = append(allErrs, field.Invalid(field.NewPath("Cluster", "spec", "clusterNetwork", "services", "dnsServiceIP"), *dnsServiceIP, fmt.Sprintf("must end with %q", targetSuffix))) - } - } - - if errs := validatePrivateEndpoints(subnet.PrivateEndpoints, []string{subnet.CIDRBlock}, fldPath.Child("VirtualNetwork.Subnet.PrivateEndpoints")); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - return allErrs -} - -// validateAutoUpgradeProfile validates auto upgrade profile. -func (m *AzureManagedControlPlane) validateAutoUpgradeProfile(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - if old.Spec.AutoUpgradeProfile != nil { - if old.Spec.AutoUpgradeProfile.UpgradeChannel != nil && (m.Spec.AutoUpgradeProfile == nil || m.Spec.AutoUpgradeProfile.UpgradeChannel == nil) { - // Prevent AutoUpgradeProfile.UpgradeChannel to be set to nil. - // Unsetting the field is not allowed. - allErrs = append(allErrs, - field.Invalid( - field.NewPath("Spec", "AutoUpgradeProfile", "UpgradeChannel"), - old.Spec.AutoUpgradeProfile.UpgradeChannel, - "field cannot be set to nil, to disable auto upgrades set the channel to none.")) - } - } - return allErrs -} - -// validateK8sVersionUpdate validates K8s version. -func (m *AzureManagedControlPlane) validateK8sVersionUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - if hv := versions.GetHigherK8sVersion(m.Spec.Version, old.Spec.Version); hv != m.Spec.Version { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "version"), - m.Spec.Version, "field version cannot be downgraded"), - ) - } - - if old.Status.AutoUpgradeVersion != "" && m.Spec.Version != old.Spec.Version { - if hv := versions.GetHigherK8sVersion(m.Spec.Version, old.Status.AutoUpgradeVersion); hv != m.Spec.Version { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "version"), - m.Spec.Version, "version is auto-upgraded to "+old.Status.AutoUpgradeVersion+", cannot be downgraded"), - ) - } - } - return allErrs -} - -// validateAPIServerAccessProfileUpdate validates update to APIServerAccessProfile. -func (m *AzureManagedControlPlane) validateAPIServerAccessProfileUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - - newAPIServerAccessProfileNormalized := &APIServerAccessProfile{} - oldAPIServerAccessProfileNormalized := &APIServerAccessProfile{} - if m.Spec.APIServerAccessProfile != nil { - newAPIServerAccessProfileNormalized = &APIServerAccessProfile{ - APIServerAccessProfileClassSpec: APIServerAccessProfileClassSpec{ - EnablePrivateCluster: m.Spec.APIServerAccessProfile.EnablePrivateCluster, - PrivateDNSZone: m.Spec.APIServerAccessProfile.PrivateDNSZone, - EnablePrivateClusterPublicFQDN: m.Spec.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, - }, - } - } - if old.Spec.APIServerAccessProfile != nil { - oldAPIServerAccessProfileNormalized = &APIServerAccessProfile{ - APIServerAccessProfileClassSpec: APIServerAccessProfileClassSpec{ - EnablePrivateCluster: old.Spec.APIServerAccessProfile.EnablePrivateCluster, - PrivateDNSZone: old.Spec.APIServerAccessProfile.PrivateDNSZone, - EnablePrivateClusterPublicFQDN: old.Spec.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, - }, - } - } - - if !reflect.DeepEqual(newAPIServerAccessProfileNormalized, oldAPIServerAccessProfileNormalized) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "apiServerAccessProfile"), - m.Spec.APIServerAccessProfile, "fields (except for AuthorizedIPRanges) are immutable"), - ) - } - - return allErrs -} - -// validateAddonProfilesUpdate validates update to AddonProfiles. -func (m *AzureManagedControlPlane) validateAddonProfilesUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - newAddonProfileMap := map[string]struct{}{} - if len(old.Spec.AddonProfiles) != 0 { - for _, addonProfile := range m.Spec.AddonProfiles { - newAddonProfileMap[addonProfile.Name] = struct{}{} - } - for i, addonProfile := range old.Spec.AddonProfiles { - if _, ok := newAddonProfileMap[addonProfile.Name]; !ok { - allErrs = append(allErrs, field.Invalid( - field.NewPath("spec", "addonProfiles"), - m.Spec.AddonProfiles, - fmt.Sprintf("cannot remove addonProfile %s, To disable this AddonProfile, update Spec.AddonProfiles[%v].Enabled to false", addonProfile.Name, i))) - } - } - } - return allErrs -} - -// validateVirtualNetworkUpdate validates update to VirtualNetwork. -func (m *AzureManagedControlPlane) validateVirtualNetworkUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - if old.Spec.VirtualNetwork.Name != m.Spec.VirtualNetwork.Name { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "virtualNetwork", "name"), - m.Spec.VirtualNetwork.Name, - "Virtual Network Name is immutable")) - } - - if old.Spec.VirtualNetwork.CIDRBlock != m.Spec.VirtualNetwork.CIDRBlock { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "virtualNetwork", "cidrBlock"), - m.Spec.VirtualNetwork.CIDRBlock, - "Virtual Network CIDRBlock is immutable")) - } - - if old.Spec.VirtualNetwork.Subnet.Name != m.Spec.VirtualNetwork.Subnet.Name { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "virtualNetwork", "subnet", "name"), - m.Spec.VirtualNetwork.Subnet.Name, - "Subnet Name is immutable")) - } - - // NOTE: This only works because we force the user to set the CIDRBlock for both the - // managed and unmanaged Vnets. If we ever update the subnet cidr based on what's - // actually set in the subnet, and it is different from what's in the Spec, for - // unmanaged Vnets like we do with the AzureCluster this logic will break. - if old.Spec.VirtualNetwork.Subnet.CIDRBlock != m.Spec.VirtualNetwork.Subnet.CIDRBlock { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "virtualNetwork", "subnet", "cidrBlock"), - m.Spec.VirtualNetwork.Subnet.CIDRBlock, - "Subnet CIDRBlock is immutable")) - } - - if old.Spec.VirtualNetwork.ResourceGroup != m.Spec.VirtualNetwork.ResourceGroup { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "virtualNetwork", "resourceGroup"), - m.Spec.VirtualNetwork.ResourceGroup, - "Virtual Network Resource Group is immutable")) - } - return allErrs -} - -// validateNetworkPluginModeUpdate validates update to NetworkPluginMode. -func (m *AzureManagedControlPlane) validateNetworkPluginModeUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - - if ptr.Deref(old.Spec.NetworkPluginMode, "") != NetworkPluginModeOverlay && - ptr.Deref(m.Spec.NetworkPluginMode, "") == NetworkPluginModeOverlay && - old.Spec.NetworkPolicy != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "networkPluginMode"), fmt.Sprintf("%q NetworkPluginMode cannot be enabled when NetworkPolicy is set", NetworkPluginModeOverlay))) - } - - return allErrs -} - -// validateAADProfileUpdateAndLocalAccounts validates updates for AADProfile. -func (m *AzureManagedControlPlane) validateAADProfileUpdateAndLocalAccounts(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - if old.Spec.AADProfile != nil { - if m.Spec.AADProfile == nil { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "aadProfile"), - m.Spec.AADProfile, - "field cannot be nil, cannot disable AADProfile")) - } else { - if !m.Spec.AADProfile.Managed && old.Spec.AADProfile.Managed { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "aadProfile", "managed"), - m.Spec.AADProfile.Managed, - "cannot set AADProfile.Managed to false")) - } - if len(m.Spec.AADProfile.AdminGroupObjectIDs) == 0 { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "aadProfile", "adminGroupObjectIDs"), - m.Spec.AADProfile.AdminGroupObjectIDs, - "length of AADProfile.AdminGroupObjectIDs cannot be zero")) - } - } - } - - if old.Spec.DisableLocalAccounts == nil && - m.Spec.DisableLocalAccounts != nil && - m.Spec.AADProfile == nil { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "disableLocalAccounts"), - m.Spec.DisableLocalAccounts, - "DisableLocalAccounts can be set only for AAD enabled clusters")) - } - - if old.Spec.DisableLocalAccounts != nil { - // Prevent DisableLocalAccounts modification if it was already set to some value - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "disableLocalAccounts"), - m.Spec.DisableLocalAccounts, - old.Spec.DisableLocalAccounts, - ); err != nil { - allErrs = append(allErrs, err) - } - } - - return allErrs -} - -// validateSecurityProfileUpdate validates a SecurityProfile update. -func (m *AzureManagedControlPlaneClassSpec) validateSecurityProfileUpdate(old *AzureManagedControlPlaneClassSpec) field.ErrorList { - var allErrs field.ErrorList - if old.SecurityProfile != nil { - if errAzureKeyVaultKms := m.validateAzureKeyVaultKmsUpdate(old); errAzureKeyVaultKms != nil { - allErrs = append(allErrs, errAzureKeyVaultKms...) - } - if errWorkloadIdentity := m.validateWorkloadIdentityUpdate(old); errWorkloadIdentity != nil { - allErrs = append(allErrs, errWorkloadIdentity...) - } - if errWorkloadIdentity := m.validateImageCleanerUpdate(old); errWorkloadIdentity != nil { - allErrs = append(allErrs, errWorkloadIdentity...) - } - if errWorkloadIdentity := m.validateDefender(old); errWorkloadIdentity != nil { - allErrs = append(allErrs, errWorkloadIdentity...) - } - } - return allErrs -} - -// validateAzureKeyVaultKmsUpdate validates AzureKeyVaultKmsUpdate profile. -func (m *AzureManagedControlPlaneClassSpec) validateAzureKeyVaultKmsUpdate(old *AzureManagedControlPlaneClassSpec) field.ErrorList { - var allErrs field.ErrorList - if old.SecurityProfile.AzureKeyVaultKms != nil { - if m.SecurityProfile == nil || m.SecurityProfile.AzureKeyVaultKms == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "securityProfile", "azureKeyVaultKms"), - nil, "cannot unset Spec.SecurityProfile.AzureKeyVaultKms profile to disable the profile please set Spec.SecurityProfile.AzureKeyVaultKms.Enabled to false")) - return allErrs - } - } - return allErrs -} - -// validateWorkloadIdentityUpdate validates WorkloadIdentityUpdate profile. -func (m *AzureManagedControlPlaneClassSpec) validateWorkloadIdentityUpdate(old *AzureManagedControlPlaneClassSpec) field.ErrorList { - var allErrs field.ErrorList - if old.SecurityProfile.WorkloadIdentity != nil { - if m.SecurityProfile == nil || m.SecurityProfile.WorkloadIdentity == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "securityProfile", "workloadIdentity"), - nil, "cannot unset Spec.SecurityProfile.WorkloadIdentity, to disable workloadIdentity please set Spec.SecurityProfile.WorkloadIdentity.Enabled to false")) - } - } - return allErrs -} - -// validateImageCleanerUpdate validates ImageCleanerUpdate profile. -func (m *AzureManagedControlPlaneClassSpec) validateImageCleanerUpdate(old *AzureManagedControlPlaneClassSpec) field.ErrorList { - var allErrs field.ErrorList - if old.SecurityProfile.ImageCleaner != nil { - if m.SecurityProfile == nil || m.SecurityProfile.ImageCleaner == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "securityProfile", "imageCleaner"), - nil, "cannot unset Spec.SecurityProfile.ImageCleaner, to disable imageCleaner please set Spec.SecurityProfile.ImageCleaner.Enabled to false")) - } - } - return allErrs -} - -// validateDefender validates defender profile. -func (m *AzureManagedControlPlaneClassSpec) validateDefender(old *AzureManagedControlPlaneClassSpec) field.ErrorList { - var allErrs field.ErrorList - if old.SecurityProfile.Defender != nil { - if m.SecurityProfile == nil || m.SecurityProfile.Defender == nil { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "securityProfile", "defender"), - nil, "cannot unset Spec.SecurityProfile.Defender, to disable defender please set Spec.SecurityProfile.Defender.SecurityMonitoring.Enabled to false")) - } - } - return allErrs -} - -// validateOIDCIssuerProfile validates an OIDCIssuerProfile. -func (m *AzureManagedControlPlane) validateOIDCIssuerProfileUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - if m.Spec.OIDCIssuerProfile != nil && old.Spec.OIDCIssuerProfile != nil { - if m.Spec.OIDCIssuerProfile.Enabled != nil && old.Spec.OIDCIssuerProfile.Enabled != nil && - !*m.Spec.OIDCIssuerProfile.Enabled && *old.Spec.OIDCIssuerProfile.Enabled { - allErrs = append(allErrs, - field.Forbidden( - field.NewPath("spec", "oidcIssuerProfile", "enabled"), - "cannot be disabled", - ), - ) - } - } - return allErrs -} - -// validateFleetsMemberUpdate validates a FleetsMember. -func (m *AzureManagedControlPlane) validateFleetsMemberUpdate(old *AzureManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - - if old.Spec.FleetsMember == nil || m.Spec.FleetsMember == nil { - return allErrs - } - if old.Spec.FleetsMember.Name != "" && old.Spec.FleetsMember.Name != m.Spec.FleetsMember.Name { - allErrs = append(allErrs, - field.Forbidden( - field.NewPath("spec", "fleetsMember", "name"), - "Name is immutable", - ), - ) - } - - return allErrs -} - -// validateAKSExtensionsUpdate validates update to AKS extensions. -func validateAKSExtensionsUpdate(old []AKSExtension, current []AKSExtension) field.ErrorList { - var allErrs field.ErrorList - - oldAKSExtensionsMap := make(map[string]AKSExtension, len(old)) - oldAKSExtensionsIndex := make(map[string]int, len(old)) - for i, extension := range old { - oldAKSExtensionsMap[extension.Name] = extension - oldAKSExtensionsIndex[extension.Name] = i - } - for i, extension := range current { - oldExtension, ok := oldAKSExtensionsMap[extension.Name] - if !ok { - continue - } - if extension.Name != oldExtension.Name { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "name"), - extension.Name, - "field is immutable", - ), - ) - } - if (oldExtension.ExtensionType != nil && extension.ExtensionType != nil) && *extension.ExtensionType != *oldExtension.ExtensionType { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "extensionType"), - extension.ExtensionType, - "field is immutable", - ), - ) - } - if (extension.Plan != nil && oldExtension.Plan != nil) && *extension.Plan != *oldExtension.Plan { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "plan"), - extension.Plan, - "field is immutable", - ), - ) - } - if extension.Scope != oldExtension.Scope { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "scope"), - extension.Scope, - "field is immutable", - ), - ) - } - if (extension.ReleaseTrain != nil && oldExtension.ReleaseTrain != nil) && *extension.ReleaseTrain != *oldExtension.ReleaseTrain { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "releaseTrain"), - extension.ReleaseTrain, - "field is immutable", - ), - ) - } - if (extension.Version != nil && oldExtension.Version != nil) && *extension.Version != *oldExtension.Version { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "version"), - extension.Version, - "field is immutable", - ), - ) - } - if extension.Identity != oldExtension.Identity { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "extensions", fmt.Sprintf("[%d]", i), "identity"), - extension.Identity, - "field is immutable", - ), - ) - } - } - - return allErrs -} - -func validateName(name string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if lName := strings.ToLower(name); strings.Contains(lName, "microsoft") || - strings.Contains(lName, "windows") { - allErrs = append(allErrs, field.Invalid(fldPath.Child("Name"), name, - "cluster name is invalid because 'MICROSOFT' and 'WINDOWS' can't be used as either a whole word or a substring in the name")) - } - - return allErrs -} - -// validateAKSExtensions validates the AKS extensions. -func validateAKSExtensions(extensions []AKSExtension, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - for _, extension := range extensions { - if extension.Version != nil && (extension.AutoUpgradeMinorVersion == nil || (extension.AutoUpgradeMinorVersion != nil && *extension.AutoUpgradeMinorVersion)) { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("Version"), "Version must not be given if AutoUpgradeMinorVersion is true (or not provided, as it is true by default)")) - } - if extension.AutoUpgradeMinorVersion == ptr.To(false) && extension.ReleaseTrain != nil { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("ReleaseTrain"), "ReleaseTrain must not be given if AutoUpgradeMinorVersion is false")) - } - if extension.Scope != nil { - switch extension.Scope.ScopeType { - case ExtensionScopeCluster: - if extension.Scope.ReleaseNamespace == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("Scope", "ReleaseNamespace"), "ReleaseNamespace must be provided if Scope is Cluster")) - } - if extension.Scope.TargetNamespace != "" { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("Scope", "TargetNamespace"), "TargetNamespace can only be given if Scope is Namespace")) - } - case ExtensionScopeNamespace: - if extension.Scope.TargetNamespace == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("Scope", "TargetNamespace"), "TargetNamespace must be provided if Scope is Namespace")) - } - if extension.Scope.ReleaseNamespace != "" { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("Scope", "ReleaseNamespace"), "ReleaseNamespace can only be given if Scope is Cluster")) - } - } - } - } - - return allErrs -} - -// validateNetworkPolicy validates the networkPolicy. -func validateNetworkPolicy(networkPolicy *string, networkDataplane *NetworkDataplaneType, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if networkPolicy == nil { - return nil - } - - if *networkPolicy == "cilium" && networkDataplane != nil && *networkDataplane != NetworkDataplaneTypeCilium { - allErrs = append(allErrs, field.Invalid(fldPath, networkPolicy, "cilium network policy can only be used with cilium network dataplane")) - } - - return allErrs -} - -// validateNetworkDataplane validates the NetworkDataplane. -func validateNetworkDataplane(networkDataplane *NetworkDataplaneType, networkPolicy *string, networkPluginMode *NetworkPluginMode, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if networkDataplane == nil { - return nil - } - - if *networkDataplane == NetworkDataplaneTypeCilium && (networkPluginMode == nil || *networkPluginMode != NetworkPluginModeOverlay) { - allErrs = append(allErrs, field.Invalid(fldPath, networkDataplane, "cilium network dataplane can only be used with overlay network plugin mode")) - } - if *networkDataplane == NetworkDataplaneTypeCilium && (networkPolicy == nil || *networkPolicy != "cilium") { - allErrs = append(allErrs, field.Invalid(fldPath, networkDataplane, "cilium dataplane requires network policy cilium.")) - } - - return allErrs -} - -// validateAutoScalerProfile validates an AutoScalerProfile. -func validateAutoScalerProfile(autoScalerProfile *AutoScalerProfile, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if autoScalerProfile == nil { - return nil - } - - if errs := validateIntegerStringGreaterThanZero(autoScalerProfile.MaxEmptyBulkDelete, fldPath, "MaxEmptyBulkDelete"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateIntegerStringGreaterThanZero(autoScalerProfile.MaxGracefulTerminationSec, fldPath, "MaxGracefulTerminationSec"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateMaxNodeProvisionTime(autoScalerProfile.MaxNodeProvisionTime, fldPath); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if autoScalerProfile.MaxTotalUnreadyPercentage != nil { - val, err := strconv.Atoi(*autoScalerProfile.MaxTotalUnreadyPercentage) - if err != nil || val < 0 || val > 100 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "autoscalerProfile", "maxTotalUnreadyPercentage"), autoScalerProfile.MaxTotalUnreadyPercentage, "invalid value")) - } - } - - if errs := validateNewPodScaleUpDelay(autoScalerProfile.NewPodScaleUpDelay, fldPath); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateIntegerStringGreaterThanZero(autoScalerProfile.OkTotalUnreadyCount, fldPath, "okTotalUnreadyCount"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScanInterval(autoScalerProfile.ScanInterval, fldPath); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScaleDownTime(autoScalerProfile.ScaleDownDelayAfterAdd, fldPath, "scaleDownDelayAfterAdd"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScaleDownDelayAfterDelete(autoScalerProfile.ScaleDownDelayAfterDelete, fldPath); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScaleDownTime(autoScalerProfile.ScaleDownDelayAfterFailure, fldPath, "scaleDownDelayAfterFailure"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScaleDownTime(autoScalerProfile.ScaleDownUnneededTime, fldPath, "scaleDownUnneededTime"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateScaleDownTime(autoScalerProfile.ScaleDownUnreadyTime, fldPath, "scaleDownUnreadyTime"); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if autoScalerProfile.ScaleDownUtilizationThreshold != nil { - val, err := strconv.ParseFloat(*autoScalerProfile.ScaleDownUtilizationThreshold, 32) - if err != nil || val < 0 || val > 1 { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "autoscalerProfile", "scaleDownUtilizationThreshold"), autoScalerProfile.ScaleDownUtilizationThreshold, "invalid value")) - } - } - - return allErrs -} - -// validateMaxNodeProvisionTime validates update to AutoscalerProfile.MaxNodeProvisionTime. -func validateMaxNodeProvisionTime(maxNodeProvisionTime *string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if ptr.Deref(maxNodeProvisionTime, "") != "" { - if !rMaxNodeProvisionTime.MatchString(ptr.Deref(maxNodeProvisionTime, "")) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("MaxNodeProvisionTime"), maxNodeProvisionTime, "invalid value")) - } - } - return allErrs -} - -// validateScanInterval validates update to AutoscalerProfile.ScanInterval. -func validateScanInterval(scanInterval *string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if ptr.Deref(scanInterval, "") != "" { - if !rScanInterval.MatchString(ptr.Deref(scanInterval, "")) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ScanInterval"), scanInterval, "invalid value")) - } - } - return allErrs -} - -// validateNewPodScaleUpDelay validates update to AutoscalerProfile.NewPodScaleUpDelay. -func validateNewPodScaleUpDelay(newPodScaleUpDelay *string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if ptr.Deref(newPodScaleUpDelay, "") != "" { - _, err := time.ParseDuration(ptr.Deref(newPodScaleUpDelay, "")) - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("NewPodScaleUpDelay"), newPodScaleUpDelay, "invalid value")) - } - } - return allErrs -} - -// validateScaleDownDelayAfterDelete validates update to AutoscalerProfile.ScaleDownDelayAfterDelete value. -func validateScaleDownDelayAfterDelete(scaleDownDelayAfterDelete *string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - if ptr.Deref(scaleDownDelayAfterDelete, "") != "" { - if !rScaleDownDelayAfterDelete.MatchString(ptr.Deref(scaleDownDelayAfterDelete, "")) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ScaleDownDelayAfterDelete"), ptr.Deref(scaleDownDelayAfterDelete, ""), "invalid value")) - } - } - return allErrs -} - -// validateScaleDownTime validates update to AutoscalerProfile.ScaleDown* values. -func validateScaleDownTime(scaleDownValue *string, fldPath *field.Path, fieldName string) field.ErrorList { - var allErrs field.ErrorList - if ptr.Deref(scaleDownValue, "") != "" { - if !rScaleDownTime.MatchString(ptr.Deref(scaleDownValue, "")) { - allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldName), ptr.Deref(scaleDownValue, ""), "invalid value")) - } - } - return allErrs -} - -// validateIntegerStringGreaterThanZero validates that a string value is an integer greater than zero. -func validateIntegerStringGreaterThanZero(input *string, fldPath *field.Path, fieldName string) field.ErrorList { - var allErrs field.ErrorList - - if input != nil { - val, err := strconv.Atoi(*input) - if err != nil || val < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child(fieldName), input, "invalid value")) - } - } - - return allErrs -} - -// validateIdentity validates an Identity. -func (m *AzureManagedControlPlane) validateIdentity(_ client.Client) field.ErrorList { - var allErrs field.ErrorList - - if m.Spec.Identity != nil { - if m.Spec.Identity.Type == ManagedControlPlaneIdentityTypeUserAssigned { - if m.Spec.Identity.UserAssignedIdentityResourceID == "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "identity", "userAssignedIdentityResourceID"), m.Spec.Identity.UserAssignedIdentityResourceID, "cannot be empty if Identity.Type is UserAssigned")) - } - } else { - if m.Spec.Identity.UserAssignedIdentityResourceID != "" { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "identity", "userAssignedIdentityResourceID"), m.Spec.Identity.UserAssignedIdentityResourceID, "should be empty if Identity.Type is SystemAssigned")) - } - } - } - - if len(allErrs) > 0 { - return allErrs - } - - return nil -} - -// validateNetworkPluginMode validates a NetworkPluginMode. -func (m *AzureManagedControlPlane) validateNetworkPluginMode(_ client.Client) field.ErrorList { - var allErrs field.ErrorList - - const kubenet = "kubenet" - if ptr.Deref(m.Spec.NetworkPluginMode, "") == NetworkPluginModeOverlay && - ptr.Deref(m.Spec.NetworkPlugin, "") == kubenet { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "networkPluginMode"), m.Spec.NetworkPluginMode, fmt.Sprintf("cannot be set to %q when NetworkPlugin is %q", NetworkPluginModeOverlay, kubenet))) - } - - if len(allErrs) > 0 { - return allErrs - } - - return nil -} - -// isOIDCEnabled return true if OIDC issuer is enabled. -func (m *AzureManagedControlPlaneClassSpec) isOIDCEnabled() bool { - if m.OIDCIssuerProfile == nil { - return false - } - if m.OIDCIssuerProfile.Enabled == nil { - return false - } - return *m.OIDCIssuerProfile.Enabled -} - -// isUserManagedIdentityEnabled checks if user assigned identity is set. -func (m *AzureManagedControlPlaneClassSpec) isUserManagedIdentityEnabled() bool { - if m.Identity == nil { - return false - } - if m.Identity.Type != ManagedControlPlaneIdentityTypeUserAssigned { - return false - } - return true -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go index 02255c27a59d..8a1b8e5cdd45 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go @@ -16,38 +16,10 @@ limitations under the License. package v1beta1 -import ( - "strings" - - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" -) - -func (mcp *AzureManagedControlPlaneTemplate) setDefaults() { - setDefault[*string](&mcp.Spec.Template.Spec.NetworkPlugin, ptr.To(AzureNetworkPluginName)) - setDefault[*string](&mcp.Spec.Template.Spec.LoadBalancerSKU, ptr.To("Standard")) - setDefault[*bool](&mcp.Spec.Template.Spec.EnablePreviewFeatures, ptr.To(false)) - - if mcp.Spec.Template.Spec.Version != "" && !strings.HasPrefix(mcp.Spec.Template.Spec.Version, "v") { - mcp.Spec.Template.Spec.Version = setDefaultVersion(mcp.Spec.Template.Spec.Version) - } - - mcp.setDefaultVirtualNetwork() - mcp.setDefaultSubnet() - mcp.Spec.Template.Spec.SKU = setDefaultSku(mcp.Spec.Template.Spec.SKU) -} - // setDefaultVirtualNetwork sets the default VirtualNetwork for an AzureManagedControlPlaneTemplate. -func (mcp *AzureManagedControlPlaneTemplate) setDefaultVirtualNetwork() { - if mcp.Spec.Template.Spec.VirtualNetwork.Name != "" { - // Being able to set the vnet name in the template type is a bug, as vnet names cannot be reused across clusters. - // To avoid a breaking API change, a warning is logged. - ctrl.Log.WithName("AzureManagedControlPlaneTemplateWebHookLogger").Info("WARNING: VirtualNetwork.Name should not be set in the template. Virtual Network names cannot be shared across clusters.") - } - if mcp.Spec.Template.Spec.VirtualNetwork.CIDRBlock == "" { - mcp.Spec.Template.Spec.VirtualNetwork.CIDRBlock = defaultAKSVnetCIDR - } -} + +// Being able to set the vnet name in the template type is a bug, as vnet names cannot be reused across clusters. +// To avoid a breaking API change, a warning is logged. // setDefaultSubnet sets the default Subnet for an AzureManagedControlPlaneTemplate. func (mcp *AzureManagedControlPlaneTemplate) setDefaultSubnet() { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go deleted file mode 100644 index b249f3ff8336..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedcontrolplanetemplate_webhook.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - "sigs.k8s.io/cluster-api-provider-azure/util/versions" - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -// SetupAzureManagedControlPlaneTemplateWebhookWithManager will set up the webhook to be managed by the specified manager. -func SetupAzureManagedControlPlaneTemplateWebhookWithManager(mgr ctrl.Manager) error { - mcpw := &azureManagedControlPlaneTemplateWebhook{Client: mgr.GetClient()} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureManagedControlPlaneTemplate{}). - WithDefaulter(mcpw). - WithValidator(mcpw). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplanetemplate,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedcontrolplanetemplates,versions=v1beta1,name=validation.azuremanagedcontrolplanetemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplanetemplate,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedcontrolplanetemplates,versions=v1beta1,name=default.azuremanagedcontrolplanetemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureManagedControlPlaneTemplateWebhook struct { - Client client.Client -} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (mcpw *azureManagedControlPlaneTemplateWebhook) Default(_ context.Context, obj runtime.Object) error { - mcp, ok := obj.(*AzureManagedControlPlaneTemplate) - if !ok { - return apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate") - } - mcp.setDefaults() - return nil -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - mcp, ok := obj.(*AzureManagedControlPlaneTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate") - } - - return nil, mcp.validateManagedControlPlaneTemplate(mcpw.Client) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - old, ok := oldObj.(*AzureManagedControlPlaneTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate") - } - mcp, ok := newObj.(*AzureManagedControlPlaneTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedControlPlaneTemplate") - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "subscriptionID"), - old.Spec.Template.Spec.SubscriptionID, - mcp.Spec.Template.Spec.SubscriptionID); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "location"), - old.Spec.Template.Spec.Location, - mcp.Spec.Template.Spec.Location); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "dnsServiceIP"), - old.Spec.Template.Spec.DNSServiceIP, - mcp.Spec.Template.Spec.DNSServiceIP); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "networkPlugin"), - old.Spec.Template.Spec.NetworkPlugin, - mcp.Spec.Template.Spec.NetworkPlugin); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "networkPolicy"), - old.Spec.Template.Spec.NetworkPolicy, - mcp.Spec.Template.Spec.NetworkPolicy); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "networkDataplane"), - old.Spec.Template.Spec.NetworkDataplane, - mcp.Spec.Template.Spec.NetworkDataplane); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "loadBalancerSKU"), - old.Spec.Template.Spec.LoadBalancerSKU, - mcp.Spec.Template.Spec.LoadBalancerSKU); err != nil { - allErrs = append(allErrs, err) - } - - if old.Spec.Template.Spec.AADProfile != nil { - if mcp.Spec.Template.Spec.AADProfile == nil { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "aadProfile"), - mcp.Spec.Template.Spec.AADProfile, - "field cannot be nil, cannot disable AADProfile")) - } else { - if !mcp.Spec.Template.Spec.AADProfile.Managed && old.Spec.Template.Spec.AADProfile.Managed { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "aadProfile", "managed"), - mcp.Spec.Template.Spec.AADProfile.Managed, - "cannot set AADProfile.Managed to false")) - } - if len(mcp.Spec.Template.Spec.AADProfile.AdminGroupObjectIDs) == 0 { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "aadProfile", "adminGroupObjectIDs"), - mcp.Spec.Template.Spec.AADProfile.AdminGroupObjectIDs, - "length of AADProfile.AdminGroupObjectIDs cannot be zero")) - } - } - } - - // Consider removing this once moves out of preview - // Updating outboundType after cluster creation (PREVIEW) - // https://learn.microsoft.com/en-us/azure/aks/egress-outboundtype#updating-outboundtype-after-cluster-creation-preview - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "outboundType"), - old.Spec.Template.Spec.OutboundType, - mcp.Spec.Template.Spec.OutboundType); err != nil { - allErrs = append(allErrs, err) - } - - if errs := mcp.validateVirtualNetworkTemplateUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := mcp.validateAPIServerAccessProfileTemplateUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if errs := validateAKSExtensionsUpdate(old.Spec.Template.Spec.Extensions, mcp.Spec.Template.Spec.Extensions); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - if errs := mcp.validateK8sVersionUpdate(old); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil, mcp.validateManagedControlPlaneTemplate(mcpw.Client) - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedControlPlaneTemplateKind).GroupKind(), mcp.Name, allErrs) -} - -// Validate the Azure Managed Control Plane Template and return an aggregate error. -func (mcp *AzureManagedControlPlaneTemplate) validateManagedControlPlaneTemplate(cli client.Client) error { - var allErrs field.ErrorList - - allErrs = append(allErrs, validateVersion( - mcp.Spec.Template.Spec.Version, - field.NewPath("spec").Child("template").Child("spec").Child("version"))...) - - allErrs = append(allErrs, validateLoadBalancerProfile( - mcp.Spec.Template.Spec.LoadBalancerProfile, - field.NewPath("spec").Child("template").Child("spec").Child("loadBalancerProfile"))...) - - allErrs = append(allErrs, validateManagedClusterNetwork( - cli, - mcp.Labels, - mcp.Namespace, - mcp.Spec.Template.Spec.DNSServiceIP, - mcp.Spec.Template.Spec.VirtualNetwork.Subnet, - field.NewPath("spec").Child("template").Child("spec"))...) - - allErrs = append(allErrs, validateName(mcp.Name, field.NewPath("name"))...) - - allErrs = append(allErrs, validateAutoScalerProfile(mcp.Spec.Template.Spec.AutoScalerProfile, field.NewPath("spec").Child("template").Child("spec").Child("autoScalerProfile"))...) - - allErrs = append(allErrs, validateAKSExtensions(mcp.Spec.Template.Spec.Extensions, field.NewPath("spec").Child("extensions"))...) - - allErrs = append(allErrs, mcp.Spec.Template.Spec.AzureManagedControlPlaneClassSpec.validateSecurityProfile()...) - - allErrs = append(allErrs, validateNetworkPolicy(mcp.Spec.Template.Spec.NetworkPolicy, mcp.Spec.Template.Spec.NetworkDataplane, field.NewPath("spec").Child("template").Child("spec").Child("networkPolicy"))...) - - allErrs = append(allErrs, validateNetworkDataplane(mcp.Spec.Template.Spec.NetworkDataplane, mcp.Spec.Template.Spec.NetworkPolicy, mcp.Spec.Template.Spec.NetworkPluginMode, field.NewPath("spec").Child("template").Child("spec").Child("networkDataplane"))...) - - allErrs = append(allErrs, validateAPIServerAccessProfile(mcp.Spec.Template.Spec.APIServerAccessProfile, field.NewPath("spec").Child("template").Child("spec").Child("apiServerAccessProfile"))...) - - allErrs = append(allErrs, validateAMCPVirtualNetwork(mcp.Spec.Template.Spec.VirtualNetwork, field.NewPath("spec").Child("template").Child("spec").Child("virtualNetwork"))...) - - return allErrs.ToAggregate() -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (mcpw *azureManagedControlPlaneTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// validateK8sVersionUpdate validates K8s version. -func (mcp *AzureManagedControlPlaneTemplate) validateK8sVersionUpdate(old *AzureManagedControlPlaneTemplate) field.ErrorList { - var allErrs field.ErrorList - if hv := versions.GetHigherK8sVersion(mcp.Spec.Template.Spec.Version, old.Spec.Template.Spec.Version); hv != mcp.Spec.Template.Spec.Version { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "template", "spec", "version"), - mcp.Spec.Template.Spec.Version, "field version cannot be downgraded"), - ) - } - return allErrs -} - -// validateVirtualNetworkTemplateUpdate validates update to VirtualNetworkTemplate. -func (mcp *AzureManagedControlPlaneTemplate) validateVirtualNetworkTemplateUpdate(old *AzureManagedControlPlaneTemplate) field.ErrorList { - var allErrs field.ErrorList - - if old.Spec.Template.Spec.VirtualNetwork.CIDRBlock != mcp.Spec.Template.Spec.VirtualNetwork.CIDRBlock { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "virtualNetwork", "cidrBlock"), - mcp.Spec.Template.Spec.VirtualNetwork.CIDRBlock, - "Virtual Network CIDRBlock is immutable")) - } - - if old.Spec.Template.Spec.VirtualNetwork.Subnet.Name != mcp.Spec.Template.Spec.VirtualNetwork.Subnet.Name { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "virtualNetwork", "subnet", "name"), - mcp.Spec.Template.Spec.VirtualNetwork.Subnet.Name, - "Subnet Name is immutable")) - } - - // NOTE: This only works because we force the user to set the CIDRBlock for both the - // managed and unmanaged Vnets. If we ever update the subnet cidr based on what's - // actually set in the subnet, and it is different from what's in the Spec, for - // unmanaged Vnets like we do with the AzureCluster this logic will break. - if old.Spec.Template.Spec.VirtualNetwork.Subnet.CIDRBlock != mcp.Spec.Template.Spec.VirtualNetwork.Subnet.CIDRBlock { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "virtualNetwork", "subnet", "cidrBlock"), - mcp.Spec.Template.Spec.VirtualNetwork.Subnet.CIDRBlock, - "Subnet CIDRBlock is immutable")) - } - - if errs := mcp.Spec.Template.Spec.AzureManagedControlPlaneClassSpec.validateSecurityProfileUpdate(&old.Spec.Template.Spec.AzureManagedControlPlaneClassSpec); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - return allErrs -} - -// validateAPIServerAccessProfileTemplateUpdate validates update to APIServerAccessProfileTemplate. -func (mcp *AzureManagedControlPlaneTemplate) validateAPIServerAccessProfileTemplateUpdate(old *AzureManagedControlPlaneTemplate) field.ErrorList { - var allErrs field.ErrorList - - newAPIServerAccessProfileNormalized := &APIServerAccessProfile{} - oldAPIServerAccessProfileNormalized := &APIServerAccessProfile{} - if mcp.Spec.Template.Spec.APIServerAccessProfile != nil { - newAPIServerAccessProfileNormalized = &APIServerAccessProfile{ - APIServerAccessProfileClassSpec: APIServerAccessProfileClassSpec{ - EnablePrivateCluster: mcp.Spec.Template.Spec.APIServerAccessProfile.EnablePrivateCluster, - PrivateDNSZone: mcp.Spec.Template.Spec.APIServerAccessProfile.PrivateDNSZone, - EnablePrivateClusterPublicFQDN: mcp.Spec.Template.Spec.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, - }, - } - } - if old.Spec.Template.Spec.APIServerAccessProfile != nil { - oldAPIServerAccessProfileNormalized = &APIServerAccessProfile{ - APIServerAccessProfileClassSpec: APIServerAccessProfileClassSpec{ - EnablePrivateCluster: old.Spec.Template.Spec.APIServerAccessProfile.EnablePrivateCluster, - PrivateDNSZone: old.Spec.Template.Spec.APIServerAccessProfile.PrivateDNSZone, - EnablePrivateClusterPublicFQDN: old.Spec.Template.Spec.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, - }, - } - } - - if !reflect.DeepEqual(newAPIServerAccessProfileNormalized, oldAPIServerAccessProfileNormalized) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "template", "spec", "apiServerAccessProfile"), - mcp.Spec.Template.Spec.APIServerAccessProfile, "fields are immutable"), - ) - } - - return allErrs -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_webhook.go deleted file mode 100644 index 84560b083712..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepool_webhook.go +++ /dev/null @@ -1,587 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "regexp" - "strconv" - "strings" - "unicode" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - kerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" - clusterctlv1alpha3 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -var validNodePublicPrefixID = regexp.MustCompile(`(?i)^/?subscriptions/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/resourcegroups/[^/]+/providers/microsoft\.network/publicipprefixes/[^/]+$`) - -// SetupAzureManagedMachinePoolWebhookWithManager sets up and registers the webhook with the manager. -func SetupAzureManagedMachinePoolWebhookWithManager(mgr ctrl.Manager) error { - mw := &azureManagedMachinePoolWebhook{Client: mgr.GetClient()} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureManagedMachinePool{}). - WithDefaulter(mw). - WithValidator(mw). - Complete() -} - -//+kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedmachinepools,verbs=create;update,versions=v1beta1,name=default.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// azureManagedMachinePoolWebhook implements a validating and defaulting webhook for AzureManagedMachinePool. -type azureManagedMachinePoolWebhook struct { - Client client.Client -} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (mw *azureManagedMachinePoolWebhook) Default(_ context.Context, obj runtime.Object) error { - m, ok := obj.(*AzureManagedMachinePool) - if !ok { - return apierrors.NewBadRequest("expected an AzureManagedMachinePool") - } - if m.Labels == nil { - m.Labels = make(map[string]string) - } - m.Labels[LabelAgentPoolMode] = m.Spec.Mode - - if m.Spec.Name == nil || *m.Spec.Name == "" { - m.Spec.Name = &m.Name - } - - if m.Spec.OSType == nil { - m.Spec.OSType = ptr.To(DefaultOSType) - } - - return nil -} - -//+kubebuilder:webhook:verbs=create;update;delete,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedmachinepools,versions=v1beta1,name=validation.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedMachinePoolWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - m, ok := obj.(*AzureManagedMachinePool) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePool") - } - - var errs []error - - errs = append(errs, validateMaxPods( - m.Spec.MaxPods, - field.NewPath("spec", "maxPods"))) - - errs = append(errs, validateOSType( - m.Spec.Mode, - m.Spec.OSType, - field.NewPath("spec", "osType"))) - - errs = append(errs, validateMPName( - m.Name, - m.Spec.Name, - m.Spec.OSType, - field.NewPath("spec", "name"))) - - errs = append(errs, validateNodeLabels( - m.Spec.NodeLabels, - field.NewPath("spec", "nodeLabels"))) - - errs = append(errs, validateNodePublicIPPrefixID( - m.Spec.NodePublicIPPrefixID, - field.NewPath("spec", "nodePublicIPPrefixID"))) - - errs = append(errs, validateEnableNodePublicIP( - m.Spec.EnableNodePublicIP, - m.Spec.NodePublicIPPrefixID, - field.NewPath("spec", "enableNodePublicIP"))) - - errs = append(errs, validateKubeletConfig( - m.Spec.KubeletConfig, - field.NewPath("spec", "kubeletConfig"))) - - errs = append(errs, validateLinuxOSConfig( - m.Spec.LinuxOSConfig, - m.Spec.KubeletConfig, - field.NewPath("spec", "linuxOSConfig"))) - - errs = append(errs, validateMPSubnetName( - m.Spec.SubnetName, - field.NewPath("spec", "subnetName"))) - - return nil, kerrors.NewAggregate(errs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedMachinePoolWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - old, ok := oldObj.(*AzureManagedMachinePool) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePool") - } - m, ok := newObj.(*AzureManagedMachinePool) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePool") - } - var allErrs field.ErrorList - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "name"), - old.Spec.Name, - m.Spec.Name); err != nil { - allErrs = append(allErrs, err) - } - - if err := validateNodeLabels(m.Spec.NodeLabels, field.NewPath("spec", "nodeLabels")); err != nil { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "nodeLabels"), - m.Spec.NodeLabels, - err.Error())) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "osType"), - old.Spec.OSType, - m.Spec.OSType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "sku"), - old.Spec.SKU, - m.Spec.SKU); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "osDiskSizeGB"), - old.Spec.OSDiskSizeGB, - m.Spec.OSDiskSizeGB); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "subnetName"), - old.Spec.SubnetName, - m.Spec.SubnetName); err != nil && old.Spec.SubnetName != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "enableFIPS"), - old.Spec.EnableFIPS, - m.Spec.EnableFIPS); err != nil && old.Spec.EnableFIPS != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "enableEncryptionAtHost"), - old.Spec.EnableEncryptionAtHost, - m.Spec.EnableEncryptionAtHost); err != nil && old.Spec.EnableEncryptionAtHost != nil { - allErrs = append(allErrs, err) - } - - if !webhookutils.EnsureStringSlicesAreEquivalent(m.Spec.AvailabilityZones, old.Spec.AvailabilityZones) { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "availabilityZones"), - m.Spec.AvailabilityZones, - "field is immutable")) - } - - if m.Spec.Mode != string(NodePoolModeSystem) && old.Spec.Mode == string(NodePoolModeSystem) { - // validate for last system node pool - if err := validateLastSystemNodePool(mw.Client, m.Labels, m.Namespace, m.Annotations); err != nil { - allErrs = append(allErrs, field.Forbidden( - field.NewPath("spec", "mode"), - "Cannot change node pool mode to User, you must have at least one System node pool in your cluster")) - } - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "maxPods"), - old.Spec.MaxPods, - m.Spec.MaxPods); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "osDiskType"), - old.Spec.OsDiskType, - m.Spec.OsDiskType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "scaleSetPriority"), - old.Spec.ScaleSetPriority, - m.Spec.ScaleSetPriority); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "enableUltraSSD"), - old.Spec.EnableUltraSSD, - m.Spec.EnableUltraSSD); err != nil { - allErrs = append(allErrs, err) - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "enableNodePublicIP"), - old.Spec.EnableNodePublicIP, - m.Spec.EnableNodePublicIP); err != nil { - allErrs = append(allErrs, err) - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "nodePublicIPPrefixID"), - old.Spec.NodePublicIPPrefixID, - m.Spec.NodePublicIPPrefixID); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "kubeletConfig"), - old.Spec.KubeletConfig, - m.Spec.KubeletConfig); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "kubeletDiskType"), - old.Spec.KubeletDiskType, - m.Spec.KubeletDiskType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "linuxOSConfig"), - old.Spec.LinuxOSConfig, - m.Spec.LinuxOSConfig); err != nil { - allErrs = append(allErrs, err) - } - - if len(allErrs) != 0 { - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedMachinePoolKind).GroupKind(), m.Name, allErrs) - } - - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (mw *azureManagedMachinePoolWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - m, ok := obj.(*AzureManagedMachinePool) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePool") - } - if m.Spec.Mode != string(NodePoolModeSystem) { - return nil, nil - } - - return nil, errors.Wrapf(validateLastSystemNodePool(mw.Client, m.Labels, m.Namespace, m.Annotations), "if the delete is triggered via owner MachinePool please refer to trouble shooting section in https://capz.sigs.k8s.io/topics/managedcluster.html") -} - -// validateLastSystemNodePool is used to check if the existing system node pool is the last system node pool. -// If it is a last system node pool it cannot be deleted or mutated to user node pool as AKS expects min 1 system node pool. -func validateLastSystemNodePool(cli client.Client, labels map[string]string, namespace string, annotations map[string]string) error { - ctx := context.Background() - - // Fetch the Cluster. - clusterName, ok := labels[clusterv1.ClusterNameLabel] - if !ok { - return nil - } - - ownerCluster := &clusterv1.Cluster{} - key := client.ObjectKey{ - Namespace: namespace, - Name: clusterName, - } - - if err := cli.Get(ctx, key, ownerCluster); err != nil { - return err - } - - if !ownerCluster.DeletionTimestamp.IsZero() { - return nil - } - - // checking if this AzureManagedMachinePool is going to be deleted for clusterctl move operation - if _, ok := annotations[clusterctlv1alpha3.DeleteForMoveAnnotation]; ok { - return nil - } - - opt1 := client.InNamespace(namespace) - opt2 := client.MatchingLabels(map[string]string{ - clusterv1.ClusterNameLabel: clusterName, - LabelAgentPoolMode: string(NodePoolModeSystem), - }) - - ammpList := &AzureManagedMachinePoolList{} - if err := cli.List(ctx, ammpList, opt1, opt2); err != nil { - return err - } - - if len(ammpList.Items) <= 1 { - return errors.New("AKS Cluster must have at least one system pool") - } - return nil -} - -func validateMaxPods(maxPods *int, fldPath *field.Path) error { - if maxPods != nil { - if ptr.Deref(maxPods, 0) < 10 || ptr.Deref(maxPods, 0) > 250 { - return field.Invalid( - fldPath, - maxPods, - "MaxPods must be between 10 and 250") - } - } - - return nil -} - -func validateOSType(mode string, osType *string, fldPath *field.Path) error { - if mode == string(NodePoolModeSystem) { - if osType != nil && *osType != LinuxOS { - return field.Forbidden( - fldPath, - "System node pooll must have OSType 'Linux'") - } - } - - return nil -} - -func validateMPName(mpName string, specName *string, osType *string, fldPath *field.Path) error { - var name *string - var fieldNameMessage string - if specName == nil || *specName == "" { - name = &mpName - fieldNameMessage = "when spec.name is empty, metadata.name" - } else { - name = specName - fieldNameMessage = "spec.name" - } - - if err := validateNameLength(osType, name, fieldNameMessage, fldPath); err != nil { - return err - } - return validateNamePattern(name, fieldNameMessage, fldPath) -} - -func validateNameLength(osType *string, name *string, fieldNameMessage string, fldPath *field.Path) error { - if osType != nil && *osType == WindowsOS && - name != nil && len(*name) > 6 { - return field.Invalid( - fldPath, - name, - fmt.Sprintf("For OSType Windows, %s can not be longer than 6 characters.", fieldNameMessage)) - } else if (osType == nil || *osType == LinuxOS) && - (name != nil && len(*name) > 12) { - return field.Invalid( - fldPath, - osType, - fmt.Sprintf("For OSType Linux, %s can not be longer than 12 characters.", fieldNameMessage)) - } - return nil -} - -func validateNamePattern(name *string, fieldNameMessage string, fldPath *field.Path) error { - if name == nil || *name == "" { - return nil - } - - if !unicode.IsLower(rune((*name)[0])) { - return field.Invalid( - fldPath, - name, - fmt.Sprintf("%s must begin with a lowercase letter.", fieldNameMessage)) - } - - for _, char := range *name { - if !unicode.IsLower(char) && !unicode.IsNumber(char) { - return field.Invalid( - fldPath, - name, - fmt.Sprintf("%s may only contain lowercase alphanumeric characters.", fieldNameMessage)) - } - } - return nil -} - -func validateNodeLabels(nodeLabels map[string]string, fldPath *field.Path) error { - for key := range nodeLabels { - if azureutil.IsAzureSystemNodeLabelKey(key) { - return field.Invalid( - fldPath, - key, - fmt.Sprintf("Node pool label key must not start with %s", azureutil.AzureSystemNodeLabelPrefix)) - } - } - - return nil -} - -func validateNodePublicIPPrefixID(nodePublicIPPrefixID *string, fldPath *field.Path) error { - if nodePublicIPPrefixID != nil && !validNodePublicPrefixID.MatchString(*nodePublicIPPrefixID) { - return field.Invalid( - fldPath, - nodePublicIPPrefixID, - fmt.Sprintf("resource ID must match %q", validNodePublicPrefixID.String())) - } - return nil -} - -func validateEnableNodePublicIP(enableNodePublicIP *bool, nodePublicIPPrefixID *string, fldPath *field.Path) error { - if (enableNodePublicIP == nil || !*enableNodePublicIP) && - nodePublicIPPrefixID != nil { - return field.Invalid( - fldPath, - enableNodePublicIP, - "must be set to true when NodePublicIPPrefixID is set") - } - return nil -} - -func validateMPSubnetName(subnetName *string, fldPath *field.Path) error { - if subnetName != nil { - subnetRegex := "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,78}[a-zA-Z0-9]$" - regex := regexp.MustCompile(subnetRegex) - if success := regex.MatchString(ptr.Deref(subnetName, "")); !success { - return field.Invalid(fldPath, subnetName, - fmt.Sprintf("name of subnet doesn't match regex %s", subnetRegex)) - } - } - return nil -} - -// validateKubeletConfig enforces the AKS API configuration for KubeletConfig. -// See: https://learn.microsoft.com/en-us/azure/aks/custom-node-configuration. -func validateKubeletConfig(kubeletConfig *KubeletConfig, fldPath *field.Path) error { - var allowedUnsafeSysctlsPatterns = []string{ - `^kernel\.shm.+$`, - `^kernel\.msg.+$`, - `^kernel\.sem$`, - `^fs\.mqueue\..+$`, - `^net\..+$`, - } - if kubeletConfig != nil { - if kubeletConfig.CPUCfsQuotaPeriod != nil { - if !strings.HasSuffix(ptr.Deref(kubeletConfig.CPUCfsQuotaPeriod, ""), "ms") { - return field.Invalid( - fldPath.Child("CPUfsQuotaPeriod"), - kubeletConfig.CPUCfsQuotaPeriod, - "must be a string value in milliseconds with a 'ms' suffix, e.g., '100ms'") - } - } - if kubeletConfig.ImageGcHighThreshold != nil && kubeletConfig.ImageGcLowThreshold != nil { - if ptr.Deref(kubeletConfig.ImageGcLowThreshold, 0) > ptr.Deref(kubeletConfig.ImageGcHighThreshold, 0) { - return field.Invalid( - fldPath.Child("ImageGcLowThreshold"), - kubeletConfig.ImageGcLowThreshold, - fmt.Sprintf("must not be greater than ImageGcHighThreshold, ImageGcLowThreshold=%d, ImageGcHighThreshold=%d", - ptr.Deref(kubeletConfig.ImageGcLowThreshold, 0), ptr.Deref(kubeletConfig.ImageGcHighThreshold, 0))) - } - } - for _, val := range kubeletConfig.AllowedUnsafeSysctls { - var hasMatch bool - for _, p := range allowedUnsafeSysctlsPatterns { - if m, _ := regexp.MatchString(p, val); m { - hasMatch = true - break - } - } - if !hasMatch { - return field.Invalid( - fldPath.Child("AllowedUnsafeSysctls"), - kubeletConfig.AllowedUnsafeSysctls, - fmt.Sprintf("%s is not a supported AllowedUnsafeSysctls configuration", val)) - } - } - } - return nil -} - -// validateLinuxOSConfig enforces AKS API configuration for Linux OS custom configuration -// See: https://learn.microsoft.com/en-us/azure/aks/custom-node-configuration#linux-os-custom-configuration for detailed information. -func validateLinuxOSConfig(linuxOSConfig *LinuxOSConfig, kubeletConfig *KubeletConfig, fldPath *field.Path) error { - var errs []error - if linuxOSConfig == nil { - return nil - } - - if linuxOSConfig.SwapFileSizeMB != nil { - if kubeletConfig == nil || ptr.Deref(kubeletConfig.FailSwapOn, true) { - errs = append(errs, field.Invalid( - fldPath.Child("SwapFileSizeMB"), - linuxOSConfig.SwapFileSizeMB, - "KubeletConfig.FailSwapOn must be set to false to enable swap file on nodes")) - } - } - - if linuxOSConfig.Sysctls != nil && linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange != nil { - // match numbers separated by a space - portRangeRegex := `^[0-9]+ [0-9]+$` - portRange := *linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange - - match, matchErr := regexp.MatchString(portRangeRegex, portRange) - if matchErr != nil { - errs = append(errs, matchErr) - } - if !match { - errs = append(errs, field.Invalid( - fldPath.Child("NetIpv4IpLocalPortRange"), - linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange, - "LinuxOSConfig.Sysctls.NetIpv4IpLocalPortRange must be of the format \" \"")) - } else { - ports := strings.Split(portRange, " ") - firstPort, _ := strconv.Atoi(ports[0]) - lastPort, _ := strconv.Atoi(ports[1]) - - if firstPort < 1024 || firstPort > 60999 { - errs = append(errs, field.Invalid( - fldPath.Child("NetIpv4IpLocalPortRange", "First"), - linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange, - fmt.Sprintf("first port of NetIpv4IpLocalPortRange=%d must be in between [1024 - 60999]", firstPort))) - } - - if lastPort < 32768 || lastPort > 65000 { - errs = append(errs, field.Invalid( - fldPath.Child("NetIpv4IpLocalPortRange", "Last"), - linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange, - fmt.Sprintf("last port of NetIpv4IpLocalPortRange=%d must be in between [32768 -65000]", lastPort))) - } - - if firstPort > lastPort { - errs = append(errs, field.Invalid( - fldPath.Child("NetIpv4IpLocalPortRange", "First"), - linuxOSConfig.Sysctls.NetIpv4IPLocalPortRange, - fmt.Sprintf("first port of NetIpv4IpLocalPortRange=%d cannot be greater than last port of NetIpv4IpLocalPortRange=%d", firstPort, lastPort))) - } - } - } - return kerrors.NewAggregate(errs) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepooltemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepooltemplate_webhook.go deleted file mode 100644 index c976648a52f3..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/azuremanagedmachinepooltemplate_webhook.go +++ /dev/null @@ -1,279 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - kerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" -) - -// SetupAzureManagedMachinePoolTemplateWebhookWithManager will set up the webhook to be managed by the specified manager. -func SetupAzureManagedMachinePoolTemplateWebhookWithManager(mgr ctrl.Manager) error { - mpw := &azureManagedMachinePoolTemplateWebhook{Client: mgr.GetClient()} - return ctrl.NewWebhookManagedBy(mgr). - For(&AzureManagedMachinePoolTemplate{}). - WithDefaulter(mpw). - WithValidator(mpw). - Complete() -} - -//+kubebuilder:webhook:path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepooltemplate,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedmachinepooltemplates,verbs=create;update,versions=v1beta1,name=default.azuremanagedmachinepooltemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -type azureManagedMachinePoolTemplateWebhook struct { - Client client.Client -} - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (mpw *azureManagedMachinePoolTemplateWebhook) Default(_ context.Context, obj runtime.Object) error { - mp, ok := obj.(*AzureManagedMachinePoolTemplate) - if !ok { - return apierrors.NewBadRequest("expected an AzureManagedMachinePoolTemplate") - } - if mp.Labels == nil { - mp.Labels = make(map[string]string) - } - mp.Labels[LabelAgentPoolMode] = mp.Spec.Template.Spec.Mode - - if mp.Spec.Template.Spec.Name == nil || *mp.Spec.Template.Spec.Name == "" { - mp.Spec.Template.Spec.Name = &mp.Name - } - - setDefault[*string](&mp.Spec.Template.Spec.OSType, ptr.To(DefaultOSType)) - - return nil -} - -//+kubebuilder:webhook:verbs=create;update;delete,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepooltemplate,mutating=false,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=azuremanagedmachinepooltemplates,versions=v1beta1,name=validation.azuremanagedmachinepooltemplates.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (mpw *azureManagedMachinePoolTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - mp, ok := obj.(*AzureManagedMachinePoolTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePoolTemplate") - } - - var errs []error - - errs = append(errs, validateMaxPods( - mp.Spec.Template.Spec.MaxPods, - field.NewPath("spec", "template", "spec", "maxPods"))) - - errs = append(errs, validateOSType( - mp.Spec.Template.Spec.Mode, - mp.Spec.Template.Spec.OSType, - field.NewPath("spec", "template", "spec", "osType"))) - - errs = append(errs, validateMPName( - mp.Name, - mp.Spec.Template.Spec.Name, - mp.Spec.Template.Spec.OSType, - field.NewPath("spec", "template", "spec", "name"))) - - errs = append(errs, validateNodeLabels( - mp.Spec.Template.Spec.NodeLabels, - field.NewPath("spec", "template", "spec", "nodeLabels"))) - - errs = append(errs, validateNodePublicIPPrefixID( - mp.Spec.Template.Spec.NodePublicIPPrefixID, - field.NewPath("spec", "template", "spec", "nodePublicIPPrefixID"))) - - errs = append(errs, validateEnableNodePublicIP( - mp.Spec.Template.Spec.EnableNodePublicIP, - mp.Spec.Template.Spec.NodePublicIPPrefixID, - field.NewPath("spec", "template", "spec", "enableNodePublicIP"))) - - errs = append(errs, validateKubeletConfig( - mp.Spec.Template.Spec.KubeletConfig, - field.NewPath("spec", "template", "spec", "kubeletConfig"))) - - errs = append(errs, validateLinuxOSConfig( - mp.Spec.Template.Spec.LinuxOSConfig, - mp.Spec.Template.Spec.KubeletConfig, - field.NewPath("spec", "template", "spec", "linuxOSConfig"))) - - return nil, kerrors.NewAggregate(errs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (mpw *azureManagedMachinePoolTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - var allErrs field.ErrorList - old, ok := oldObj.(*AzureManagedMachinePoolTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePoolTemplate") - } - mp, ok := newObj.(*AzureManagedMachinePoolTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePoolTemplate") - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "name"), - old.Spec.Template.Spec.Name, - mp.Spec.Template.Spec.Name); err != nil { - allErrs = append(allErrs, err) - } - - if err := validateNodeLabels(mp.Spec.Template.Spec.NodeLabels, field.NewPath("spec", "template", "spec", "nodeLabels")); err != nil { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "nodeLabels"), - mp.Spec.Template.Spec.NodeLabels, - err.Error())) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "osType"), - old.Spec.Template.Spec.OSType, - mp.Spec.Template.Spec.OSType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "sku"), - old.Spec.Template.Spec.SKU, - mp.Spec.Template.Spec.SKU); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "osDiskSizeGB"), - old.Spec.Template.Spec.OSDiskSizeGB, - mp.Spec.Template.Spec.OSDiskSizeGB); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "subnetName"), - old.Spec.Template.Spec.SubnetName, - mp.Spec.Template.Spec.SubnetName); err != nil && old.Spec.Template.Spec.SubnetName != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "enableFIPS"), - old.Spec.Template.Spec.EnableFIPS, - mp.Spec.Template.Spec.EnableFIPS); err != nil && old.Spec.Template.Spec.EnableFIPS != nil { - allErrs = append(allErrs, err) - } - - if !webhookutils.EnsureStringSlicesAreEquivalent(mp.Spec.Template.Spec.AvailabilityZones, old.Spec.Template.Spec.AvailabilityZones) { - allErrs = append(allErrs, - field.Invalid( - field.NewPath("spec", "template", "spec", "availabilityZones"), - mp.Spec.Template.Spec.AvailabilityZones, - "field is immutable")) - } - - if mp.Spec.Template.Spec.Mode != string(NodePoolModeSystem) && old.Spec.Template.Spec.Mode == string(NodePoolModeSystem) { - // validate for last system node pool - if err := validateLastSystemNodePool(mpw.Client, mp.Spec.Template.Spec.NodeLabels, mp.Namespace, mp.Annotations); err != nil { - allErrs = append(allErrs, field.Forbidden( - field.NewPath("spec", "template", "spec", "mode"), - "Cannot change node pool mode to User, you must have at least one System node pool in your cluster")) - } - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "maxPods"), - old.Spec.Template.Spec.MaxPods, - mp.Spec.Template.Spec.MaxPods); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "osDiskType"), - old.Spec.Template.Spec.OsDiskType, - mp.Spec.Template.Spec.OsDiskType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "scaleSetPriority"), - old.Spec.Template.Spec.ScaleSetPriority, - mp.Spec.Template.Spec.ScaleSetPriority); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "enableUltraSSD"), - old.Spec.Template.Spec.EnableUltraSSD, - mp.Spec.Template.Spec.EnableUltraSSD); err != nil { - allErrs = append(allErrs, err) - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "enableNodePublicIP"), - old.Spec.Template.Spec.EnableNodePublicIP, - mp.Spec.Template.Spec.EnableNodePublicIP); err != nil { - allErrs = append(allErrs, err) - } - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "nodePublicIPPrefixID"), - old.Spec.Template.Spec.NodePublicIPPrefixID, - mp.Spec.Template.Spec.NodePublicIPPrefixID); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "kubeletConfig"), - old.Spec.Template.Spec.KubeletConfig, - mp.Spec.Template.Spec.KubeletConfig); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "kubeletDiskType"), - old.Spec.Template.Spec.KubeletDiskType, - mp.Spec.Template.Spec.KubeletDiskType); err != nil { - allErrs = append(allErrs, err) - } - - if err := webhookutils.ValidateImmutable( - field.NewPath("spec", "template", "spec", "linuxOSConfig"), - old.Spec.Template.Spec.LinuxOSConfig, - mp.Spec.Template.Spec.LinuxOSConfig); err != nil { - allErrs = append(allErrs, err) - } - - if len(allErrs) == 0 { - return nil, nil - } - return nil, apierrors.NewInvalid(GroupVersion.WithKind(AzureManagedMachinePoolTemplateKind).GroupKind(), mp.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (mpw *azureManagedMachinePoolTemplateWebhook) ValidateDelete(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - mp, ok := obj.(*AzureManagedMachinePoolTemplate) - if !ok { - return nil, apierrors.NewBadRequest("expected an AzureManagedMachinePoolTemplate") - } - if mp.Spec.Template.Spec.Mode != string(NodePoolModeSystem) { - return nil, nil - } - - return nil, errors.Wrapf(validateLastSystemNodePool(mpw.Client, mp.Spec.Template.Spec.NodeLabels, mp.Namespace, mp.Annotations), "if the delete is triggered via owner MachinePool please refer to trouble shooting section in https://capz.sigs.k8s.io/topics/managedcluster.html") -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types.go index 9a861d38e2a3..5572aac33e95 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types.go @@ -19,7 +19,6 @@ package v1beta1 import ( "slices" - "github.com/pkg/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/utils/net" ) @@ -866,28 +865,10 @@ type NetworkInterface struct { } // GetControlPlaneSubnet returns a subnet that has a role assigned to controlplane or all. Subnets with role controlplane are given higher priority. -func (n *NetworkSpec) GetControlPlaneSubnet() (SubnetSpec, error) { - // Priority is given for subnet that have role assigned as controlplane - if subnet, err := n.GetSubnet(SubnetControlPlane); err == nil { - return subnet, nil - } - - if subnet, err := n.GetSubnet(SubnetCluster); err == nil { - return subnet, nil - } - return SubnetSpec{}, errors.Errorf("no subnet found with role %s", SubnetControlPlane) -} +// Priority is given for subnet that have role assigned as controlplane // GetSubnet returns a subnet based on the subnet role. -func (n *NetworkSpec) GetSubnet(role SubnetRole) (SubnetSpec, error) { - for _, sn := range n.Subnets { - if sn.Role == role { - return sn, nil - } - } - return SubnetSpec{}, errors.Errorf("no subnet found with role %s", role) -} // UpdateControlPlaneSubnet updates the cluster control plane subnets. func (n *NetworkSpec) UpdateControlPlaneSubnet(subnet SubnetSpec) { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types_template.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types_template.go index f654ed20be93..b8fd8d67da29 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types_template.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/types_template.go @@ -19,7 +19,6 @@ package v1beta1 import ( "slices" - "github.com/pkg/errors" "k8s.io/utils/net" ) @@ -85,14 +84,6 @@ type NetworkTemplateSpec struct { } // GetSubnetTemplate returns the subnet template based on the subnet role. -func (n *NetworkTemplateSpec) GetSubnetTemplate(role SubnetRole) (SubnetTemplateSpec, error) { - for _, sn := range n.Subnets { - if sn.Role == role { - return sn, nil - } - } - return SubnetTemplateSpec{}, errors.Errorf("no subnet template found with role %s", role) -} // UpdateSubnetTemplate updates the subnet template based on subnet role. func (n *NetworkTemplateSpec) UpdateSubnetTemplate(subnet SubnetTemplateSpec, role SubnetRole) { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/zz_generated.deepcopy.go index e806a35a1124..128be24f4170 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-azure/api/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -1374,21 +1374,6 @@ func (in *AzureClusterTemplateSpec) DeepCopy() *AzureClusterTemplateSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureClusterWebhook) DeepCopyInto(out *AzureClusterWebhook) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureClusterWebhook. -func (in *AzureClusterWebhook) DeepCopy() *AzureClusterWebhook { - if in == nil { - return nil - } - out := new(AzureClusterWebhook) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureComputeGalleryImage) DeepCopyInto(out *AzureComputeGalleryImage) { *out = *in diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/feature.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/feature.go deleted file mode 100644 index 31ca915e0a60..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/feature.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package feature - -import ( - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/component-base/featuregate" -) - -const ( - //nolint:godot // Ignore "Comment should end in a period" check. - // Every capz-specific feature gate should add a method here following this template: - // - // // MyFeature is the feature gate for my feature. - // // owner: @username - // // alpha: v1.X - // MyFeature featuregate.Feature = "MyFeature" - - //nolint:godot // Ignore "Comment should end in a period" check. - // AKS is the feature gate for AKS managed clusters. - // owner: @jackfrancis @nojnhuh - // alpha: v0.4 - // GA: v1.8 - AKS featuregate.Feature = "AKS" - - // AKSResourceHealth is the feature gate for reporting Azure Resource Health - // on AKS managed clusters. - // owner: @nojnhuh - // alpha: v1.7 - AKSResourceHealth featuregate.Feature = "AKSResourceHealth" - - // EdgeZone is the feature gate for creating clusters on public MEC. - // owner: @upxinxin - // alpha: v1.8 - EdgeZone featuregate.Feature = "EdgeZone" - - // ASOAPI is the feature gate for enabling the AzureASO... APIs. - // owner: @nojnhuh - // alpha: v1.15 - ASOAPI featuregate.Feature = "ASOAPI" - - // APIServerILB is a CAPZ feature gate to create an internal LB for the API Server of the workload cluster. - // Defaults to false. - // owner: @nawazkh - // alpha: v1.18 - APIServerILB featuregate.Feature = "APIServerILB" -) - -func init() { - runtime.Must(MutableGates.Add(defaultCAPZFeatureGates)) -} - -// defaultCAPZFeatureGates consists of all known capz-specific feature keys. -// To add a new feature, define a key for it above and add it here. -var defaultCAPZFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ - // Every feature should be initiated here: - AKS: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // Remove in 1.12 - AKSResourceHealth: {Default: false, PreRelease: featuregate.Alpha}, - EdgeZone: {Default: false, PreRelease: featuregate.Alpha}, - ASOAPI: {Default: true, PreRelease: featuregate.GA}, - APIServerILB: {Default: false, PreRelease: featuregate.Alpha}, -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/gates.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/gates.go deleted file mode 100644 index bf73fb3ff0b5..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/feature/gates.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package feature - -import ( - "k8s.io/component-base/featuregate" - "sigs.k8s.io/cluster-api/feature" -) - -var ( - // MutableGates is a mutable version of DefaultFeatureGate. - // Only top-level commands/options setup and the k8s.io/component-base/featuregate/testing package should make use of this. - // Tests that need to modify featuregate gates for the duration of their test should use: - // defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features., )() - MutableGates featuregate.MutableFeatureGate = feature.MutableGates - - // Gates is a shared global FeatureGate. - // Top-level commands/options setup that needs to modify this featuregate gate should use DefaultMutableFeatureGate. - Gates featuregate.FeatureGate = MutableGates -) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/azure/azure.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/util/azure/azure.go deleted file mode 100644 index 17984b0a0380..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/azure/azure.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package azure - -import ( - "context" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// AzureSystemNodeLabelPrefix is a standard node label prefix for Azure features, e.g., kubernetes.azure.com/scalesetpriority. -const AzureSystemNodeLabelPrefix = "kubernetes.azure.com" - -const ( - // ProviderIDPrefix will be appended to the beginning of Azure resource IDs to form the Kubernetes Provider ID. - // NOTE: this format matches the 2 slashes format used in cloud-provider and cluster-autoscaler. - ProviderIDPrefix = "azure://" -) - -// IsAzureSystemNodeLabelKey is a helper function that determines whether a node label key is an Azure "system" label. -func IsAzureSystemNodeLabelKey(labelKey string) bool { - return strings.HasPrefix(labelKey, AzureSystemNodeLabelPrefix) -} - -// FindParentMachinePool finds the parent MachinePool for the AzureMachinePool. -func FindParentMachinePool(ampName string, cli client.Client) (*clusterv1.MachinePool, error) { - ctx := context.Background() - machinePoolList := &clusterv1.MachinePoolList{} - if err := cli.List(ctx, machinePoolList); err != nil { - return nil, errors.Wrapf(err, "failed to list MachinePools for %s", ampName) - } - for _, mp := range machinePoolList.Items { - if mp.Spec.Template.Spec.InfrastructureRef.Name == ampName { - return &mp, nil - } - } - return nil, errors.Errorf("failed to get MachinePool for %s", ampName) -} - -// FindParentMachinePoolWithRetry finds the parent MachinePool for the AzureMachinePool with retry. -func FindParentMachinePoolWithRetry(ampName string, cli client.Client, maxAttempts int) (*clusterv1.MachinePool, error) { - for i := 1; ; i++ { - p, err := FindParentMachinePool(ampName, cli) - if err != nil { - if i >= maxAttempts { - return nil, errors.Wrap(err, "failed to find parent MachinePool") - } - time.Sleep(1 * time.Second) - continue - } - return p, nil - } -} - -// FindParentMachinePoolV1Beta1 finds the parent MachinePool for the AzureMachinePool. -// TODO: delete after reconciliation is using v1beta2. -func FindParentMachinePoolV1Beta1(ampName string, cli client.Client) (*clusterv1.MachinePool, error) { - ctx := context.Background() - machinePoolList := &clusterv1.MachinePoolList{} - if err := cli.List(ctx, machinePoolList); err != nil { - return nil, errors.Wrapf(err, "failed to list MachinePools for %s", ampName) - } - for _, mp := range machinePoolList.Items { - if mp.Spec.Template.Spec.InfrastructureRef.Name == ampName { - return &mp, nil - } - } - return nil, errors.Errorf("failed to get MachinePool for %s", ampName) -} - -// FindParentMachinePoolWithRetryV1Beta1 finds the parent MachinePool for the AzureMachinePool with retry. -// TODO: delete after reconciliation is using v1beta2. -func FindParentMachinePoolWithRetryV1Beta1(ampName string, cli client.Client, maxAttempts int) (*clusterv1.MachinePool, error) { - for i := 1; ; i++ { - p, err := FindParentMachinePoolV1Beta1(ampName, cli) - if err != nil { - if i >= maxAttempts { - return nil, errors.Wrap(err, "failed to find parent MachinePool") - } - time.Sleep(1 * time.Second) - continue - } - return p, nil - } -} - -// ParseResourceID parses a string to an *arm.ResourceID, first removing any "azure://" prefix. -func ParseResourceID(id string) (*arm.ResourceID, error) { - return arm.ParseResourceID(strings.TrimPrefix(id, ProviderIDPrefix)) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/ssh/ssh.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/util/ssh/ssh.go deleted file mode 100644 index 48c8188ae7e8..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/ssh/ssh.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package ssh - -import ( - "crypto/rand" - "crypto/rsa" - - "github.com/pkg/errors" - "golang.org/x/crypto/ssh" -) - -// GenerateSSHKey generates a private and public ssh key. -func GenerateSSHKey() (*rsa.PrivateKey, ssh.PublicKey, error) { - privateKey, perr := rsa.GenerateKey(rand.Reader, 2048) - if perr != nil { - return nil, nil, errors.Wrap(perr, "Failed to generate private key") - } - - publicRsaKey, perr := ssh.NewPublicKey(&privateKey.PublicKey) - if perr != nil { - return nil, nil, errors.Wrap(perr, "Failed to generate public key") - } - - return privateKey, publicRsaKey, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/versions/version.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/util/versions/version.go deleted file mode 100644 index 0e2dd23d6751..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/versions/version.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package versions - -import ( - "strings" - - "golang.org/x/mod/semver" -) - -// GetHigherK8sVersion returns the higher k8s version out of a and b. -func GetHigherK8sVersion(a, b string) string { - v1 := a - if !strings.HasPrefix(a, "v") { - v1 = "v" + a - } - v2 := b - if !strings.HasPrefix(b, "v") { - v2 = "v" + b - } - - if comp := semver.Compare(v1, v2); comp < 0 { - return b - } - return a -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/webhook/validator.go b/vendor/sigs.k8s.io/cluster-api-provider-azure/util/webhook/validator.go deleted file mode 100644 index cfb3228e792b..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-azure/util/webhook/validator.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package webhook - -import ( - "reflect" - "sort" - - "k8s.io/apimachinery/pkg/util/validation/field" -) - -const ( - unsetMessage = "field is immutable, unable to set an empty value if it was already set" - setMessage = "field is immutable, unable to assign a value if it was already empty" - immutableMessage = "field is immutable" -) - -// ValidateImmutable validates equality across two values, -// and returns a meaningful error to indicate a changed value, a newly set value, or a newly unset value. -func ValidateImmutable(path *field.Path, oldVal, newVal any) *field.Error { - if reflect.TypeOf(oldVal) != reflect.TypeOf(newVal) { - return field.Invalid(path, newVal, "unexpected error") - } - if !reflect.ValueOf(oldVal).IsZero() { - // Prevent modification if it was already set to some value - if reflect.ValueOf(newVal).IsZero() { - // unsetting the field is not allowed - return field.Invalid(path, newVal, unsetMessage) - } - if !reflect.DeepEqual(oldVal, newVal) { - // changing the field is not allowed - return field.Invalid(path, newVal, immutableMessage) - } - } else if !reflect.ValueOf(newVal).IsZero() { - return field.Invalid(path, newVal, setMessage) - } - - return nil -} - -// ValidateZeroTransition validates equality across two values, with only exception to allow -// the value to transition of a zero value. -func ValidateZeroTransition(path *field.Path, oldVal, newVal any) *field.Error { - if reflect.ValueOf(newVal).IsZero() { - // unsetting the field is allowed - return nil - } - return ValidateImmutable(path, oldVal, newVal) -} - -// EnsureStringSlicesAreEquivalent returns if two string slices have equal lengths, -// and that they have the exact same items; it does not enforce strict ordering of items. -func EnsureStringSlicesAreEquivalent(a []string, b []string) bool { - if len(a) != len(b) { - return false - } - - sort.Strings(a) - sort.Strings(b) - - for i := range a { - if a[i] != b[i] { - return false - } - } - - return true -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-gcp/LICENSE deleted file mode 100644 index 261eeb9e9f8b..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_webhook.go deleted file mode 100644 index 953221c433f0..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpcluster_webhook.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// clusterlog is for logging in this package. -var clusterlog = logf.Log.WithName("gcpcluster-resource") - -// SetupWebhookWithManager sets up and registers the webhook with the manager. -func (c *GCPCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(gcpClusterWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(c). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-gcpcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpclusters,versions=v1beta1,name=validation.gcpcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-gcpcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpclusters,versions=v1beta1,name=default.gcpcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -type gcpClusterWebhook struct{} - -var ( - _ webhook.CustomValidator = &gcpClusterWebhook{} - _ webhook.CustomDefaulter = &gcpClusterWebhook{} -) - -// Default implements webhook.CustomDefaulter so a webhook will be registered for the type. -func (*gcpClusterWebhook) Default(_ context.Context, _ runtime.Object) error { - return nil -} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterWebhook) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - c, ok := newObj.(*GCPCluster) - if !ok { - return nil, fmt.Errorf("expected an GCPCluster object but got %T", c) - } - - clusterlog.Info("validate update", "name", c.Name) - var allErrs field.ErrorList - old := oldObj.(*GCPCluster) - - if !reflect.DeepEqual(c.Spec.Project, old.Spec.Project) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "Project"), - c.Spec.Project, "field is immutable"), - ) - } - - if !reflect.DeepEqual(c.Spec.Region, old.Spec.Region) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "Region"), - c.Spec.Region, "field is immutable"), - ) - } - - if !reflect.DeepEqual(c.Spec.CredentialsRef, old.Spec.CredentialsRef) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "CredentialsRef"), - c.Spec.CredentialsRef, "field is immutable"), - ) - } - - if !reflect.DeepEqual(c.Spec.LoadBalancer, old.Spec.LoadBalancer) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "LoadBalancer"), - c.Spec.LoadBalancer, "field is immutable"), - ) - } - - if c.Spec.Network.Mtu < int64(1300) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "Network", "Mtu"), - c.Spec.Network.Mtu, "field cannot be lesser than 1300"), - ) - } - - if c.Spec.Network.Mtu > int64(8896) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "Network", "Mtu"), - c.Spec.Network.Mtu, "field cannot be greater than 8896"), - ) - } - - if len(allErrs) == 0 { - return nil, nil - } - - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPCluster").GroupKind(), c.Name, allErrs) -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_webhook.go deleted file mode 100644 index 2ba5c126cedd..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpclustertemplate_webhook.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -func (r *GCPClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(gcpClusterTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -//+kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-gcpclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpclustertemplates,versions=v1beta1,name=default.gcpclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -//+kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-gcpclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpclustertemplates,versions=v1beta1,name=validation.gcpclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -type gcpClusterTemplateWebhook struct{} - -var ( - _ webhook.CustomDefaulter = &gcpClusterTemplateWebhook{} - _ webhook.CustomValidator = &gcpClusterTemplateWebhook{} -) - -// Default implements webhook.CustomDefaulter so a webhook will be registered for the type. -func (*gcpClusterTemplateWebhook) Default(_ context.Context, _ runtime.Object) error { - return nil -} - -// ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterTemplateWebhook) ValidateCreate(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*GCPClusterTemplate) - if !ok { - return nil, fmt.Errorf("expected an GCPClusterTemplate object but got %T", r) - } - - old, ok := oldObj.(*GCPClusterTemplate) - if !ok { - return nil, apierrors.NewBadRequest(fmt.Sprintf("expected an GCPClusterTemplate but got a %T", oldObj)) - } - - if !reflect.DeepEqual(r.Spec, old.Spec) { - return nil, apierrors.NewBadRequest("GCPClusterTemplate.Spec is immutable") - } - return nil, nil -} - -// ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type. -func (*gcpClusterTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_webhook.go deleted file mode 100644 index aad3fbbb35fe..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachine_webhook.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - "strings" - - "k8s.io/utils/strings/slices" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("gcpmachine-resource") - -func (m *GCPMachine) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(gcpMachineWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(m). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-gcpmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpmachines,versions=v1beta1,name=validation.gcpmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-gcpmachine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpmachines,versions=v1beta1,name=default.gcpmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -type gcpMachineWebhook struct{} - -var ( - _ webhook.CustomValidator = &gcpMachineWebhook{} - _ webhook.CustomDefaulter = &gcpMachineWebhook{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - m, ok := obj.(*GCPMachine) - if !ok { - return nil, fmt.Errorf("expected an GCPMachine object but got %T", m) - } - - clusterlog.Info("validate create", "name", m.Name) - - if err := validateConfidentialCompute(m.Spec); err != nil { - return nil, err - } - return nil, validateCustomerEncryptionKey(m.Spec) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - m, ok := newObj.(*GCPMachine) - if !ok { - return nil, fmt.Errorf("expected an GCPMachine object but got %T", m) - } - - newGCPMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(m) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachine").GroupKind(), m.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert new GCPMachine to unstructured object")), - }) - } - oldGCPMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(oldObj) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachine").GroupKind(), m.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert old GCPMachine to unstructured object")), - }) - } - - newGCPMachineSpec := newGCPMachine["spec"].(map[string]interface{}) - oldGCPMachineSpec := oldGCPMachine["spec"].(map[string]interface{}) - - // allow changes to providerID - delete(oldGCPMachineSpec, "providerID") - delete(newGCPMachineSpec, "providerID") - - // allow changes to additionalLabels - delete(oldGCPMachineSpec, "additionalLabels") - delete(newGCPMachineSpec, "additionalLabels") - - // allow changes to additionalNetworkTags - delete(oldGCPMachineSpec, "additionalNetworkTags") - delete(newGCPMachineSpec, "additionalNetworkTags") - - if !reflect.DeepEqual(oldGCPMachineSpec, newGCPMachineSpec) { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachine").GroupKind(), m.Name, field.ErrorList{ - field.Forbidden(field.NewPath("spec"), "cannot be modified"), - }) - } - - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default implements webhookutil.defaulter so a webhook will be registered for the type. -func (*gcpMachineWebhook) Default(_ context.Context, _ runtime.Object) error { - return nil -} - -func validateConfidentialCompute(spec GCPMachineSpec) error { - if spec.ConfidentialCompute != nil && *spec.ConfidentialCompute != ConfidentialComputePolicyDisabled { - if spec.OnHostMaintenance == nil || *spec.OnHostMaintenance == HostMaintenancePolicyMigrate { - return fmt.Errorf("ConfidentialCompute require OnHostMaintenance to be set to %s, the current value is: %s", HostMaintenancePolicyTerminate, HostMaintenancePolicyMigrate) - } - - machineSeries := strings.Split(spec.InstanceType, "-")[0] - switch *spec.ConfidentialCompute { - case ConfidentialComputePolicyEnabled, ConfidentialComputePolicySEV: - if !slices.Contains(confidentialMachineSeriesSupportingSev, machineSeries) { - return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingSev, ", "), spec.InstanceType) - } - case ConfidentialComputePolicySEVSNP: - if !slices.Contains(confidentialMachineSeriesSupportingSevsnp, machineSeries) { - return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingSevsnp, ", "), spec.InstanceType) - } - case ConfidentialComputePolicyTDX: - if !slices.Contains(confidentialMachineSeriesSupportingTdx, machineSeries) { - return fmt.Errorf("ConfidentialCompute %s requires any of the following machine series: %s. %s was found instead", *spec.ConfidentialCompute, strings.Join(confidentialMachineSeriesSupportingTdx, ", "), spec.InstanceType) - } - default: - return fmt.Errorf("invalid ConfidentialCompute %s", *spec.ConfidentialCompute) - } - } - return nil -} - -func checkKeyType(key *CustomerEncryptionKey) error { - switch key.KeyType { - case CustomerManagedKey: - if key.ManagedKey == nil || key.SuppliedKey != nil { - return errors.New("CustomerEncryptionKey KeyType of Managed requires only ManagedKey to be set") - } - case CustomerSuppliedKey: - if key.SuppliedKey == nil || key.ManagedKey != nil { - return errors.New("CustomerEncryptionKey KeyType of Supplied requires only SuppliedKey to be set") - } - if len(key.SuppliedKey.RawKey) > 0 && len(key.SuppliedKey.RSAEncryptedKey) > 0 { - return errors.New("CustomerEncryptionKey KeyType of Supplied requires either RawKey or RSAEncryptedKey to be set, not both") - } - default: - return fmt.Errorf("invalid value for CustomerEncryptionKey KeyType %s", key.KeyType) - } - return nil -} - -func validateCustomerEncryptionKey(spec GCPMachineSpec) error { - if spec.RootDiskEncryptionKey != nil { - if err := checkKeyType(spec.RootDiskEncryptionKey); err != nil { - return err - } - } - - for _, disk := range spec.AdditionalDisks { - if disk.EncryptionKey != nil { - if err := checkKeyType(disk.EncryptionKey); err != nil { - return err - } - } - } - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_conversion.go deleted file mode 100644 index ed9aeeb46eb4..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// Hub marks GCPMachineTemplate as a conversion hub. -func (*GCPMachineTemplate) Hub() {} - -// Hub marks GCPMachineTemplateList as a conversion hub. -func (*GCPMachineTemplateList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_webhook.go deleted file mode 100644 index c776b49a8764..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/gcpmachinetemplate_webhook.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - "fmt" - "reflect" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" -) - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-gcpmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpmachinetemplates,versions=v1beta1,name=validation.gcpmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-gcpmachinetemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=gcpmachinetemplates,versions=v1beta1,name=default.gcpmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -// log is for logging in this package. -var _ = logf.Log.WithName("gcpmachinetemplate-resource") - -func (r *GCPMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - w := new(gcpMachineTemplateWebhook) - return ctrl.NewWebhookManagedBy(mgr). - For(r). - WithValidator(w). - WithDefaulter(w). - Complete() -} - -type gcpMachineTemplateWebhook struct{} - -var ( - _ webhook.CustomValidator = &gcpMachineTemplateWebhook{} - _ webhook.CustomDefaulter = &gcpMachineTemplateWebhook{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineTemplateWebhook) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error) { - r, ok := obj.(*GCPMachineTemplate) - if !ok { - return nil, fmt.Errorf("expected an GCPMachineTemplate object but got %T", r) - } - - clusterlog.Info("validate create", "name", r.Name) - - return nil, validateConfidentialCompute(r.Spec.Template.Spec) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineTemplateWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) { - r, ok := newObj.(*GCPMachineTemplate) - if !ok { - return nil, fmt.Errorf("expected an GCPMachineTemplate object but got %T", r) - } - - newGCPMachineTemplate, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachineTemplate").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert new GCPMachineTemplate to unstructured object")), - }) - } - oldGCPMachineTemplate, err := runtime.DefaultUnstructuredConverter.ToUnstructured(oldObj) - if err != nil { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachineTemplate").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert old GCPMachineTemplate to unstructured object")), - }) - } - - newGCPMachineTemplateSpec := newGCPMachineTemplate["spec"].(map[string]interface{}) - oldGCPMachineTemplateSpec := oldGCPMachineTemplate["spec"].(map[string]interface{}) - - // allow changes to providerID - delete(oldGCPMachineTemplateSpec, "providerID") - delete(newGCPMachineTemplateSpec, "providerID") - - // allow changes to additionalLabels - delete(oldGCPMachineTemplateSpec, "additionalLabels") - delete(newGCPMachineTemplateSpec, "additionalLabels") - - // allow changes to additionalNetworkTags - delete(oldGCPMachineTemplateSpec, "additionalNetworkTags") - delete(newGCPMachineTemplateSpec, "additionalNetworkTags") - - if !reflect.DeepEqual(oldGCPMachineTemplateSpec, newGCPMachineTemplateSpec) { - return nil, apierrors.NewInvalid(GroupVersion.WithKind("GCPMachineTemplate").GroupKind(), r.Name, field.ErrorList{ - field.Forbidden(field.NewPath("spec"), "cannot be modified"), - }) - } - - return nil, nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (*gcpMachineTemplateWebhook) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error) { - return nil, nil -} - -// Default implements webhookutil.defaulter so a webhook will be registered for the type. -func (*gcpMachineTemplateWebhook) Default(_ context.Context, _ runtime.Object) error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/zz_generated.deepcopy.go index 9f1502661a7d..38cb445f8648 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ package v1beta1 import ( "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" + runtime "k8s.io/apimachinery/pkg/runtime" corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" ) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/LICENSE deleted file mode 100644 index 8dada3edaf50..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervs_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervs_conversion.go deleted file mode 100644 index 5cc85a66fe6e..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmpowervs_conversion.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - "strconv" - "strings" - - apiconversion "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/util/intstr" - - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" -) - -func (src *IBMPowerVSCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSCluster) - - return Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(src, dst, nil) -} - -func (dst *IBMPowerVSCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSCluster) - - return Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(src, dst, nil) -} - -func (src *IBMPowerVSClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSClusterList) - - return Convert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(src, dst, nil) -} - -func (dst *IBMPowerVSClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSClusterList) - - return Convert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(src, dst, nil) -} - -func (src *IBMPowerVSClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSClusterTemplate) - - return Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(src, dst, nil) -} - -func (dst *IBMPowerVSClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSClusterTemplate) - - return Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(src, dst, nil) -} - -func (src *IBMPowerVSClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSClusterTemplateList) - - return Convert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(src, dst, nil) -} - -func (dst *IBMPowerVSClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSClusterTemplateList) - - return Convert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(src, dst, nil) -} - -func (src *IBMPowerVSMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSMachine) - - return Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(src, dst, nil) -} - -func (dst *IBMPowerVSMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSMachine) - - return Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(src, dst, nil) -} - -func (src *IBMPowerVSMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSMachineList) - - return Convert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(src, dst, nil) -} - -func (dst *IBMPowerVSMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSMachineList) - - return Convert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(src, dst, nil) -} - -func (src *IBMPowerVSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSMachineTemplate) - - return Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(src, dst, nil) -} - -func (dst *IBMPowerVSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSMachineTemplate) - - return Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(src, dst, nil) -} - -func (src *IBMPowerVSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSMachineTemplateList) - - return Convert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(src, dst, nil) -} - -func (dst *IBMPowerVSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSMachineTemplateList) - - return Convert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(src, dst, nil) -} - -func (src *IBMPowerVSImage) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSImage) - - return Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(src, dst, nil) -} - -func (dst *IBMPowerVSImage) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSImage) - - return Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(src, dst, nil) -} - -func (src *IBMPowerVSImageList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMPowerVSImageList) - - return Convert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(src, dst, nil) -} - -func (dst *IBMPowerVSImageList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMPowerVSImageList) - - return Convert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(src, dst, nil) -} - -func Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in *IBMPowerVSMachineSpec, out *infrav1.IBMPowerVSMachineSpec, s apiconversion.Scope) error { - out.SystemType = in.SysType - out.Processors = intstr.FromString(in.Processors) - - memory, err := strconv.ParseFloat(in.Memory, 64) - if err != nil { - return fmt.Errorf("failed to convert memory(%s) to float64", in.Memory) - } - out.MemoryGiB = int32(memory) - - switch in.ProcType { - case strings.ToLower(string(infrav1.PowerVSProcessorTypeDedicated)): - out.ProcessorType = infrav1.PowerVSProcessorTypeDedicated - case strings.ToLower(string(infrav1.PowerVSProcessorTypeShared)): - out.ProcessorType = infrav1.PowerVSProcessorTypeShared - case strings.ToLower(string(infrav1.PowerVSProcessorTypeCapped)): - out.ProcessorType = infrav1.PowerVSProcessorTypeCapped - } - - return autoConvert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *infrav1.IBMPowerVSMachineSpec, out *IBMPowerVSMachineSpec, s apiconversion.Scope) error { - out.SysType = in.SystemType - out.Memory = strconv.FormatInt(int64(in.MemoryGiB), 10) - - switch in.Processors.Type { - case intstr.Int: - out.Processors = strconv.FormatInt(int64(in.Processors.IntVal), 10) - case intstr.String: - out.Processors = in.Processors.StrVal - } - - switch in.ProcessorType { - case infrav1.PowerVSProcessorTypeDedicated: - out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeDedicated)) - case infrav1.PowerVSProcessorTypeShared: - out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeShared)) - case infrav1.PowerVSProcessorTypeCapped: - out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeCapped)) - } - - return autoConvert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in *infrav1.IBMPowerVSClusterSpec, out *IBMPowerVSClusterSpec, s apiconversion.Scope) error { - if in.ServiceInstance != nil && in.ServiceInstance.ID != nil { - out.ServiceInstanceID = *in.ServiceInstance.ID - } - return autoConvert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *infrav1.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in *infrav1.IBMPowerVSImageSpec, out *IBMPowerVSImageSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in *infrav1.IBMPowerVSMachineStatus, out *IBMPowerVSMachineStatus, s apiconversion.Scope) error { - // CAPI V1Beta2 was added in CAPIBM v1beta2 - return autoConvert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in, out, s) -} - -func Convert_v1beta2_IBMPowerVSImageStatus_To_v1beta1_IBMPowerVSImageStatus(in *infrav1.IBMPowerVSImageStatus, out *IBMPowerVSImageStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSImageStatus_To_v1beta1_IBMPowerVSImageStatus(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpc_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpc_conversion.go deleted file mode 100644 index dda591423abe..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/ibmvpc_conversion.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - - "sigs.k8s.io/controller-runtime/pkg/conversion" - - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" -) - -func (src *IBMVPCCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCCluster) - - return Convert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(src, dst, nil) -} - -func (dst *IBMVPCCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCCluster) - - return Convert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(src, dst, nil) -} - -func (src *IBMVPCClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCClusterList) - - return Convert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList(src, dst, nil) -} - -func (dst *IBMVPCClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCClusterList) - - return Convert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList(src, dst, nil) -} - -func (src *IBMVPCMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCMachine) - - if err := Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(src, dst, nil); err != nil { - return err - } - - if src.Spec.Image != "" { - dst.Spec.Image = &infrav1.IBMVPCResourceReference{ - ID: &src.Spec.Image, - } - } - - if src.Spec.ImageName != "" { - dst.Spec.Image = &infrav1.IBMVPCResourceReference{ - Name: &src.Spec.ImageName, - } - } - - for _, sshKey := range src.Spec.SSHKeyNames { - dst.Spec.SSHKeys = append(dst.Spec.SSHKeys, &infrav1.IBMVPCResourceReference{ - Name: sshKey, - }) - } - - return nil -} - -func (dst *IBMVPCMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCMachine) - - if err := Convert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - if src.Spec.Image != nil && src.Spec.Image.ID != nil { - dst.Spec.Image = *src.Spec.Image.ID - } - - if src.Spec.Image != nil && src.Spec.Image.Name != nil { - dst.Spec.ImageName = *src.Spec.Image.Name - } - - for _, sshKey := range src.Spec.SSHKeys { - if sshKey.Name != nil { - dst.Spec.SSHKeyNames = append(dst.Spec.SSHKeyNames, sshKey.Name) - } - } - - return nil -} - -func (src *IBMVPCMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCMachineList) - - return Convert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList(src, dst, nil) -} - -func (dst *IBMVPCMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCMachineList) - - return Convert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList(src, dst, nil) -} - -func (src *IBMVPCMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCMachineTemplate) - - if err := Convert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(src, dst, nil); err != nil { - return err - } - - if src.Spec.Template.Spec.Image != "" { - dst.Spec.Template.Spec.Image = &infrav1.IBMVPCResourceReference{ - ID: &src.Spec.Template.Spec.Image, - } - } - - if src.Spec.Template.Spec.ImageName != "" { - dst.Spec.Template.Spec.Image = &infrav1.IBMVPCResourceReference{ - Name: &src.Spec.Template.Spec.ImageName, - } - } - - for _, sshKey := range src.Spec.Template.Spec.SSHKeyNames { - dst.Spec.Template.Spec.SSHKeys = append(dst.Spec.Template.Spec.SSHKeys, &infrav1.IBMVPCResourceReference{ - Name: sshKey, - }) - } - - return nil -} - -func (dst *IBMVPCMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCMachineTemplate) - - if err := Convert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - if src.Spec.Template.Spec.Image != nil && src.Spec.Template.Spec.Image.ID != nil { - dst.Spec.Template.Spec.Image = *src.Spec.Template.Spec.Image.ID - } - - if src.Spec.Template.Spec.Image != nil && src.Spec.Template.Spec.Image.Name != nil { - dst.Spec.Template.Spec.ImageName = *src.Spec.Template.Spec.Image.Name - } - - for _, sshKey := range src.Spec.Template.Spec.SSHKeys { - if sshKey.Name != nil { - dst.Spec.Template.Spec.SSHKeyNames = append(dst.Spec.Template.Spec.SSHKeyNames, sshKey.Name) - } - } - - return nil -} - -func (src *IBMVPCMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.IBMVPCMachineTemplateList) - - return Convert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList(src, dst, nil) -} - -func (dst *IBMVPCMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.IBMVPCMachineTemplateList) - - return Convert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList(src, dst, nil) -} - -func Convert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(in *IBMVPCMachineSpec, out *infrav1.IBMVPCMachineSpec, s apiconversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(in, out, s) -} - -func Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in *infrav1.IBMVPCMachineSpec, out *IBMVPCMachineSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in, out, s) -} - -func Convert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(in *infrav1.IBMVPCMachineTemplateStatus, out *IBMVPCMachineTemplateStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(in, out, s) -} - -func Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(in *[]*string, out *[]*infrav1.IBMVPCResourceReference, _ apiconversion.Scope) error { - for _, sshKey := range *in { - *out = append(*out, &infrav1.IBMVPCResourceReference{ - ID: sshKey, - }) - } - return nil -} - -func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_string(in *[]*infrav1.IBMVPCResourceReference, out *[]*string, _ apiconversion.Scope) error { - if in != nil { - for _, sshKey := range *in { - if sshKey.ID != nil { - *out = append(*out, sshKey.ID) - } - } - } - return nil -} - -func Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in *infrav1.VPCLoadBalancerSpec, out *VPCLoadBalancerSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in, out, s) -} - -func Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in *infrav1.IBMVPCClusterSpec, out *IBMVPCClusterSpec, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in, out, s) -} - -func Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in *infrav1.IBMVPCClusterStatus, out *IBMVPCClusterStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in, out, s) -} - -func Convert_v1beta2_IBMVPCMachineStatus_To_v1beta1_IBMVPCMachineStatus(in *infrav1.IBMVPCMachineStatus, out *IBMVPCMachineStatus, s apiconversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineStatus_To_v1beta1_IBMVPCMachineStatus(in, out, s) -} - -func Convert_v1beta2_NetworkInterface_To_v1beta1_NetworkInterface(in *infrav1.NetworkInterface, out *NetworkInterface, s apiconversion.Scope) error { - return autoConvert_v1beta2_NetworkInterface_To_v1beta1_NetworkInterface(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.conversion.go deleted file mode 100644 index 1752c066edd3..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,1720 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - v1beta2 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2" - corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*IBMPowerVSCluster)(nil), (*v1beta2.IBMPowerVSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(a.(*IBMPowerVSCluster), b.(*v1beta2.IBMPowerVSCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSCluster)(nil), (*IBMPowerVSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(a.(*v1beta2.IBMPowerVSCluster), b.(*IBMPowerVSCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterList)(nil), (*v1beta2.IBMPowerVSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(a.(*IBMPowerVSClusterList), b.(*v1beta2.IBMPowerVSClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSClusterList)(nil), (*IBMPowerVSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(a.(*v1beta2.IBMPowerVSClusterList), b.(*IBMPowerVSClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterSpec)(nil), (*v1beta2.IBMPowerVSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(a.(*IBMPowerVSClusterSpec), b.(*v1beta2.IBMPowerVSClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterStatus)(nil), (*v1beta2.IBMPowerVSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus(a.(*IBMPowerVSClusterStatus), b.(*v1beta2.IBMPowerVSClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterTemplate)(nil), (*v1beta2.IBMPowerVSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(a.(*IBMPowerVSClusterTemplate), b.(*v1beta2.IBMPowerVSClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSClusterTemplate)(nil), (*IBMPowerVSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(a.(*v1beta2.IBMPowerVSClusterTemplate), b.(*IBMPowerVSClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterTemplateList)(nil), (*v1beta2.IBMPowerVSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(a.(*IBMPowerVSClusterTemplateList), b.(*v1beta2.IBMPowerVSClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSClusterTemplateList)(nil), (*IBMPowerVSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(a.(*v1beta2.IBMPowerVSClusterTemplateList), b.(*IBMPowerVSClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterTemplateResource)(nil), (*v1beta2.IBMPowerVSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource(a.(*IBMPowerVSClusterTemplateResource), b.(*v1beta2.IBMPowerVSClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSClusterTemplateResource)(nil), (*IBMPowerVSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource(a.(*v1beta2.IBMPowerVSClusterTemplateResource), b.(*IBMPowerVSClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSClusterTemplateSpec)(nil), (*v1beta2.IBMPowerVSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec(a.(*IBMPowerVSClusterTemplateSpec), b.(*v1beta2.IBMPowerVSClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSClusterTemplateSpec)(nil), (*IBMPowerVSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec(a.(*v1beta2.IBMPowerVSClusterTemplateSpec), b.(*IBMPowerVSClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSImage)(nil), (*v1beta2.IBMPowerVSImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(a.(*IBMPowerVSImage), b.(*v1beta2.IBMPowerVSImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSImage)(nil), (*IBMPowerVSImage)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(a.(*v1beta2.IBMPowerVSImage), b.(*IBMPowerVSImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSImageList)(nil), (*v1beta2.IBMPowerVSImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(a.(*IBMPowerVSImageList), b.(*v1beta2.IBMPowerVSImageList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSImageList)(nil), (*IBMPowerVSImageList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(a.(*v1beta2.IBMPowerVSImageList), b.(*IBMPowerVSImageList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSImageSpec)(nil), (*v1beta2.IBMPowerVSImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec(a.(*IBMPowerVSImageSpec), b.(*v1beta2.IBMPowerVSImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSImageStatus)(nil), (*v1beta2.IBMPowerVSImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus(a.(*IBMPowerVSImageStatus), b.(*v1beta2.IBMPowerVSImageStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachine)(nil), (*v1beta2.IBMPowerVSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(a.(*IBMPowerVSMachine), b.(*v1beta2.IBMPowerVSMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachine)(nil), (*IBMPowerVSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(a.(*v1beta2.IBMPowerVSMachine), b.(*IBMPowerVSMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineList)(nil), (*v1beta2.IBMPowerVSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(a.(*IBMPowerVSMachineList), b.(*v1beta2.IBMPowerVSMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineList)(nil), (*IBMPowerVSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(a.(*v1beta2.IBMPowerVSMachineList), b.(*IBMPowerVSMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineStatus)(nil), (*v1beta2.IBMPowerVSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus(a.(*IBMPowerVSMachineStatus), b.(*v1beta2.IBMPowerVSMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineTemplate)(nil), (*v1beta2.IBMPowerVSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(a.(*IBMPowerVSMachineTemplate), b.(*v1beta2.IBMPowerVSMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineTemplate)(nil), (*IBMPowerVSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(a.(*v1beta2.IBMPowerVSMachineTemplate), b.(*IBMPowerVSMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineTemplateList)(nil), (*v1beta2.IBMPowerVSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(a.(*IBMPowerVSMachineTemplateList), b.(*v1beta2.IBMPowerVSMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineTemplateList)(nil), (*IBMPowerVSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(a.(*v1beta2.IBMPowerVSMachineTemplateList), b.(*IBMPowerVSMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineTemplateResource)(nil), (*v1beta2.IBMPowerVSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource(a.(*IBMPowerVSMachineTemplateResource), b.(*v1beta2.IBMPowerVSMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineTemplateResource)(nil), (*IBMPowerVSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource(a.(*v1beta2.IBMPowerVSMachineTemplateResource), b.(*IBMPowerVSMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineTemplateSpec)(nil), (*v1beta2.IBMPowerVSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec(a.(*IBMPowerVSMachineTemplateSpec), b.(*v1beta2.IBMPowerVSMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineTemplateSpec)(nil), (*IBMPowerVSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec(a.(*v1beta2.IBMPowerVSMachineTemplateSpec), b.(*IBMPowerVSMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSMachineTemplateStatus)(nil), (*v1beta2.IBMPowerVSMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus(a.(*IBMPowerVSMachineTemplateStatus), b.(*v1beta2.IBMPowerVSMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSMachineTemplateStatus)(nil), (*IBMPowerVSMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus(a.(*v1beta2.IBMPowerVSMachineTemplateStatus), b.(*IBMPowerVSMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMPowerVSResourceReference)(nil), (*v1beta2.IBMPowerVSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(a.(*IBMPowerVSResourceReference), b.(*v1beta2.IBMPowerVSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMPowerVSResourceReference)(nil), (*IBMPowerVSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(a.(*v1beta2.IBMPowerVSResourceReference), b.(*IBMPowerVSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCCluster)(nil), (*v1beta2.IBMVPCCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(a.(*IBMVPCCluster), b.(*v1beta2.IBMVPCCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCCluster)(nil), (*IBMVPCCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(a.(*v1beta2.IBMVPCCluster), b.(*IBMVPCCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCClusterList)(nil), (*v1beta2.IBMVPCClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList(a.(*IBMVPCClusterList), b.(*v1beta2.IBMVPCClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCClusterList)(nil), (*IBMVPCClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList(a.(*v1beta2.IBMVPCClusterList), b.(*IBMVPCClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCClusterSpec)(nil), (*v1beta2.IBMVPCClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec(a.(*IBMVPCClusterSpec), b.(*v1beta2.IBMVPCClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCClusterStatus)(nil), (*v1beta2.IBMVPCClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(a.(*IBMVPCClusterStatus), b.(*v1beta2.IBMVPCClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachine)(nil), (*v1beta2.IBMVPCMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(a.(*IBMVPCMachine), b.(*v1beta2.IBMVPCMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachine)(nil), (*IBMVPCMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(a.(*v1beta2.IBMVPCMachine), b.(*IBMVPCMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineList)(nil), (*v1beta2.IBMVPCMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList(a.(*IBMVPCMachineList), b.(*v1beta2.IBMVPCMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachineList)(nil), (*IBMVPCMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList(a.(*v1beta2.IBMVPCMachineList), b.(*IBMVPCMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineStatus)(nil), (*v1beta2.IBMVPCMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus(a.(*IBMVPCMachineStatus), b.(*v1beta2.IBMVPCMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineTemplate)(nil), (*v1beta2.IBMVPCMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(a.(*IBMVPCMachineTemplate), b.(*v1beta2.IBMVPCMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachineTemplate)(nil), (*IBMVPCMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(a.(*v1beta2.IBMVPCMachineTemplate), b.(*IBMVPCMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineTemplateList)(nil), (*v1beta2.IBMVPCMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList(a.(*IBMVPCMachineTemplateList), b.(*v1beta2.IBMVPCMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachineTemplateList)(nil), (*IBMVPCMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList(a.(*v1beta2.IBMVPCMachineTemplateList), b.(*IBMVPCMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineTemplateResource)(nil), (*v1beta2.IBMVPCMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource(a.(*IBMVPCMachineTemplateResource), b.(*v1beta2.IBMVPCMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachineTemplateResource)(nil), (*IBMVPCMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource(a.(*v1beta2.IBMVPCMachineTemplateResource), b.(*IBMVPCMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineTemplateSpec)(nil), (*v1beta2.IBMVPCMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec(a.(*IBMVPCMachineTemplateSpec), b.(*v1beta2.IBMVPCMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.IBMVPCMachineTemplateSpec)(nil), (*IBMVPCMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec(a.(*v1beta2.IBMVPCMachineTemplateSpec), b.(*IBMVPCMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IBMVPCMachineTemplateStatus)(nil), (*v1beta2.IBMVPCMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus(a.(*IBMVPCMachineTemplateStatus), b.(*v1beta2.IBMVPCMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkInterface)(nil), (*v1beta2.NetworkInterface)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface(a.(*NetworkInterface), b.(*v1beta2.NetworkInterface), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1beta2.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Subnet_To_v1beta2_Subnet(a.(*Subnet), b.(*v1beta2.Subnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_Subnet_To_v1beta1_Subnet(a.(*v1beta2.Subnet), b.(*Subnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VPC)(nil), (*v1beta2.VPC)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VPC_To_v1beta2_VPC(a.(*VPC), b.(*v1beta2.VPC), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.VPC)(nil), (*VPC)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPC_To_v1beta1_VPC(a.(*v1beta2.VPC), b.(*VPC), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VPCEndpoint)(nil), (*v1beta2.VPCEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint(a.(*VPCEndpoint), b.(*v1beta2.VPCEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.VPCEndpoint)(nil), (*VPCEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(a.(*v1beta2.VPCEndpoint), b.(*VPCEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VPCLoadBalancerSpec)(nil), (*v1beta2.VPCLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec(a.(*VPCLoadBalancerSpec), b.(*v1beta2.VPCLoadBalancerSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VPCVolume)(nil), (*v1beta2.VPCVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VPCVolume_To_v1beta2_VPCVolume(a.(*VPCVolume), b.(*v1beta2.VPCVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta2.VPCVolume)(nil), (*VPCVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPCVolume_To_v1beta1_VPCVolume(a.(*v1beta2.VPCVolume), b.(*VPCVolume), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*[]*string)(nil), (*[]*v1beta2.IBMVPCResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(a.(*[]*string), b.(*[]*v1beta2.IBMVPCResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*[]*v1beta2.IBMVPCResourceReference)(nil), (*[]*string)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_string(a.(*[]*v1beta2.IBMVPCResourceReference), b.(*[]*string), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*IBMPowerVSMachineSpec)(nil), (*v1beta2.IBMPowerVSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(a.(*IBMPowerVSMachineSpec), b.(*v1beta2.IBMPowerVSMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*IBMVPCMachineSpec)(nil), (*v1beta2.IBMVPCMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(a.(*IBMVPCMachineSpec), b.(*v1beta2.IBMVPCMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSClusterSpec)(nil), (*IBMPowerVSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(a.(*v1beta2.IBMPowerVSClusterSpec), b.(*IBMPowerVSClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSClusterStatus)(nil), (*IBMPowerVSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(a.(*v1beta2.IBMPowerVSClusterStatus), b.(*IBMPowerVSClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSImageSpec)(nil), (*IBMPowerVSImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(a.(*v1beta2.IBMPowerVSImageSpec), b.(*IBMPowerVSImageSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSImageStatus)(nil), (*IBMPowerVSImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSImageStatus_To_v1beta1_IBMPowerVSImageStatus(a.(*v1beta2.IBMPowerVSImageStatus), b.(*IBMPowerVSImageStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSMachineSpec)(nil), (*IBMPowerVSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(a.(*v1beta2.IBMPowerVSMachineSpec), b.(*IBMPowerVSMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMPowerVSMachineStatus)(nil), (*IBMPowerVSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(a.(*v1beta2.IBMPowerVSMachineStatus), b.(*IBMPowerVSMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMVPCClusterSpec)(nil), (*IBMVPCClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(a.(*v1beta2.IBMVPCClusterSpec), b.(*IBMVPCClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMVPCClusterStatus)(nil), (*IBMVPCClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(a.(*v1beta2.IBMVPCClusterStatus), b.(*IBMVPCClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMVPCMachineSpec)(nil), (*IBMVPCMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(a.(*v1beta2.IBMVPCMachineSpec), b.(*IBMVPCMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMVPCMachineStatus)(nil), (*IBMVPCMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineStatus_To_v1beta1_IBMVPCMachineStatus(a.(*v1beta2.IBMVPCMachineStatus), b.(*IBMVPCMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.IBMVPCMachineTemplateStatus)(nil), (*IBMVPCMachineTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(a.(*v1beta2.IBMVPCMachineTemplateStatus), b.(*IBMVPCMachineTemplateStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.NetworkInterface)(nil), (*NetworkInterface)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_NetworkInterface_To_v1beta1_NetworkInterface(a.(*v1beta2.NetworkInterface), b.(*NetworkInterface), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta2.VPCLoadBalancerSpec)(nil), (*VPCLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(a.(*v1beta2.VPCLoadBalancerSpec), b.(*VPCLoadBalancerSpec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(in *IBMPowerVSCluster, out *v1beta2.IBMPowerVSCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(in *IBMPowerVSCluster, out *v1beta2.IBMPowerVSCluster, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(in *v1beta2.IBMPowerVSCluster, out *IBMPowerVSCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(in *v1beta2.IBMPowerVSCluster, out *IBMPowerVSCluster, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(in *IBMPowerVSClusterList, out *v1beta2.IBMPowerVSClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMPowerVSCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(in *IBMPowerVSClusterList, out *v1beta2.IBMPowerVSClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(in *v1beta2.IBMPowerVSClusterList, out *IBMPowerVSClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMPowerVSCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(in *v1beta2.IBMPowerVSClusterList, out *IBMPowerVSClusterList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(in *IBMPowerVSClusterSpec, out *v1beta2.IBMPowerVSClusterSpec, s conversion.Scope) error { - out.ServiceInstanceID = in.ServiceInstanceID - if err := Convert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(&in.Network, &out.Network, s); err != nil { - return err - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(in *IBMPowerVSClusterSpec, out *v1beta2.IBMPowerVSClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in *v1beta2.IBMPowerVSClusterSpec, out *IBMPowerVSClusterSpec, s conversion.Scope) error { - out.ServiceInstanceID = in.ServiceInstanceID - if err := Convert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(&in.Network, &out.Network, s); err != nil { - return err - } - // WARNING: in.DHCPServer requires manual conversion: does not exist in peer-type - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - // WARNING: in.ServiceInstance requires manual conversion: does not exist in peer-type - // WARNING: in.Zone requires manual conversion: does not exist in peer-type - // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type - // WARNING: in.VPC requires manual conversion: does not exist in peer-type - // WARNING: in.VPCSubnets requires manual conversion: does not exist in peer-type - // WARNING: in.VPCSecurityGroups requires manual conversion: does not exist in peer-type - // WARNING: in.TransitGateway requires manual conversion: does not exist in peer-type - // WARNING: in.LoadBalancers requires manual conversion: does not exist in peer-type - // WARNING: in.CosInstance requires manual conversion: does not exist in peer-type - // WARNING: in.Ignition requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus(in *IBMPowerVSClusterStatus, out *v1beta2.IBMPowerVSClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus(in *IBMPowerVSClusterStatus, out *v1beta2.IBMPowerVSClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *v1beta2.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type - // WARNING: in.ServiceInstance requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: does not exist in peer-type - // WARNING: in.DHCPServer requires manual conversion: does not exist in peer-type - // WARNING: in.VPC requires manual conversion: does not exist in peer-type - // WARNING: in.VPCSubnet requires manual conversion: does not exist in peer-type - // WARNING: in.VPCSecurityGroups requires manual conversion: does not exist in peer-type - // WARNING: in.TransitGateway requires manual conversion: does not exist in peer-type - // WARNING: in.COSInstance requires manual conversion: does not exist in peer-type - // WARNING: in.LoadBalancers requires manual conversion: does not exist in peer-type - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(in *IBMPowerVSClusterTemplate, out *v1beta2.IBMPowerVSClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(in *IBMPowerVSClusterTemplate, out *v1beta2.IBMPowerVSClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(in *v1beta2.IBMPowerVSClusterTemplate, out *IBMPowerVSClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(in *v1beta2.IBMPowerVSClusterTemplate, out *IBMPowerVSClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(in *IBMPowerVSClusterTemplateList, out *v1beta2.IBMPowerVSClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMPowerVSClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(in *IBMPowerVSClusterTemplateList, out *v1beta2.IBMPowerVSClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(in *v1beta2.IBMPowerVSClusterTemplateList, out *IBMPowerVSClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMPowerVSClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(in *v1beta2.IBMPowerVSClusterTemplateList, out *IBMPowerVSClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource(in *IBMPowerVSClusterTemplateResource, out *v1beta2.IBMPowerVSClusterTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSClusterSpec_To_v1beta2_IBMPowerVSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource(in *IBMPowerVSClusterTemplateResource, out *v1beta2.IBMPowerVSClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource(in *v1beta2.IBMPowerVSClusterTemplateResource, out *IBMPowerVSClusterTemplateResource, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource(in *v1beta2.IBMPowerVSClusterTemplateResource, out *IBMPowerVSClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec(in *IBMPowerVSClusterTemplateSpec, out *v1beta2.IBMPowerVSClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_IBMPowerVSClusterTemplateResource_To_v1beta2_IBMPowerVSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec(in *IBMPowerVSClusterTemplateSpec, out *v1beta2.IBMPowerVSClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSClusterTemplateSpec_To_v1beta2_IBMPowerVSClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec(in *v1beta2.IBMPowerVSClusterTemplateSpec, out *IBMPowerVSClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta2_IBMPowerVSClusterTemplateResource_To_v1beta1_IBMPowerVSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec(in *v1beta2.IBMPowerVSClusterTemplateSpec, out *IBMPowerVSClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSClusterTemplateSpec_To_v1beta1_IBMPowerVSClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(in *IBMPowerVSImage, out *v1beta2.IBMPowerVSImage, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(in *IBMPowerVSImage, out *v1beta2.IBMPowerVSImage, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(in *v1beta2.IBMPowerVSImage, out *IBMPowerVSImage, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMPowerVSImageStatus_To_v1beta1_IBMPowerVSImageStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(in *v1beta2.IBMPowerVSImage, out *IBMPowerVSImage, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(in *IBMPowerVSImageList, out *v1beta2.IBMPowerVSImageList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMPowerVSImage, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(in *IBMPowerVSImageList, out *v1beta2.IBMPowerVSImageList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(in *v1beta2.IBMPowerVSImageList, out *IBMPowerVSImageList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMPowerVSImage, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(in *v1beta2.IBMPowerVSImageList, out *IBMPowerVSImageList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec(in *IBMPowerVSImageSpec, out *v1beta2.IBMPowerVSImageSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.ServiceInstanceID = in.ServiceInstanceID - out.Bucket = (*string)(unsafe.Pointer(in.Bucket)) - out.Object = (*string)(unsafe.Pointer(in.Object)) - out.Region = (*string)(unsafe.Pointer(in.Region)) - out.StorageType = in.StorageType - out.DeletePolicy = in.DeletePolicy - return nil -} - -// Convert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec(in *IBMPowerVSImageSpec, out *v1beta2.IBMPowerVSImageSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSImageSpec_To_v1beta2_IBMPowerVSImageSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in *v1beta2.IBMPowerVSImageSpec, out *IBMPowerVSImageSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.ServiceInstanceID = in.ServiceInstanceID - // WARNING: in.ServiceInstance requires manual conversion: does not exist in peer-type - out.Bucket = (*string)(unsafe.Pointer(in.Bucket)) - out.Object = (*string)(unsafe.Pointer(in.Object)) - out.Region = (*string)(unsafe.Pointer(in.Region)) - out.StorageType = in.StorageType - out.DeletePolicy = in.DeletePolicy - return nil -} - -func autoConvert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus(in *IBMPowerVSImageStatus, out *v1beta2.IBMPowerVSImageStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.ImageID = in.ImageID - out.ImageState = v1beta2.PowerVSImageState(in.ImageState) - out.JobID = in.JobID - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus(in *IBMPowerVSImageStatus, out *v1beta2.IBMPowerVSImageStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSImageStatus_To_v1beta2_IBMPowerVSImageStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSImageStatus_To_v1beta1_IBMPowerVSImageStatus(in *v1beta2.IBMPowerVSImageStatus, out *IBMPowerVSImageStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.ImageID = in.ImageID - out.ImageState = PowerVSImageState(in.ImageState) - out.JobID = in.JobID - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(in *IBMPowerVSMachine, out *v1beta2.IBMPowerVSMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(in *IBMPowerVSMachine, out *v1beta2.IBMPowerVSMachine, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(in *v1beta2.IBMPowerVSMachine, out *IBMPowerVSMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(in *v1beta2.IBMPowerVSMachine, out *IBMPowerVSMachine, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(in *IBMPowerVSMachineList, out *v1beta2.IBMPowerVSMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMPowerVSMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(in *IBMPowerVSMachineList, out *v1beta2.IBMPowerVSMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(in *v1beta2.IBMPowerVSMachineList, out *IBMPowerVSMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMPowerVSMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(in *v1beta2.IBMPowerVSMachineList, out *IBMPowerVSMachineList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in *IBMPowerVSMachineSpec, out *v1beta2.IBMPowerVSMachineSpec, s conversion.Scope) error { - out.ServiceInstanceID = in.ServiceInstanceID - out.SSHKey = in.SSHKey - out.Image = (*v1beta2.IBMPowerVSResourceReference)(unsafe.Pointer(in.Image)) - out.ImageRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.ImageRef)) - // WARNING: in.SysType requires manual conversion: does not exist in peer-type - // WARNING: in.ProcType requires manual conversion: does not exist in peer-type - // WARNING: in.Processors requires manual conversion: inconvertible types (string vs k8s.io/apimachinery/pkg/util/intstr.IntOrString) - // WARNING: in.Memory requires manual conversion: does not exist in peer-type - if err := Convert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(&in.Network, &out.Network, s); err != nil { - return err - } - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - return nil -} - -func autoConvert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *v1beta2.IBMPowerVSMachineSpec, out *IBMPowerVSMachineSpec, s conversion.Scope) error { - out.ServiceInstanceID = in.ServiceInstanceID - // WARNING: in.ServiceInstance requires manual conversion: does not exist in peer-type - out.SSHKey = in.SSHKey - out.Image = (*IBMPowerVSResourceReference)(unsafe.Pointer(in.Image)) - out.ImageRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.ImageRef)) - // WARNING: in.SystemType requires manual conversion: does not exist in peer-type - // WARNING: in.ProcessorType requires manual conversion: does not exist in peer-type - // WARNING: in.Processors requires manual conversion: inconvertible types (k8s.io/apimachinery/pkg/util/intstr.IntOrString vs string) - // WARNING: in.MemoryGiB requires manual conversion: does not exist in peer-type - if err := Convert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(&in.Network, &out.Network, s); err != nil { - return err - } - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - return nil -} - -func autoConvert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus(in *IBMPowerVSMachineStatus, out *v1beta2.IBMPowerVSMachineStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.Health = in.Health - out.InstanceState = v1beta2.PowerVSInstanceState(in.InstanceState) - out.Fault = in.Fault - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Region = (*string)(unsafe.Pointer(in.Region)) - out.Zone = (*string)(unsafe.Pointer(in.Zone)) - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus(in *IBMPowerVSMachineStatus, out *v1beta2.IBMPowerVSMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineStatus_To_v1beta2_IBMPowerVSMachineStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in *v1beta2.IBMPowerVSMachineStatus, out *IBMPowerVSMachineStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.Health = in.Health - out.InstanceState = PowerVSInstanceState(in.InstanceState) - out.Fault = in.Fault - out.FailureReason = (*string)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Region = (*string)(unsafe.Pointer(in.Region)) - out.Zone = (*string)(unsafe.Pointer(in.Zone)) - // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(in *IBMPowerVSMachineTemplate, out *v1beta2.IBMPowerVSMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(in *IBMPowerVSMachineTemplate, out *v1beta2.IBMPowerVSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(in *v1beta2.IBMPowerVSMachineTemplate, out *IBMPowerVSMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(in *v1beta2.IBMPowerVSMachineTemplate, out *IBMPowerVSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(in *IBMPowerVSMachineTemplateList, out *v1beta2.IBMPowerVSMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMPowerVSMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(in *IBMPowerVSMachineTemplateList, out *v1beta2.IBMPowerVSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(in *v1beta2.IBMPowerVSMachineTemplateList, out *IBMPowerVSMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMPowerVSMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(in *v1beta2.IBMPowerVSMachineTemplateList, out *IBMPowerVSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource(in *IBMPowerVSMachineTemplateResource, out *v1beta2.IBMPowerVSMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource(in *IBMPowerVSMachineTemplateResource, out *v1beta2.IBMPowerVSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource(in *v1beta2.IBMPowerVSMachineTemplateResource, out *IBMPowerVSMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource(in *v1beta2.IBMPowerVSMachineTemplateResource, out *IBMPowerVSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec(in *IBMPowerVSMachineTemplateSpec, out *v1beta2.IBMPowerVSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_IBMPowerVSMachineTemplateResource_To_v1beta2_IBMPowerVSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec(in *IBMPowerVSMachineTemplateSpec, out *v1beta2.IBMPowerVSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineTemplateSpec_To_v1beta2_IBMPowerVSMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec(in *v1beta2.IBMPowerVSMachineTemplateSpec, out *IBMPowerVSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta2_IBMPowerVSMachineTemplateResource_To_v1beta1_IBMPowerVSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec(in *v1beta2.IBMPowerVSMachineTemplateSpec, out *IBMPowerVSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineTemplateSpec_To_v1beta1_IBMPowerVSMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus(in *IBMPowerVSMachineTemplateStatus, out *v1beta2.IBMPowerVSMachineTemplateStatus, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - return nil -} - -// Convert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus(in *IBMPowerVSMachineTemplateStatus, out *v1beta2.IBMPowerVSMachineTemplateStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSMachineTemplateStatus_To_v1beta2_IBMPowerVSMachineTemplateStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus(in *v1beta2.IBMPowerVSMachineTemplateStatus, out *IBMPowerVSMachineTemplateStatus, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - return nil -} - -// Convert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus(in *v1beta2.IBMPowerVSMachineTemplateStatus, out *IBMPowerVSMachineTemplateStatus, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSMachineTemplateStatus_To_v1beta1_IBMPowerVSMachineTemplateStatus(in, out, s) -} - -func autoConvert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(in *IBMPowerVSResourceReference, out *v1beta2.IBMPowerVSResourceReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.RegEx = (*string)(unsafe.Pointer(in.RegEx)) - return nil -} - -// Convert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference is an autogenerated conversion function. -func Convert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(in *IBMPowerVSResourceReference, out *v1beta2.IBMPowerVSResourceReference, s conversion.Scope) error { - return autoConvert_v1beta1_IBMPowerVSResourceReference_To_v1beta2_IBMPowerVSResourceReference(in, out, s) -} - -func autoConvert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(in *v1beta2.IBMPowerVSResourceReference, out *IBMPowerVSResourceReference, s conversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.RegEx = (*string)(unsafe.Pointer(in.RegEx)) - return nil -} - -// Convert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference is an autogenerated conversion function. -func Convert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(in *v1beta2.IBMPowerVSResourceReference, out *IBMPowerVSResourceReference, s conversion.Scope) error { - return autoConvert_v1beta2_IBMPowerVSResourceReference_To_v1beta1_IBMPowerVSResourceReference(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(in *IBMVPCCluster, out *v1beta2.IBMVPCCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(in *IBMVPCCluster, out *v1beta2.IBMVPCCluster, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(in *v1beta2.IBMVPCCluster, out *IBMVPCCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(in *v1beta2.IBMVPCCluster, out *IBMVPCCluster, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList(in *IBMVPCClusterList, out *v1beta2.IBMVPCClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMVPCCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMVPCCluster_To_v1beta2_IBMVPCCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList(in *IBMVPCClusterList, out *v1beta2.IBMVPCClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCClusterList_To_v1beta2_IBMVPCClusterList(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList(in *v1beta2.IBMVPCClusterList, out *IBMVPCClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMVPCCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMVPCCluster_To_v1beta1_IBMVPCCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList(in *v1beta2.IBMVPCClusterList, out *IBMVPCClusterList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCClusterList_To_v1beta1_IBMVPCClusterList(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec(in *IBMVPCClusterSpec, out *v1beta2.IBMVPCClusterSpec, s conversion.Scope) error { - out.Region = in.Region - out.ResourceGroup = in.ResourceGroup - out.VPC = in.VPC - out.Zone = in.Zone - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneLoadBalancer != nil { - in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer - *out = new(v1beta2.VPCLoadBalancerSpec) - if err := Convert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneLoadBalancer = nil - } - return nil -} - -// Convert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec(in *IBMVPCClusterSpec, out *v1beta2.IBMVPCClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCClusterSpec_To_v1beta2_IBMVPCClusterSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCClusterSpec_To_v1beta1_IBMVPCClusterSpec(in *v1beta2.IBMVPCClusterSpec, out *IBMVPCClusterSpec, s conversion.Scope) error { - out.Region = in.Region - out.ResourceGroup = in.ResourceGroup - out.VPC = in.VPC - out.Zone = in.Zone - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneLoadBalancer != nil { - in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer - *out = new(VPCLoadBalancerSpec) - if err := Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneLoadBalancer = nil - } - // WARNING: in.Image requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(in *IBMVPCClusterStatus, out *v1beta2.IBMVPCClusterStatus, s conversion.Scope) error { - if err := Convert_v1beta1_VPC_To_v1beta2_VPC(&in.VPC, &out.VPC, s); err != nil { - return err - } - out.Ready = in.Ready - if err := Convert_v1beta1_Subnet_To_v1beta2_Subnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - if err := Convert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint(&in.VPCEndpoint, &out.VPCEndpoint, s); err != nil { - return err - } - out.ControlPlaneLoadBalancerState = v1beta2.VPCLoadBalancerState(in.ControlPlaneLoadBalancerState) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(in *IBMVPCClusterStatus, out *v1beta2.IBMVPCClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCClusterStatus_To_v1beta2_IBMVPCClusterStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCClusterStatus_To_v1beta1_IBMVPCClusterStatus(in *v1beta2.IBMVPCClusterStatus, out *IBMVPCClusterStatus, s conversion.Scope) error { - if err := Convert_v1beta2_VPC_To_v1beta1_VPC(&in.VPC, &out.VPC, s); err != nil { - return err - } - // WARNING: in.Image requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: does not exist in peer-type - out.Ready = in.Ready - // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type - if err := Convert_v1beta2_Subnet_To_v1beta1_Subnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - if err := Convert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(&in.VPCEndpoint, &out.VPCEndpoint, s); err != nil { - return err - } - out.ControlPlaneLoadBalancerState = VPCLoadBalancerState(in.ControlPlaneLoadBalancerState) - out.Conditions = *(*corev1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(in *IBMVPCMachine, out *v1beta2.IBMVPCMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(in *IBMVPCMachine, out *v1beta2.IBMVPCMachine, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(in *v1beta2.IBMVPCMachine, out *IBMVPCMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMVPCMachineStatus_To_v1beta1_IBMVPCMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(in *v1beta2.IBMVPCMachine, out *IBMVPCMachine, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList(in *IBMVPCMachineList, out *v1beta2.IBMVPCMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMVPCMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMVPCMachine_To_v1beta2_IBMVPCMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList(in *IBMVPCMachineList, out *v1beta2.IBMVPCMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineList_To_v1beta2_IBMVPCMachineList(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList(in *v1beta2.IBMVPCMachineList, out *IBMVPCMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMVPCMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMVPCMachine_To_v1beta1_IBMVPCMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList(in *v1beta2.IBMVPCMachineList, out *IBMVPCMachineList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineList_To_v1beta1_IBMVPCMachineList(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(in *IBMVPCMachineSpec, out *v1beta2.IBMVPCMachineSpec, s conversion.Scope) error { - out.Name = in.Name - // WARNING: in.Image requires manual conversion: inconvertible types (string vs *sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2.IBMVPCResourceReference) - // WARNING: in.ImageName requires manual conversion: does not exist in peer-type - out.Zone = in.Zone - out.Profile = in.Profile - out.BootVolume = (*v1beta2.VPCVolume)(unsafe.Pointer(in.BootVolume)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - if err := Convert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface(&in.PrimaryNetworkInterface, &out.PrimaryNetworkInterface, s); err != nil { - return err - } - if err := Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(&in.SSHKeys, &out.SSHKeys, s); err != nil { - return err - } - // WARNING: in.SSHKeyNames requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in *v1beta2.IBMVPCMachineSpec, out *IBMVPCMachineSpec, s conversion.Scope) error { - out.Name = in.Name - // WARNING: in.CatalogOffering requires manual conversion: does not exist in peer-type - // WARNING: in.PlacementTarget requires manual conversion: does not exist in peer-type - // WARNING: in.Image requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2.IBMVPCResourceReference vs string) - // WARNING: in.LoadBalancerPoolMembers requires manual conversion: does not exist in peer-type - out.Zone = in.Zone - out.Profile = in.Profile - out.BootVolume = (*VPCVolume)(unsafe.Pointer(in.BootVolume)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - if err := Convert_v1beta2_NetworkInterface_To_v1beta1_NetworkInterface(&in.PrimaryNetworkInterface, &out.PrimaryNetworkInterface, s); err != nil { - return err - } - if err := Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_string(&in.SSHKeys, &out.SSHKeys, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus(in *IBMVPCMachineStatus, out *v1beta2.IBMVPCMachineStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceStatus = in.InstanceStatus - return nil -} - -// Convert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus(in *IBMVPCMachineStatus, out *v1beta2.IBMVPCMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineStatus_To_v1beta2_IBMVPCMachineStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineStatus_To_v1beta1_IBMVPCMachineStatus(in *v1beta2.IBMVPCMachineStatus, out *IBMVPCMachineStatus, s conversion.Scope) error { - out.InstanceID = in.InstanceID - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - // WARNING: in.FailureReason requires manual conversion: does not exist in peer-type - // WARNING: in.FailureMessage requires manual conversion: does not exist in peer-type - out.InstanceStatus = in.InstanceStatus - // WARNING: in.LoadBalancerPoolMembers requires manual conversion: does not exist in peer-type - // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(in *IBMVPCMachineTemplate, out *v1beta2.IBMVPCMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(in *IBMVPCMachineTemplate, out *v1beta2.IBMVPCMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(in *v1beta2.IBMVPCMachineTemplate, out *IBMVPCMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(in *v1beta2.IBMVPCMachineTemplate, out *IBMVPCMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList(in *IBMVPCMachineTemplateList, out *v1beta2.IBMVPCMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta2.IBMVPCMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IBMVPCMachineTemplate_To_v1beta2_IBMVPCMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList(in *IBMVPCMachineTemplateList, out *v1beta2.IBMVPCMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineTemplateList_To_v1beta2_IBMVPCMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList(in *v1beta2.IBMVPCMachineTemplateList, out *IBMVPCMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IBMVPCMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta2_IBMVPCMachineTemplate_To_v1beta1_IBMVPCMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList(in *v1beta2.IBMVPCMachineTemplateList, out *IBMVPCMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineTemplateList_To_v1beta1_IBMVPCMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource(in *IBMVPCMachineTemplateResource, out *v1beta2.IBMVPCMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_IBMVPCMachineSpec_To_v1beta2_IBMVPCMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource(in *IBMVPCMachineTemplateResource, out *v1beta2.IBMVPCMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource(in *v1beta2.IBMVPCMachineTemplateResource, out *IBMVPCMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource(in *v1beta2.IBMVPCMachineTemplateResource, out *IBMVPCMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec(in *IBMVPCMachineTemplateSpec, out *v1beta2.IBMVPCMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_IBMVPCMachineTemplateResource_To_v1beta2_IBMVPCMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec(in *IBMVPCMachineTemplateSpec, out *v1beta2.IBMVPCMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineTemplateSpec_To_v1beta2_IBMVPCMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec(in *v1beta2.IBMVPCMachineTemplateSpec, out *IBMVPCMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta2_IBMVPCMachineTemplateResource_To_v1beta1_IBMVPCMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec(in *v1beta2.IBMVPCMachineTemplateSpec, out *IBMVPCMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta2_IBMVPCMachineTemplateSpec_To_v1beta1_IBMVPCMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus(in *IBMVPCMachineTemplateStatus, out *v1beta2.IBMVPCMachineTemplateStatus, s conversion.Scope) error { - return nil -} - -// Convert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus is an autogenerated conversion function. -func Convert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus(in *IBMVPCMachineTemplateStatus, out *v1beta2.IBMVPCMachineTemplateStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IBMVPCMachineTemplateStatus_To_v1beta2_IBMVPCMachineTemplateStatus(in, out, s) -} - -func autoConvert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(in *v1beta2.IBMVPCMachineTemplateStatus, out *IBMVPCMachineTemplateStatus, s conversion.Scope) error { - // WARNING: in.Capacity requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface(in *NetworkInterface, out *v1beta2.NetworkInterface, s conversion.Scope) error { - out.Subnet = in.Subnet - return nil -} - -// Convert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface is an autogenerated conversion function. -func Convert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface(in *NetworkInterface, out *v1beta2.NetworkInterface, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkInterface_To_v1beta2_NetworkInterface(in, out, s) -} - -func autoConvert_v1beta2_NetworkInterface_To_v1beta1_NetworkInterface(in *v1beta2.NetworkInterface, out *NetworkInterface, s conversion.Scope) error { - // WARNING: in.SecurityGroups requires manual conversion: does not exist in peer-type - out.Subnet = in.Subnet - return nil -} - -func autoConvert_v1beta1_Subnet_To_v1beta2_Subnet(in *Subnet, out *v1beta2.Subnet, s conversion.Scope) error { - out.Ipv4CidrBlock = (*string)(unsafe.Pointer(in.Ipv4CidrBlock)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.Zone = (*string)(unsafe.Pointer(in.Zone)) - return nil -} - -// Convert_v1beta1_Subnet_To_v1beta2_Subnet is an autogenerated conversion function. -func Convert_v1beta1_Subnet_To_v1beta2_Subnet(in *Subnet, out *v1beta2.Subnet, s conversion.Scope) error { - return autoConvert_v1beta1_Subnet_To_v1beta2_Subnet(in, out, s) -} - -func autoConvert_v1beta2_Subnet_To_v1beta1_Subnet(in *v1beta2.Subnet, out *Subnet, s conversion.Scope) error { - out.Ipv4CidrBlock = (*string)(unsafe.Pointer(in.Ipv4CidrBlock)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.ID = (*string)(unsafe.Pointer(in.ID)) - out.Zone = (*string)(unsafe.Pointer(in.Zone)) - return nil -} - -// Convert_v1beta2_Subnet_To_v1beta1_Subnet is an autogenerated conversion function. -func Convert_v1beta2_Subnet_To_v1beta1_Subnet(in *v1beta2.Subnet, out *Subnet, s conversion.Scope) error { - return autoConvert_v1beta2_Subnet_To_v1beta1_Subnet(in, out, s) -} - -func autoConvert_v1beta1_VPC_To_v1beta2_VPC(in *VPC, out *v1beta2.VPC, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - return nil -} - -// Convert_v1beta1_VPC_To_v1beta2_VPC is an autogenerated conversion function. -func Convert_v1beta1_VPC_To_v1beta2_VPC(in *VPC, out *v1beta2.VPC, s conversion.Scope) error { - return autoConvert_v1beta1_VPC_To_v1beta2_VPC(in, out, s) -} - -func autoConvert_v1beta2_VPC_To_v1beta1_VPC(in *v1beta2.VPC, out *VPC, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - return nil -} - -// Convert_v1beta2_VPC_To_v1beta1_VPC is an autogenerated conversion function. -func Convert_v1beta2_VPC_To_v1beta1_VPC(in *v1beta2.VPC, out *VPC, s conversion.Scope) error { - return autoConvert_v1beta2_VPC_To_v1beta1_VPC(in, out, s) -} - -func autoConvert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint(in *VPCEndpoint, out *v1beta2.VPCEndpoint, s conversion.Scope) error { - out.Address = (*string)(unsafe.Pointer(in.Address)) - out.FIPID = (*string)(unsafe.Pointer(in.FIPID)) - out.LBID = (*string)(unsafe.Pointer(in.LBID)) - return nil -} - -// Convert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint is an autogenerated conversion function. -func Convert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint(in *VPCEndpoint, out *v1beta2.VPCEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_VPCEndpoint_To_v1beta2_VPCEndpoint(in, out, s) -} - -func autoConvert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(in *v1beta2.VPCEndpoint, out *VPCEndpoint, s conversion.Scope) error { - out.Address = (*string)(unsafe.Pointer(in.Address)) - out.FIPID = (*string)(unsafe.Pointer(in.FIPID)) - out.LBID = (*string)(unsafe.Pointer(in.LBID)) - return nil -} - -// Convert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint is an autogenerated conversion function. -func Convert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(in *v1beta2.VPCEndpoint, out *VPCEndpoint, s conversion.Scope) error { - return autoConvert_v1beta2_VPCEndpoint_To_v1beta1_VPCEndpoint(in, out, s) -} - -func autoConvert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec(in *VPCLoadBalancerSpec, out *v1beta2.VPCLoadBalancerSpec, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec is an autogenerated conversion function. -func Convert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec(in *VPCLoadBalancerSpec, out *v1beta2.VPCLoadBalancerSpec, s conversion.Scope) error { - return autoConvert_v1beta1_VPCLoadBalancerSpec_To_v1beta2_VPCLoadBalancerSpec(in, out, s) -} - -func autoConvert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in *v1beta2.VPCLoadBalancerSpec, out *VPCLoadBalancerSpec, s conversion.Scope) error { - out.Name = in.Name - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Public requires manual conversion: does not exist in peer-type - // WARNING: in.AdditionalListeners requires manual conversion: does not exist in peer-type - // WARNING: in.BackendPools requires manual conversion: does not exist in peer-type - // WARNING: in.SecurityGroups requires manual conversion: does not exist in peer-type - // WARNING: in.Subnets requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_VPCVolume_To_v1beta2_VPCVolume(in *VPCVolume, out *v1beta2.VPCVolume, s conversion.Scope) error { - out.DeleteVolumeOnInstanceDelete = in.DeleteVolumeOnInstanceDelete - out.Name = in.Name - out.SizeGiB = in.SizeGiB - out.Profile = in.Profile - out.Iops = in.Iops - out.EncryptionKeyCRN = in.EncryptionKeyCRN - return nil -} - -// Convert_v1beta1_VPCVolume_To_v1beta2_VPCVolume is an autogenerated conversion function. -func Convert_v1beta1_VPCVolume_To_v1beta2_VPCVolume(in *VPCVolume, out *v1beta2.VPCVolume, s conversion.Scope) error { - return autoConvert_v1beta1_VPCVolume_To_v1beta2_VPCVolume(in, out, s) -} - -func autoConvert_v1beta2_VPCVolume_To_v1beta1_VPCVolume(in *v1beta2.VPCVolume, out *VPCVolume, s conversion.Scope) error { - out.DeleteVolumeOnInstanceDelete = in.DeleteVolumeOnInstanceDelete - out.Name = in.Name - out.SizeGiB = in.SizeGiB - out.Profile = in.Profile - out.Iops = in.Iops - out.EncryptionKeyCRN = in.EncryptionKeyCRN - return nil -} - -// Convert_v1beta2_VPCVolume_To_v1beta1_VPCVolume is an autogenerated conversion function. -func Convert_v1beta2_VPCVolume_To_v1beta1_VPCVolume(in *v1beta2.VPCVolume, out *VPCVolume, s conversion.Scope) error { - return autoConvert_v1beta2_VPCVolume_To_v1beta1_VPCVolume(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/conversion.go deleted file mode 100644 index cf0945832877..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/conversion.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -func (*IBMPowerVSCluster) Hub() {} -func (*IBMPowerVSClusterList) Hub() {} -func (*IBMPowerVSClusterTemplate) Hub() {} -func (*IBMPowerVSClusterTemplateList) Hub() {} -func (*IBMPowerVSMachine) Hub() {} -func (*IBMPowerVSMachineList) Hub() {} -func (*IBMPowerVSMachineTemplate) Hub() {} -func (*IBMPowerVSMachineTemplateList) Hub() {} -func (*IBMPowerVSImage) Hub() {} -func (*IBMPowerVSImageList) Hub() {} -func (*IBMVPCCluster) Hub() {} -func (*IBMVPCClusterList) Hub() {} -func (*IBMVPCMachine) Hub() {} -func (*IBMVPCMachineList) Hub() {} -func (*IBMVPCMachineTemplate) Hub() {} -func (*IBMVPCMachineTemplateList) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/types.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/types.go index 237a7cf37a52..dab7e1bb1f25 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/types.go @@ -16,8 +16,6 @@ limitations under the License. package v1beta2 -import "github.com/IBM/vpc-go-sdk/vpcv1" - const ( // CIDRBlockAny is the CIDRBlock representing any allowable destination/source IP. CIDRBlockAny string = "0.0.0.0/0" @@ -124,69 +122,47 @@ var ( // +kubebuilder:validation:Enum=least_connections;round_robin;weighted_round_robin type VPCLoadBalancerBackendPoolAlgorithm string -var ( - // VPCLoadBalancerBackendPoolAlgorithmLeastConnections is the string representing the least_connections load balancing algorithm. - VPCLoadBalancerBackendPoolAlgorithmLeastConnections VPCLoadBalancerBackendPoolAlgorithm = vpcv1.CreateLoadBalancerPoolOptionsAlgorithmLeastConnectionsConst +// VPCLoadBalancerBackendPoolAlgorithmLeastConnections is the string representing the least_connections load balancing algorithm. - // VPCLoadBalancerBackendPoolAlgorithmRoundRobin is the string representing the round_robin load balancing algorithm. - VPCLoadBalancerBackendPoolAlgorithmRoundRobin VPCLoadBalancerBackendPoolAlgorithm = vpcv1.CreateLoadBalancerPoolOptionsAlgorithmRoundRobinConst +// VPCLoadBalancerBackendPoolAlgorithmRoundRobin is the string representing the round_robin load balancing algorithm. - // VPCLoadBalancerBackendPoolAlgorithmWeightedRoundRobin is the string representing the weighted_round_robin load balancing algorithm. - VPCLoadBalancerBackendPoolAlgorithmWeightedRoundRobin VPCLoadBalancerBackendPoolAlgorithm = vpcv1.CreateLoadBalancerPoolOptionsAlgorithmWeightedRoundRobinConst -) +// VPCLoadBalancerBackendPoolAlgorithmWeightedRoundRobin is the string representing the weighted_round_robin load balancing algorithm. // VPCLoadBalancerBackendPoolProtocol describes the protocol for load balancer backend pools. // We have unique types in case IBM Cloud Load Balancer Listener and Backend Pool supported algorithms ever diverage. // +kubebuilder:validation:Enum=http;https;tcp;udp type VPCLoadBalancerBackendPoolProtocol string -var ( - // VPCLoadBalancerBackendPoolProtocolHTTP is the string representing the http protocol for load balancer backend pools. - VPCLoadBalancerBackendPoolProtocolHTTP VPCLoadBalancerBackendPoolProtocol = vpcv1.LoadBalancerPoolPrototypeLoadBalancerContextProtocolHTTPConst +// VPCLoadBalancerBackendPoolProtocolHTTP is the string representing the http protocol for load balancer backend pools. - // VPCLoadBalancerBackendPoolProtocolHTTPS is the string representing the https protocol for load balancer backend pools. - VPCLoadBalancerBackendPoolProtocolHTTPS VPCLoadBalancerBackendPoolProtocol = vpcv1.LoadBalancerPoolPrototypeLoadBalancerContextProtocolHTTPSConst +// VPCLoadBalancerBackendPoolProtocolHTTPS is the string representing the https protocol for load balancer backend pools. - // VPCLoadBalancerBackendPoolProtocolTCP is the string representing the tcp protocol for load balancer backend pools. - VPCLoadBalancerBackendPoolProtocolTCP VPCLoadBalancerBackendPoolProtocol = vpcv1.LoadBalancerPoolPrototypeLoadBalancerContextProtocolTCPConst +// VPCLoadBalancerBackendPoolProtocolTCP is the string representing the tcp protocol for load balancer backend pools. - // VPCLoadBalancerBackendPoolProtocolUDP is the string representing the tudp protocol for load balancer backend pools. - VPCLoadBalancerBackendPoolProtocolUDP VPCLoadBalancerBackendPoolProtocol = vpcv1.LoadBalancerPoolPrototypeLoadBalancerContextProtocolUDPConst -) +// VPCLoadBalancerBackendPoolProtocolUDP is the string representing the tudp protocol for load balancer backend pools. // VPCLoadBalancerListenerProtocol describes the protocol for load balancer listeners. // We have unique types in case IBM Cloud Load Balancer Listener and Backend Pool supported algorithms ever diverage. // +kubebuilder:validation:Enum=http;https;tcp;udp type VPCLoadBalancerListenerProtocol string -var ( - // VPCLoadBalancerListenerProtocolHTTP is the string representing the http protocol for load balancer listeners. - VPCLoadBalancerListenerProtocolHTTP VPCLoadBalancerListenerProtocol = vpcv1.LoadBalancerListenerProtocolHTTPConst +// VPCLoadBalancerListenerProtocolHTTP is the string representing the http protocol for load balancer listeners. - // VPCLoadBalancerListenerProtocolHTTPS is the string representing the https protocol for load balancer listeners. - VPCLoadBalancerListenerProtocolHTTPS VPCLoadBalancerListenerProtocol = vpcv1.LoadBalancerListenerProtocolHTTPSConst +// VPCLoadBalancerListenerProtocolHTTPS is the string representing the https protocol for load balancer listeners. - // VPCLoadBalancerListenerProtocolTCP is the string representing the tcp protocol for load balancer listeners. - VPCLoadBalancerListenerProtocolTCP VPCLoadBalancerListenerProtocol = vpcv1.LoadBalancerListenerProtocolTCPConst +// VPCLoadBalancerListenerProtocolTCP is the string representing the tcp protocol for load balancer listeners. - // VPCLoadBalancerListenerProtocolUDP is the string representing the tudp protocol for load balancer listeners. - VPCLoadBalancerListenerProtocolUDP VPCLoadBalancerListenerProtocol = vpcv1.LoadBalancerListenerProtocolUDPConst -) +// VPCLoadBalancerListenerProtocolUDP is the string representing the tudp protocol for load balancer listeners. // VPCLoadBalancerBackendPoolHealthMonitorType describes the backend pool's health check protocol type. // +kubebuilder:validation:Enum=http;https;tcp type VPCLoadBalancerBackendPoolHealthMonitorType string -var ( - // VPCLoadBalancerBackendPoolHealthMonitorTypeHTTP is the string representing the http health pool protocol type. - VPCLoadBalancerBackendPoolHealthMonitorTypeHTTP VPCLoadBalancerBackendPoolHealthMonitorType = vpcv1.LoadBalancerPoolHealthMonitorTypeHTTPConst +// VPCLoadBalancerBackendPoolHealthMonitorTypeHTTP is the string representing the http health pool protocol type. - // VPCLoadBalancerBackendPoolHealthMonitorTypeHTTPS is the string representing the https health pool protocol type. - VPCLoadBalancerBackendPoolHealthMonitorTypeHTTPS VPCLoadBalancerBackendPoolHealthMonitorType = vpcv1.LoadBalancerPoolHealthMonitorTypeHTTPSConst +// VPCLoadBalancerBackendPoolHealthMonitorTypeHTTPS is the string representing the https health pool protocol type. - // VPCLoadBalancerBackendPoolHealthMonitorTypeTCP is the string representing the tcp health pool protocol type. - VPCLoadBalancerBackendPoolHealthMonitorTypeTCP VPCLoadBalancerBackendPoolHealthMonitorType = vpcv1.LoadBalancerPoolHealthMonitorTypeTCPConst -) +// VPCLoadBalancerBackendPoolHealthMonitorTypeTCP is the string representing the tcp health pool protocol type. // VPCLoadBalancerState describes the state of the load balancer. type VPCLoadBalancerState string @@ -299,38 +275,29 @@ const ( // +kubebuilder:validation:Enum=allow;deny type VPCSecurityGroupRuleAction string -const ( - // VPCSecurityGroupRuleActionAllow defines that the Rule should allow traffic. - VPCSecurityGroupRuleActionAllow VPCSecurityGroupRuleAction = vpcv1.NetworkACLRuleActionAllowConst - // VPCSecurityGroupRuleActionDeny defines that the Rule should deny traffic. - VPCSecurityGroupRuleActionDeny VPCSecurityGroupRuleAction = vpcv1.NetworkACLRuleActionDenyConst -) +// VPCSecurityGroupRuleActionAllow defines that the Rule should allow traffic. + +// VPCSecurityGroupRuleActionDeny defines that the Rule should deny traffic. // VPCSecurityGroupRuleDirection represents the directions for a Security Group Rule. // +kubebuilder:validation:Enum=inbound;outbound type VPCSecurityGroupRuleDirection string -const ( - // VPCSecurityGroupRuleDirectionInbound defines the Rule is for inbound traffic. - VPCSecurityGroupRuleDirectionInbound VPCSecurityGroupRuleDirection = vpcv1.NetworkACLRuleDirectionInboundConst - // VPCSecurityGroupRuleDirectionOutbound defines the Rule is for outbound traffic. - VPCSecurityGroupRuleDirectionOutbound VPCSecurityGroupRuleDirection = vpcv1.NetworkACLRuleDirectionOutboundConst -) +// VPCSecurityGroupRuleDirectionInbound defines the Rule is for inbound traffic. + +// VPCSecurityGroupRuleDirectionOutbound defines the Rule is for outbound traffic. // VPCSecurityGroupRuleProtocol represents the protocols for a Security Group Rule. // +kubebuilder:validation:Enum=all;icmp;tcp;udp type VPCSecurityGroupRuleProtocol string -const ( - // VPCSecurityGroupRuleProtocolAll defines the Rule is for all network protocols. - VPCSecurityGroupRuleProtocolAll VPCSecurityGroupRuleProtocol = vpcv1.NetworkACLRuleProtocolAllConst - // VPCSecurityGroupRuleProtocolIcmp defiens the Rule is for ICMP network protocol. - VPCSecurityGroupRuleProtocolIcmp VPCSecurityGroupRuleProtocol = vpcv1.NetworkACLRuleProtocolIcmpConst - // VPCSecurityGroupRuleProtocolTCP defines the Rule is for TCP network protocol. - VPCSecurityGroupRuleProtocolTCP VPCSecurityGroupRuleProtocol = vpcv1.NetworkACLRuleProtocolTCPConst - // VPCSecurityGroupRuleProtocolUDP defines the Rule is for UDP network protocol. - VPCSecurityGroupRuleProtocolUDP VPCSecurityGroupRuleProtocol = vpcv1.NetworkACLRuleProtocolUDPConst -) +// VPCSecurityGroupRuleProtocolAll defines the Rule is for all network protocols. + +// VPCSecurityGroupRuleProtocolIcmp defiens the Rule is for ICMP network protocol. + +// VPCSecurityGroupRuleProtocolTCP defines the Rule is for TCP network protocol. + +// VPCSecurityGroupRuleProtocolUDP defines the Rule is for UDP network protocol. // VPCSecurityGroupRuleRemoteType represents the type of Security Group Rule's destination or source is // intended. This is intended to define the VPCSecurityGroupRulePrototype subtype. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/zz_generated.deepcopy.go index faad44717820..8f453b4f584d 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/LICENSE deleted file mode 100644 index 8dada3edaf50..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go index 8b8008ec2241..bd377db7a03c 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* -Copyright The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/LICENSE b/vendor/sigs.k8s.io/cluster-api-provider-openstack/LICENSE deleted file mode 100644 index 51f5e59645fa..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1/zz_generated.deepcopy.go index 6a2484af9ece..54ef8283bcb7 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1/zz_generated.deepcopy.go @@ -1,13 +1,13 @@ //go:build !ignore_autogenerated /* -Copyright 2024 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/conversion.go deleted file mode 100644 index d442dc0f1dfa..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/conversion.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "strings" - - "k8s.io/utils/ptr" -) - -// Hub marks OpenStackCluster as a conversion hub. -func (*OpenStackCluster) Hub() {} - -// Hub marks OpenStackClusterList as a conversion hub. -func (*OpenStackClusterList) Hub() {} - -// Hub marks OpenStackClusterTemplate as a conversion hub. -func (*OpenStackClusterTemplate) Hub() {} - -// Hub marks OpenStackClusterTemplateList as a conversion hub. -func (*OpenStackClusterTemplateList) Hub() {} - -// Hub marks OpenStackMachine as a conversion hub. -func (*OpenStackMachine) Hub() {} - -// Hub marks OpenStackMachineList as a conversion hub. -func (*OpenStackMachineList) Hub() {} - -// Hub marks OpenStackMachineTemplate as a conversion hub. -func (*OpenStackMachineTemplate) Hub() {} - -// Hub marks OpenStackMachineTemplateList as a conversion hub. -func (*OpenStackMachineTemplateList) Hub() {} - -// LegacyCalicoSecurityGroupRules returns a list of security group rules for calico -// that need to be applied to the control plane and worker security groups when -// managed security groups are enabled and upgrading to v1beta1. -func LegacyCalicoSecurityGroupRules() []SecurityGroupRuleSpec { - return []SecurityGroupRuleSpec{ - { - Name: "BGP (calico)", - Description: ptr.To("Created by cluster-api-provider-openstack API conversion - BGP (calico)"), - Direction: "ingress", - EtherType: ptr.To("IPv4"), - PortRangeMin: ptr.To(179), - PortRangeMax: ptr.To(179), - Protocol: ptr.To("tcp"), - RemoteManagedGroups: []ManagedSecurityGroupName{"controlplane", "worker"}, - }, - { - Name: "IP-in-IP (calico)", - Description: ptr.To("Created by cluster-api-provider-openstack API conversion - IP-in-IP (calico)"), - Direction: "ingress", - EtherType: ptr.To("IPv4"), - Protocol: ptr.To("4"), - RemoteManagedGroups: []ManagedSecurityGroupName{"controlplane", "worker"}, - }, - } -} - -// splitTags splits a comma separated list of tags into a slice of tags. -// If the input is an empty string, it returns nil representing no list rather -// than an empty list. -func splitTags(tags string) []NeutronTag { - if tags == "" { - return nil - } - - var ret []NeutronTag - for _, tag := range strings.Split(tags, ",") { - if tag != "" { - ret = append(ret, NeutronTag(tag)) - } - } - - return ret -} - -// JoinTags joins a slice of tags into a comma separated list of tags. -func JoinTags(tags []NeutronTag) string { - var b strings.Builder - for i := range tags { - if i > 0 { - b.WriteString(",") - } - b.WriteString(string(tags[i])) - } - return b.String() -} - -func ConvertAllTagsTo(tags, tagsAny, notTags, notTagsAny string, neutronTags *FilterByNeutronTags) { - neutronTags.Tags = splitTags(tags) - neutronTags.TagsAny = splitTags(tagsAny) - neutronTags.NotTags = splitTags(notTags) - neutronTags.NotTagsAny = splitTags(notTagsAny) -} - -func ConvertAllTagsFrom(neutronTags *FilterByNeutronTags, tags, tagsAny, notTags, notTagsAny *string) { - *tags = JoinTags(neutronTags.Tags) - *tagsAny = JoinTags(neutronTags.TagsAny) - *notTags = JoinTags(neutronTags.NotTags) - *notTagsAny = JoinTags(neutronTags.NotTagsAny) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go index b93422b7a336..41256111f450 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go @@ -1,13 +1,13 @@ //go:build !ignore_autogenerated /* -Copyright 2024 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors/errors.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors/errors.go index 5c7b18d0cbfd..96c446a45cdf 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors/errors.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors/errors.go @@ -17,11 +17,7 @@ limitations under the License. package errors import ( - "errors" "fmt" - "net/http" - - "github.com/gophercloud/gophercloud/v2" ) var ( @@ -51,44 +47,10 @@ func (e noMatchesError) Is(err error) bool { return err == ErrFilterMatch } -func IsRetryable(err error) bool { - var errUnexpectedResponseCode gophercloud.ErrUnexpectedResponseCode - if errors.As(err, &errUnexpectedResponseCode) { - statusCode := errUnexpectedResponseCode.GetStatusCode() - return statusCode >= 500 && statusCode != http.StatusNotImplemented - } - return false -} - -func IsNotFound(err error) bool { - if err == nil { - return false - } - - // Gophercloud is not consistent in how it returns 404 errors. Sometimes - // it returns a pointer to the error, sometimes it returns the error - // directly. - // Some discussion here: https://github.com/gophercloud/gophercloud/v2/issues/2279 - var errNotFound gophercloud.ErrResourceNotFound - var pErrNotFound *gophercloud.ErrResourceNotFound - if errors.As(err, &errNotFound) || errors.As(err, &pErrNotFound) { - return true - } - - return gophercloud.ResponseCodeIs(err, http.StatusNotFound) -} - -func IsInvalidError(err error) bool { - return gophercloud.ResponseCodeIs(err, http.StatusBadRequest) -} - -func IsConflict(err error) bool { - return gophercloud.ResponseCodeIs(err, http.StatusConflict) -} - -func IsNotImplementedError(err error) bool { - return gophercloud.ResponseCodeIs(err, http.StatusNotImplemented) -} +// Gophercloud is not consistent in how it returns 404 errors. Sometimes +// it returns a pointer to the error, sometimes it returns the error +// directly. +// Some discussion here: https://github.com/gophercloud/gophercloud/v2/issues/2279 // The following types and constants are imported from CAPI and will be removed at some point once we // implement the conditions that will be required in CAPI v1beta2 diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional/conversion.go deleted file mode 100644 index 3665988a7c1c..000000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional/conversion.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package optional - -import ( - "k8s.io/apimachinery/pkg/conversion" -) - -func RestoreString(previous, dst *String) { - if *dst == nil || **dst == "" { - *dst = *previous - } -} - -func RestoreInt(previous, dst *Int) { - if *dst == nil || **dst == 0 { - *dst = *previous - } -} - -func RestoreUInt16(previous, dst *UInt16) { - if *dst == nil || **dst == 0 { - *dst = *previous - } -} - -func RestoreBool(previous, dst *Bool) { - if *dst == nil || !**dst { - *dst = *previous - } -} - -func Convert_string_To_optional_String(in *string, out *String, _ conversion.Scope) error { - // NOTE: This function has the opposite defaulting behaviour to - // Convert_string_to_Pointer_string defined in apimachinery: it converts - // empty strings to nil instead of a pointer to an empty string. - - if *in == "" { - *out = nil - } else { - *out = in - } - return nil -} - -func Convert_optional_String_To_string(in *String, out *string, _ conversion.Scope) error { - if *in == nil { - *out = "" - } else { - *out = **in - } - return nil -} - -func Convert_int_To_optional_Int(in *int, out *Int, _ conversion.Scope) error { - if *in == 0 { - *out = nil - } else { - *out = in - } - return nil -} - -func Convert_optional_Int_To_int(in *Int, out *int, _ conversion.Scope) error { - if *in == nil { - *out = 0 - } else { - *out = **in - } - return nil -} - -func Convert_uint16_To_optional_UInt16(in *uint16, out *UInt16, _ conversion.Scope) error { - if *in == 0 { - *out = nil - } else { - *out = in - } - return nil -} - -func Convert_optional_UInt16_To_uint16(in *UInt16, out *uint16, _ conversion.Scope) error { - if *in == nil { - *out = 0 - } else { - *out = **in - } - return nil -} - -func Convert_bool_To_optional_Bool(in *bool, out *Bool, _ conversion.Scope) error { - if !*in { - *out = nil - } else { - *out = in - } - return nil -} - -func Convert_optional_Bool_To_bool(in *Bool, out *bool, _ conversion.Scope) error { - if *in == nil { - *out = false - } else { - *out = **in - } - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/annotations.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/annotations.go deleted file mode 100644 index a9436dec3fc2..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/annotations.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -const ( - // CertManagerVersionAnnotation reports the cert manager version installed by clusterctl. - CertManagerVersionAnnotation = "cert-manager.clusterctl.cluster.x-k8s.io/version" - - // SkipCRDNamePreflightCheckAnnotation can be placed on provider CRDs, so that clusterctl doesn't emit a - // warning if the CRD doesn't comply with Cluster APIs naming scheme. - // Note: Only CRDs that are referenced by core Cluster API CRDs have to comply with the naming scheme. - // See the following issue for more information: https://github.com/kubernetes-sigs/cluster-api/issues/5686#issuecomment-1260897278 - SkipCRDNamePreflightCheckAnnotation = "clusterctl.cluster.x-k8s.io/skip-crd-name-preflight-check" - - // DeleteForMoveAnnotation will be set to objects that are going to be deleted from the - // source cluster after being moved to the target cluster during the clusterctl move operation. - // - // It will help any validation webhook to take decision based on it. - DeleteForMoveAnnotation = "clusterctl.cluster.x-k8s.io/delete-for-move" - - // BlockMoveAnnotation prevents the cluster move operation from starting if it is defined on at least one - // of the objects in scope. - // Provider controllers are expected to set the annotation on resources that cannot be instantaneously - // paused and remove the annotation when the resource has been actually paused. - // - // e.g. If this annotation is defined with any value on an InfraMachine resource to be moved when - // `clusterctl move` is invoked, then NO resources for ANY workload cluster will be created on the - // destination management cluster until the annotation is removed. - BlockMoveAnnotation = "clusterctl.cluster.x-k8s.io/block-move" -) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/labels.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/labels.go deleted file mode 100644 index a6dacf143ccd..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/labels.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import "fmt" - -const ( - // ClusterctlLabel is applied to all components managed by clusterctl. - ClusterctlLabel = "clusterctl.cluster.x-k8s.io" - - // ClusterctlCoreLabel is applied to all the core objects managed by clusterctl. - ClusterctlCoreLabel = "clusterctl.cluster.x-k8s.io/core" - - // ClusterctlCoreLabelInventoryValue define the value for ClusterctlCoreLabel to be used for inventory objects. - ClusterctlCoreLabelInventoryValue = "inventory" - - // ClusterctlCoreLabelCertManagerValue define the value for ClusterctlCoreLabel to be used for cert-manager objects. - ClusterctlCoreLabelCertManagerValue = "cert-manager" - - // ClusterctlMoveLabel can be set on CRDs that providers wish to move but that are not part of a Cluster. - ClusterctlMoveLabel = "clusterctl.cluster.x-k8s.io/move" - - // ClusterctlMoveHierarchyLabel can be set on CRDs that providers wish to move with their entire hierarchy, but that are not part of a Cluster. - ClusterctlMoveHierarchyLabel = "clusterctl.cluster.x-k8s.io/move-hierarchy" -) - -// ManifestLabel returns the cluster.x-k8s.io/provider label value for a provider/type. -// -// Note: the label uniquely describes the provider type and its kind (e.g. bootstrap-kubeadm); -// it's not meant to be used to describe each instance of a particular provider. -func ManifestLabel(name string, providerType ProviderType) string { - switch providerType { - case BootstrapProviderType: - return fmt.Sprintf("bootstrap-%s", name) - case ControlPlaneProviderType: - return fmt.Sprintf("control-plane-%s", name) - case InfrastructureProviderType: - return fmt.Sprintf("infrastructure-%s", name) - case IPAMProviderType: - return fmt.Sprintf("ipam-%s", name) - case RuntimeExtensionProviderType: - return fmt.Sprintf("runtime-extension-%s", name) - case AddonProviderType: - return fmt.Sprintf("addon-%s", name) - default: - return name - } -} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/metadata_type.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/metadata_type.go deleted file mode 100644 index e7b6cf199f1f..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/metadata_type.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "github.com/blang/semver/v4" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/version" -) - -// +kubebuilder:object:root=true - -// Metadata for a provider repository. -type Metadata struct { - metav1.TypeMeta `json:",inline"` - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // releaseSeries maps a provider release series (major/minor) with a Cluster API contract version. - // +optional - ReleaseSeries []ReleaseSeries `json:"releaseSeries"` -} - -// ReleaseSeries maps a provider release series (major/minor) with a Cluster API contract version. -type ReleaseSeries struct { - // major version of the release series - // +optional - Major int32 `json:"major,omitempty"` - - // minor version of the release series - // +optional - Minor int32 `json:"minor,omitempty"` - - // contract defines the Cluster API contract supported by this series. - // - // The value is an API Version, e.g. `v1alpha3`. - // +optional - Contract string `json:"contract,omitempty"` -} - -func (rs ReleaseSeries) newer(release ReleaseSeries) bool { - v := semver.Version{Major: uint64(rs.Major), Minor: uint64(rs.Minor)} - ver := semver.Version{Major: uint64(release.Major), Minor: uint64(release.Minor)} - return v.GTE(ver) -} - -func init() { - objectTypes = append(objectTypes, &Metadata{}) -} - -// GetReleaseSeriesForVersion returns the release series for a given version. -func (m *Metadata) GetReleaseSeriesForVersion(version *version.Version) *ReleaseSeries { - for _, releaseSeries := range m.ReleaseSeries { - if version.Major() == uint(releaseSeries.Major) && version.Minor() == uint(releaseSeries.Minor) { - return &releaseSeries - } - } - - return nil -} - -// GetReleaseSeriesForContract returns the release series for a given API Version, e.g. `v1alpha4`. -// If more than one release series use the same contract then the latest newer release series is -// returned. -func (m *Metadata) GetReleaseSeriesForContract(contract string) *ReleaseSeries { - var rs ReleaseSeries - var found bool - for _, releaseSeries := range m.ReleaseSeries { - if contract == releaseSeries.Contract { - found = true - if releaseSeries.newer(rs) { - rs = releaseSeries - } - } - } - if !found { - return nil - } - return &rs -} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/provider_type.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/provider_type.go deleted file mode 100644 index 673e56e6306a..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/provider_type.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// +kubebuilder:resource:path=providers,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Provider" -// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".type" -// +kubebuilder:printcolumn:name="Provider",type="string",JSONPath=".providerName" -// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".version" - -// Provider defines an entry in the provider inventory. -type Provider struct { - metav1.TypeMeta `json:",inline"` - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // providerName indicates the name of the provider. - // +optional - ProviderName string `json:"providerName,omitempty"` - - // type indicates the type of the provider. - // See ProviderType for a list of supported values - // +optional - Type string `json:"type,omitempty"` - - // version indicates the component version. - // +optional - Version string `json:"version,omitempty"` - - // watchedNamespace indicates the namespace where the provider controller is watching. - // If empty the provider controller is watching for objects in all namespaces. - // - // Deprecated: providers complying with the Cluster API v1alpha4 contract or above must watch all namespaces; this field will be removed in a future version of this API - // +optional - WatchedNamespace string `json:"watchedNamespace,omitempty"` -} - -// ManifestLabel returns the cluster.x-k8s.io/provider label value for an entry in the provider inventory. -// Please note that this label uniquely identifies the provider, e.g. bootstrap-kubeadm, but not the instances of -// the provider, e.g. namespace-1/bootstrap-kubeadm and namespace-2/bootstrap-kubeadm. -func (p *Provider) ManifestLabel() string { - return ManifestLabel(p.ProviderName, p.GetProviderType()) -} - -// InstanceName return the a name that uniquely identifies an entry in the provider inventory. -// The instanceName is composed by the ManifestLabel and by the namespace where the provider is installed; -// the resulting value uniquely identify a provider instance because clusterctl does not support multiple -// instances of the same provider to be installed in the same namespace. -func (p *Provider) InstanceName() string { - return types.NamespacedName{Namespace: p.Namespace, Name: p.ManifestLabel()}.String() -} - -// SameAs returns true if two providers have the same ProviderName and Type. -// Please note that there could be many instances of the same provider. -func (p *Provider) SameAs(other Provider) bool { - return p.ProviderName == other.ProviderName && p.Type == other.Type -} - -// Equals returns true if two providers are identical (same name, provider name, type, version etc.). -func (p *Provider) Equals(other Provider) bool { - return p.Name == other.Name && - p.Namespace == other.Namespace && - p.ProviderName == other.ProviderName && - p.Type == other.Type && - p.WatchedNamespace == other.WatchedNamespace && - p.Version == other.Version -} - -// GetProviderType parse the Provider.Type string field and return the typed representation. -func (p *Provider) GetProviderType() ProviderType { - switch t := ProviderType(p.Type); t { - case - CoreProviderType, - BootstrapProviderType, - InfrastructureProviderType, - ControlPlaneProviderType, - IPAMProviderType, - RuntimeExtensionProviderType, - AddonProviderType: - return t - default: - return ProviderTypeUnknown - } -} - -// ProviderType is a string representation of a Provider type. -type ProviderType string - -const ( - // CoreProviderType is a type reserved for Cluster API core repository. - CoreProviderType = ProviderType("CoreProvider") - - // BootstrapProviderType is the type associated with codebases that provide - // bootstrapping capabilities. - BootstrapProviderType = ProviderType("BootstrapProvider") - - // InfrastructureProviderType is the type associated with codebases that provide - // infrastructure capabilities. - InfrastructureProviderType = ProviderType("InfrastructureProvider") - - // ControlPlaneProviderType is the type associated with codebases that provide - // control-plane capabilities. - ControlPlaneProviderType = ProviderType("ControlPlaneProvider") - - // IPAMProviderType is the type associated with codebases that provide - // IPAM capabilities. - IPAMProviderType = ProviderType("IPAMProvider") - - // RuntimeExtensionProviderType is the type associated with codebases that provide - // runtime extensions. - RuntimeExtensionProviderType = ProviderType("RuntimeExtensionProvider") - - // AddonProviderType is the type associated with codebases that provide - // add-on capabilities. - AddonProviderType = ProviderType("AddonProvider") - - // ProviderTypeUnknown is used when the type is unknown. - ProviderTypeUnknown = ProviderType("") -) - -// Order return an integer that can be used to sort ProviderType values. -func (p ProviderType) Order() int { - switch p { - case CoreProviderType: - return 0 - case BootstrapProviderType: - return 1 - case ControlPlaneProviderType: - return 2 - case InfrastructureProviderType: - return 3 - case IPAMProviderType: - return 4 - case RuntimeExtensionProviderType: - return 5 - case AddonProviderType: - return 6 - default: - return 99 - } -} - -// +kubebuilder:object:root=true - -// ProviderList contains a list of Provider. -type ProviderList struct { - metav1.TypeMeta `json:",inline"` - // metadata is the standard list's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - // items is the list of Providers. - Items []Provider `json:"items"` -} - -// FilterByNamespace returns a new list of providers that reside in the namespace provided. -func (l *ProviderList) FilterByNamespace(namespace string) []Provider { - return l.filterBy(func(p Provider) bool { - return p.Namespace == namespace - }) -} - -// FilterByProviderNameAndType returns a new list of provider that match the name and type. -func (l *ProviderList) FilterByProviderNameAndType(provider string, providerType ProviderType) []Provider { - return l.filterBy(func(p Provider) bool { - return p.ProviderName == provider && p.Type == string(providerType) - }) -} - -// FilterByProviderNameNamespaceTypeVersion returns a new list of provider that match the name, namespace, type and version. -func (l *ProviderList) FilterByProviderNameNamespaceTypeVersion(provider, namespace string, providerType ProviderType, version string) []Provider { - return l.filterBy(func(p Provider) bool { - return p.ProviderName == provider && p.Namespace == namespace && p.Type == string(providerType) && p.Version == version - }) -} - -// FilterByType returns a new list of providers that match the given type. -func (l *ProviderList) FilterByType(providerType ProviderType) []Provider { - return l.filterBy(func(p Provider) bool { - return p.GetProviderType() == providerType - }) -} - -// FilterCore returns a new list of providers that are in the core. -func (l *ProviderList) FilterCore() []Provider { - return l.filterBy(func(p Provider) bool { - return p.GetProviderType() == CoreProviderType - }) -} - -// FilterNonCore returns a new list of providers that are not in the core. -func (l *ProviderList) FilterNonCore() []Provider { - return l.filterBy(func(p Provider) bool { - return p.GetProviderType() != CoreProviderType - }) -} - -func (l *ProviderList) filterBy(predicate func(p Provider) bool) []Provider { - ret := []Provider{} - for _, i := range l.Items { - if predicate(i) { - ret = append(ret, i) - } - } - return ret -} - -func init() { - objectTypes = append(objectTypes, &Provider{}, &ProviderList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/zz_generated.deepcopy.go deleted file mode 100644 index 47ff72966254..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3/zz_generated.deepcopy.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Metadata) DeepCopyInto(out *Metadata) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.ReleaseSeries != nil { - in, out := &in.ReleaseSeries, &out.ReleaseSeries - *out = make([]ReleaseSeries, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata. -func (in *Metadata) DeepCopy() *Metadata { - if in == nil { - return nil - } - out := new(Metadata) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Metadata) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Provider) DeepCopyInto(out *Provider) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Provider. -func (in *Provider) DeepCopy() *Provider { - if in == nil { - return nil - } - out := new(Provider) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Provider) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderList) DeepCopyInto(out *ProviderList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Provider, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderList. -func (in *ProviderList) DeepCopy() *ProviderList { - if in == nil { - return nil - } - out := new(ProviderList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProviderList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReleaseSeries) DeepCopyInto(out *ReleaseSeries) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseSeries. -func (in *ReleaseSeries) DeepCopy() *ReleaseSeries { - if in == nil { - return nil - } - out := new(ReleaseSeries) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/sigs.k8s.io/cluster-api/feature/feature.go b/vendor/sigs.k8s.io/cluster-api/feature/feature.go deleted file mode 100644 index 15a6fb169b4a..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/feature/feature.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package feature implements feature functionality. -package feature - -import ( - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/component-base/featuregate" -) - -const ( - // Every feature gate should add method here following this template: - // - // // owner: @username - // // alpha: v1.X - // MyFeature featuregate.Feature = "MyFeature". - - // MachinePool is a feature gate for MachinePool functionality. - // - // alpha: v0.3 - // beta: v1.7 - MachinePool featuregate.Feature = "MachinePool" - - // ClusterResourceSet is a feature gate for the ClusterResourceSet functionality. - // - // alpha: v0.3 - // beta: v0.4 - // GA: v1.10 - // - // Deprecated: ClusterResourceSet feature is now GA and the corresponding feature flag will be removed in 1.12 release. - ClusterResourceSet featuregate.Feature = "ClusterResourceSet" - - // ClusterTopology is a feature gate for the ClusterClass and managed topologies functionality. - // - // alpha: v0.4 - ClusterTopology featuregate.Feature = "ClusterTopology" - - // RuntimeSDK is a feature gate for the Runtime hooks and extensions functionality. - // - // alpha: v1.2 - RuntimeSDK featuregate.Feature = "RuntimeSDK" - - // KubeadmBootstrapFormatIgnition is a feature gate for the Ignition bootstrap format - // functionality. - // - // alpha: v1.1 - KubeadmBootstrapFormatIgnition featuregate.Feature = "KubeadmBootstrapFormatIgnition" - - // MachineSetPreflightChecks is a feature gate for the MachineSet preflight checks functionality. - // - // alpha: v1.5 - // beta: v1.9 - MachineSetPreflightChecks featuregate.Feature = "MachineSetPreflightChecks" - - // MachineWaitForVolumeDetachConsiderVolumeAttachments is a feature gate that controls if the Machine controller - // also considers VolumeAttachments in addition to Nodes.status.volumesAttached when waiting for volumes to be detached. - // - // beta: v1.9 - MachineWaitForVolumeDetachConsiderVolumeAttachments featuregate.Feature = "MachineWaitForVolumeDetachConsiderVolumeAttachments" - - // PriorityQueue is a feature gate that controls if the controller uses the controller-runtime PriorityQueue - // instead of the default queue implementation. - // - // alpha: v1.10 - PriorityQueue featuregate.Feature = "PriorityQueue" -) - -func init() { - runtime.Must(MutableGates.Add(defaultClusterAPIFeatureGates)) -} - -// defaultClusterAPIFeatureGates consists of all known cluster-api-specific feature keys. -// To add a new feature, define a key for it above and add it here. -var defaultClusterAPIFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ - // Every feature should be initiated here: - ClusterResourceSet: {Default: true, PreRelease: featuregate.GA}, - MachinePool: {Default: true, PreRelease: featuregate.Beta}, - MachineSetPreflightChecks: {Default: true, PreRelease: featuregate.Beta}, - MachineWaitForVolumeDetachConsiderVolumeAttachments: {Default: true, PreRelease: featuregate.Beta}, - PriorityQueue: {Default: false, PreRelease: featuregate.Alpha}, - ClusterTopology: {Default: false, PreRelease: featuregate.Alpha}, - KubeadmBootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha}, - RuntimeSDK: {Default: false, PreRelease: featuregate.Alpha}, -} diff --git a/vendor/sigs.k8s.io/cluster-api/feature/gates.go b/vendor/sigs.k8s.io/cluster-api/feature/gates.go deleted file mode 100644 index 1d3d9ec03030..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/feature/gates.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package feature - -import ( - "k8s.io/component-base/featuregate" -) - -var ( - // MutableGates is a mutable version of DefaultFeatureGate. - // Only top-level commands/options setup and the k8s.io/component-base/featuregate/testing package should make use of this. - // Tests that need to modify featuregate gates for the duration of their test should use: - // defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features., )() - MutableGates featuregate.MutableFeatureGate = featuregate.NewFeatureGate() - - // Gates is a shared global FeatureGate. - // Top-level commands/options setup that needs to modify this featuregate gate should use DefaultMutableFeatureGate. - Gates featuregate.FeatureGate = MutableGates -) diff --git a/vendor/sigs.k8s.io/cluster-api/util/topology/topology.go b/vendor/sigs.k8s.io/cluster-api/util/topology/topology.go deleted file mode 100644 index eb903e156c74..000000000000 --- a/vendor/sigs.k8s.io/cluster-api/util/topology/topology.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package topology implements topology utility functions. -package topology - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - - clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" -) - -// ShouldSkipImmutabilityChecks returns true if it is a dry-run request and the object has the -// TopologyDryRunAnnotation annotation set, false otherwise. -// This ensures that the immutability check is skipped only when dry-running and when the operations has been invoked by the topology controller. -// Instead, kubectl dry-run behavior remains consistent with the one user gets when doing kubectl apply (immutability is enforced). -// -// Deprecated: Please use IsDryRunRequest instead. -func ShouldSkipImmutabilityChecks(req admission.Request, obj metav1.Object) bool { - return IsDryRunRequest(req, obj) -} - -// IsDryRunRequest returns true if it is a dry-run request and the object has the -// TopologyDryRunAnnotation annotation set, false otherwise. -func IsDryRunRequest(req admission.Request, obj metav1.Object) bool { - // Check if the request is a dry-run - if req.DryRun == nil || !*req.DryRun { - return false - } - - if obj == nil { - return false - } - - // Check for the TopologyDryRunAnnotation - annotations := obj.GetAnnotations() - if annotations == nil { - return false - } - if _, ok := annotations[clusterv1.TopologyDryRunAnnotation]; ok { - return true - } - return false -}